summary refs log tree commit diff
path: root/aarch64
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>2020-01-13 10:48:37 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-17 04:57:26 +0000
commited6c972994418cae6e09ad95511fe378b6057f53 (patch)
tree0812972d48789438f2fe04c8af9169ce79de44a2 /aarch64
parenta0742bb58ed54231f5c2bda855b9954218afa00e (diff)
downloadcrosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar.gz
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar.bz2
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar.lz
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar.xz
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.tar.zst
crosvm-ed6c972994418cae6e09ad95511fe378b6057f53.zip
devices: add acpi device emulation code in devices
Add ACPI PM resource emulation code in devices, so that it can support
the ACPI PM requestion from guest OS.

BUG=chromium:1018674
TEST=cargo test -p devices

Change-Id: I7b82b1c3a6f609136e493b55420b947afd1d5cfc
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035168
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org>
Diffstat (limited to 'aarch64')
-rw-r--r--aarch64/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs
index 13855a6..67fad72 100644
--- a/aarch64/src/lib.rs
+++ b/aarch64/src/lib.rs
@@ -237,6 +237,10 @@ impl arch::LinuxArch for AArch64 {
 
         let exit_evt = EventFd::new().map_err(Error::CreateEventFd)?;
 
+        // Event used by PMDevice to notify crosvm that
+        // guest OS is trying to suspend.
+        let suspend_evt = EventFd::new().map_err(Error::CreateEventFd)?;
+
         let pci_devices = create_devices(&mem, &mut vm, &mut resources, &exit_evt)
             .map_err(|e| Error::CreateDevices(Box::new(e)))?;
         let (pci, pci_irqs, pid_debug_label_map) =
@@ -313,6 +317,7 @@ impl arch::LinuxArch for AArch64 {
             io_bus,
             mmio_bus,
             pid_debug_label_map,
+            suspend_evt,
         })
     }
 }