From c381b36b87661cad74a77fc3c2604b87a2a253b0 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 13 Jan 2021 10:02:12 +0000 Subject: [PATCH] devices: acpi: Trigger the power button upon GED event If a GED event of type 0x8 (for power button) is received notify the guest OS that this button device has been activated. Signed-off-by: Rob Bradford --- devices/src/acpi.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devices/src/acpi.rs b/devices/src/acpi.rs index 0bc90219a..cc640bb1e 100644 --- a/devices/src/acpi.rs +++ b/devices/src/acpi.rs @@ -142,6 +142,14 @@ impl Aml for AcpiGEDDevice { &aml::Equal::new(&aml::Local(1), &4usize), vec![&aml::MethodCall::new("\\_SB_.PCI0.PCNT".into(), vec![])], ), + &aml::And::new(&aml::Local(1), &aml::Local(0), &8usize), + &aml::If::new( + &aml::Equal::new(&aml::Local(1), &8usize), + vec![&aml::Notify::new( + &aml::Path::new("\\_SB_.PWRB"), + &0x80usize, + )], + ), ], ), ],