vmm, devices: Remove hardcoded IRQ number for GED device

Remove the previously hardcoded IRQ number used for the GED device.
Instead allocate the IRQ using the allocator and use that value in the
definition in the ACPI device.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-12-09 15:07:31 +00:00
parent ce1bd9c7ff
commit ba59c62044
2 changed files with 25 additions and 9 deletions

View File

@@ -57,13 +57,15 @@ impl BusDevice for AcpiShutdownDevice {
pub struct AcpiGEDDevice {
interrupt: Box<dyn Interrupt>,
notification_type: HotPlugNotificationType,
ged_irq: u32,
}
impl AcpiGEDDevice {
pub fn new(interrupt: Box<dyn Interrupt>) -> AcpiGEDDevice {
pub fn new(interrupt: Box<dyn Interrupt>, ged_irq: u32) -> AcpiGEDDevice {
AcpiGEDDevice {
interrupt,
notification_type: HotPlugNotificationType::NoDevicesChanged,
ged_irq,
}
}
@@ -74,6 +76,10 @@ impl AcpiGEDDevice {
self.notification_type = notification_type;
self.interrupt.deliver()
}
pub fn irq(&self) -> u32 {
self.ged_irq
}
}
// I/O port reports what type of notification was made