mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user