summary refs log tree commit diff
path: root/devices/src/acpi.rs
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>2020-02-27 13:58:26 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-28 00:11:19 +0000
commit020fbf04c2ac112f34b87306b5fbb75e7a02a81a (patch)
tree127111f64edbb95d7a2b6deceb414dfd24b8db39 /devices/src/acpi.rs
parent46d61ba80df1ccf8364d9589170b3a7bff1268ee (diff)
downloadcrosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.gz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.bz2
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.lz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.xz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.zst
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.zip
x86_64: generate ACPI tables
Add acpi_rsdp_addr in boot_params to allow crosvm to pass
a physicall address of RSDP to the Linux guest kernel, so
that the linux guest kernel can parse the constructed ACPI
tables and enable the ACPI.

Although there is ACPI tables but as we still have "acpi=off"
in command line parameter, there is still no ACPI in guest kernel.

The ACPI construction refers to the implementation of the
Cloud-hypervisor commit:
- arch: x86_64: Generate basic ACPI tables

BUG=chromium:1018674
TEST=None

Change-Id: Ibcb2ae98c43da8ef8c07a07eda9213f61570d14c
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035351
Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
Diffstat (limited to 'devices/src/acpi.rs')
-rw-r--r--devices/src/acpi.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/devices/src/acpi.rs b/devices/src/acpi.rs
index 6d36353..990a782 100644
--- a/devices/src/acpi.rs
+++ b/devices/src/acpi.rs
@@ -31,7 +31,9 @@ impl ACPIPMResource {
 
 /// the ACPI PM register's base and length.
 pub const ACPIPM_RESOURCE_BASE: u64 = 0x600;
-pub const ACPIPM_RESOURCE_LEN: u64 = 8;
+pub const ACPIPM_RESOURCE_LEN: u8 = 8;
+pub const ACPIPM_RESOURCE_EVENTBLK_LEN: u8 = 4;
+pub const ACPIPM_RESOURCE_CONTROLBLK_LEN: u8 = 2;
 
 /// ACPI PM register value definations
 const PM1_STATUS: u16 = 0;