Skip to content

Commit d68d8c2

Browse files
committed
Add Qemu pvpanic device to DSDT
Implement DsdtGenerator for QemuPvPanic to export it via new DSDT. Signed-off-by: Amey Narkhede <ameynarkhede03@gmail.com>
1 parent 37e7b0f commit d68d8c2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

lib/propolis/src/hw/qemu/pvpanic.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,29 @@ impl Lifecycle for QemuPvpanic {
108108
fn type_name(&self) -> &'static str {
109109
DEVICE_NAME
110110
}
111+
112+
fn as_dsdt_generator(
113+
&self,
114+
) -> Option<&dyn crate::firmware::acpi::DsdtGenerator> {
115+
Some(self)
116+
}
117+
}
118+
119+
impl crate::firmware::acpi::DsdtGenerator for QemuPvpanic {
120+
fn dsdt_scope(&self) -> crate::firmware::acpi::DsdtScope {
121+
crate::firmware::acpi::DsdtScope::SystemBus
122+
}
123+
124+
fn generate_dsdt(&self, scope: &mut crate::firmware::acpi::ScopeGuard<'_>) {
125+
use crate::firmware::acpi::ResourceTemplateBuilder;
126+
127+
let mut dev = scope.device("PEVT");
128+
dev.name("_HID", &"QEMU0001");
129+
130+
let mut crs = ResourceTemplateBuilder::new();
131+
crs.io(Self::IOPORT, Self::IOPORT, 1, 1);
132+
dev.name("_CRS", &crs);
133+
134+
dev.name("_STA", &0x0Fu32);
135+
}
111136
}

0 commit comments

Comments
 (0)