pub fn register_mmio_serial(
        &mut self,
        vm: &VmFd,
        cmdline: &mut kernel_cmdline::Cmdline,
        serial: Arc<Mutex<devices::legacy::Serial>>,
    ) -> Result<()> {
        if self.irq > self.last_irq {
            return Err(Error::IrqsExhausted);
        }

        vm.register_irqfd(&serial.lock().unwrap().interrupt_evt(), self.irq)
            .map_err(Error::RegisterIrqFd)?;

        self.bus
            .insert(serial, self.mmio_base, MMIO_LEN)
            .map_err(|err| Error::BusError(err))?;

        cmdline
            .insert("earlycon", &format!("uart,mmio,0x{:08x}", self.mmio_base))
            .map_err(Error::Cmdline)?;

        let ret = self.mmio_base;
        self.id_to_dev_info.insert(
            (DeviceType::Serial, DeviceType::Serial.to_string()),
            MMIODeviceInfo {
                addr: ret,
                len: MMIO_LEN,
                irq: self.irq,
            },
        );

        self.mmio_base += MMIO_LEN;
        self.irq += 1;

        Ok(())
    }
/// Register an early console at some MMIO address.
Register an early console at some MMIO address.
Register an early console at some MMIO address .
pub fn register_mmio_serial(
        &mut self,
        vm: &VmFd,
        cmdline: &mut kernel_cmdline::Cmdline,
        serial: Arc<Mutex<devices::legacy::Serial>>,
    ) -> Result<()> {
        if self.irq > self.last_irq {
            return Err(Error::IrqsExhausted);
        }
        vm.register_irqfd(&serial.lock().unwrap().interrupt_evt(), self.irq)
            .map_err(Error::RegisterIrqFd)?;
        self.bus
            .insert(serial, self.mmio_base, MMIO_LEN)
            .map_err(|err| Error::BusError(err))?;
        cmdline
            .insert("earlycon", &format!("uart,mmio,0x{:08x}", self.mmio_base))
            .map_err(Error::Cmdline)?;
        let ret = self.mmio_base;
        self.id_to_dev_info.insert(
            (DeviceType::Serial, DeviceType::Serial.to_string()),
            MMIODeviceInfo {
                addr: ret,
                len: MMIO_LEN,
                irq: self.irq,
            },
        );
        self.mmio_base += MMIO_LEN;
        self.irq += 1;
        Ok(())
    }
pub fn register_mmio_serial ( & mut self , vm : & VmFd , cmdline : & mut kernel_cmdline :: Cmdline , serial : Arc < Mutex < devices :: legacy :: Serial > > , ) -> Result < ( ) > { if self . irq > self . last_irq { return Err ( Error :: IrqsExhausted ) ; } vm . register_irqfd ( & serial . lock ( ) . unwrap ( ) . interrupt_evt ( ) , self . irq ) . map_err ( Error :: RegisterIrqFd ) ? ; self . bus . insert ( serial , self . mmio_base , MMIO_LEN ) . map_err ( | err | Error :: BusError ( err ) ) ? ; cmdline . insert ( " " , & format ! ( " " self mmio_base ) ) . map_err ( Error :: Cmdline ) ? ; let ret = self . mmio_base ; self . id_to_dev_info . insert ( ( DeviceType :: Serial , DeviceType :: Serial . to_string ( ) ) , MMIODeviceInfo { addr : ret , len : MMIO_LEN , irq : self . irq , } , ) ; self . mmio_base += MMIO_LEN ; self . irq += 1 ; Ok ( ( ) ) }
Register an early console at some MMIO address.
Register an early console at some MMIO address .
&mut self
vm
&VmFd
cmdline
&mut kernel_cmdline::Cmdline
serial
Arc<Mutex<devices::legacy::Serial>>