summary refs log tree commit diff
path: root/devices/src/acpi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'devices/src/acpi.rs')
-rw-r--r--devices/src/acpi.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/devices/src/acpi.rs b/devices/src/acpi.rs
index 990a782..1cfab35 100644
--- a/devices/src/acpi.rs
+++ b/devices/src/acpi.rs
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 use crate::{BusDevice, BusResumeDevice};
+use acpi_tables::{aml, aml::Aml};
 use sys_util::{error, warn, EventFd};
 
 /// ACPI PM resource for handling OS suspend/resume request
@@ -29,8 +30,7 @@ impl ACPIPMResource {
     }
 }
 
-/// the ACPI PM register's base and length.
-pub const ACPIPM_RESOURCE_BASE: u64 = 0x600;
+/// the ACPI PM register length.
 pub const ACPIPM_RESOURCE_LEN: u8 = 8;
 pub const ACPIPM_RESOURCE_EVENTBLK_LEN: u8 = 4;
 pub const ACPIPM_RESOURCE_CONTROLBLK_LEN: u8 = 2;
@@ -127,3 +127,14 @@ impl BusResumeDevice for ACPIPMResource {
         self.sleep_status = val | BITMASK_SLEEPCNT_WAKE_STATUS;
     }
 }
+
+impl Aml for ACPIPMResource {
+    fn to_aml_bytes(&self, bytes: &mut Vec<u8>) {
+        // S1
+        aml::Name::new(
+            "_S1_".into(),
+            &aml::Package::new(vec![&aml::ONE, &aml::ONE, &aml::ZERO, &aml::ZERO]),
+        )
+        .to_aml_bytes(bytes);
+    }
+}