pub fn new(serial: Arc<Mutex<SerialDevice>>, i8042_reset_evfd: EventFd) -> Result<Self> {
        let io_bus = devices::Bus::new();
        let com_evt_1_3 = serial
            .lock()
            .expect("Poisoned lock")
            .serial
            .interrupt_evt()
            .try_clone()
            .map_err(Error::EventFd)?;
        let com_evt_2_4 = EventFdTrigger::new(EventFd::new(EFD_NONBLOCK).map_err(Error::EventFd)?);
        let kbd_evt = EventFd::new(libc::EFD_NONBLOCK).map_err(Error::EventFd)?;

        let i8042 = Arc::new(Mutex::new(devices::legacy::I8042Device::new(
            i8042_reset_evfd,
            kbd_evt.try_clone().map_err(Error::EventFd)?,
        )));

        Ok(PortIODeviceManager {
            io_bus,
            stdio_serial: serial,
            i8042,
            com_evt_1_3,
            com_evt_2_4,
            kbd_evt,
        })
    }
/// Create a new DeviceManager handling legacy devices (uart, i8042).
Create a new DeviceManager handling legacy devices (uart, i8042).
Create a new DeviceManager handling legacy devices ( uart i8042 ) .
pub fn new(serial: Arc<Mutex<SerialDevice>>, i8042_reset_evfd: EventFd) -> Result<Self> {
        let io_bus = devices::Bus::new();
        let com_evt_1_3 = serial
            .lock()
            .expect("Poisoned lock")
            .serial
            .interrupt_evt()
            .try_clone()
            .map_err(Error::EventFd)?;
        let com_evt_2_4 = EventFdTrigger::new(EventFd::new(EFD_NONBLOCK).map_err(Error::EventFd)?);
        let kbd_evt = EventFd::new(libc::EFD_NONBLOCK).map_err(Error::EventFd)?;
        let i8042 = Arc::new(Mutex::new(devices::legacy::I8042Device::new(
            i8042_reset_evfd,
            kbd_evt.try_clone().map_err(Error::EventFd)?,
        )));
        Ok(PortIODeviceManager {
            io_bus,
            stdio_serial: serial,
            i8042,
            com_evt_1_3,
            com_evt_2_4,
            kbd_evt,
        })
    }
pub fn new ( serial : Arc < Mutex < SerialDevice > > , i8042_reset_evfd : EventFd ) -> Result < Self > { let io_bus = devices :: Bus :: new ( ) ; let com_evt_1_3 = serial . lock ( ) . expect ( " " ) . serial . interrupt_evt ( ) . try_clone ( ) . map_err ( Error :: EventFd ) ? ; let com_evt_2_4 = EventFdTrigger :: new ( EventFd :: new ( EFD_NONBLOCK ) . map_err ( Error :: EventFd ) ? ) ; let kbd_evt = EventFd :: new ( libc :: EFD_NONBLOCK ) . map_err ( Error :: EventFd ) ? ; let i8042 = Arc :: new ( Mutex :: new ( devices :: legacy :: I8042Device :: new ( i8042_reset_evfd , kbd_evt . try_clone ( ) . map_err ( Error :: EventFd ) ? , ) ) ) ; Ok ( PortIODeviceManager { io_bus , stdio_serial : serial , i8042 , com_evt_1_3 , com_evt_2_4 , kbd_evt , } ) }
Create a new DeviceManager handling legacy devices (uart, i8042).
Create a new DeviceManager handling legacy devices ( uart i8042 ) .
serial
Arc<Mutex<SerialDevice>>
i8042_reset_evfd
EventFd
serial
Arc<Mutex<SerialDevice>>
i8042_reset_evfd
EventFd