mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm, devices: Add firmware debug port device
OVMF and other standard firmwares use I/O port 0x402 as a simple debug port by writing ASCII characters to it. This is gated under a feature that is not enabled by default. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
82d0cdff4f
commit
e7e0e8ac38
@@ -10,6 +10,7 @@ acpi = ["acpi_tables","devices/acpi"]
|
||||
pci_support = ["pci", "vfio", "vm-virtio/pci_support"]
|
||||
mmio_support = ["vm-virtio/mmio_support"]
|
||||
cmos = ["devices/cmos"]
|
||||
fwdebug = ["devices/fwdebug"]
|
||||
|
||||
[dependencies]
|
||||
arc-swap = ">=0.4.4"
|
||||
|
||||
@@ -947,6 +947,18 @@ impl DeviceManager {
|
||||
.insert(cmos, 0x70, 0x2)
|
||||
.map_err(DeviceManagerError::BusError)?;
|
||||
}
|
||||
#[cfg(feature = "fwdebug")]
|
||||
{
|
||||
let fwdebug = Arc::new(Mutex::new(devices::legacy::FwDebugDevice::new()));
|
||||
|
||||
self.bus_devices
|
||||
.push(Arc::clone(&fwdebug) as Arc<Mutex<dyn BusDevice>>);
|
||||
|
||||
self.address_manager
|
||||
.io_bus
|
||||
.insert(fwdebug, 0x402, 0x1)
|
||||
.map_err(DeviceManagerError::BusError)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user