From ed6c972994418cae6e09ad95511fe378b6057f53 Mon Sep 17 00:00:00 2001 From: Chuanxiao Dong Date: Mon, 13 Jan 2020 10:48:37 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035168 Tested-by: kokoro Reviewed-by: Tomasz Jeznach --- aarch64/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'aarch64/src') 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, }) } } -- cgit 1.4.1