Function arch::serial::add_serial_devices
source · pub fn add_serial_devices(
protection_type: ProtectionType,
io_bus: &Bus,
com_evt_1_3: (u32, &Event),
com_evt_2_4: (u32, &Event),
serial_parameters: &BTreeMap<(SerialHardware, u8), SerialParameters>,
serial_jail: Option<Minijail>,
swap_controller: &mut Option<SwapController>
) -> Result<Vec<SerialDeviceInfo>, DeviceRegistrationError>
Expand description
Adds serial devices to the provided bus based on the serial parameters given.
Only devices with hardware type SerialHardware::Serial
are added by this function.
§Arguments
protection_type
- VM protection mode.io_bus
- Bus to add the devices tocom_evt_1_3
- irq and event for com1 and com3com_evt_1_4
- irq and event for com2 and com4serial_parameters
- definitions of serial parameter configurations.serial_jail
- minijail object cloned for use with each serial device. All four of the traditional PC-style serial ports (COM1-COM4) must be specified.