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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-01-13 10:02:12 +00:00
parent ff4d378f1b
commit c381b36b87

View File

@ -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,
)],
),
],
),
],