vmm, arch, devices: Put ACPI support behind a default feature

Put the ACPI support behind a feature and ensure that the code compiles
without that feature by adding an extra build to Travis.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-09-03 14:54:06 +01:00
committed by Samuel Ortiz
parent bb2e7bb942
commit 9e764fc091
8 changed files with 28 additions and 5 deletions

View File

@@ -3,13 +3,17 @@ name = "arch"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
[features]
default = ["acpi"]
acpi = ["acpi_tables"]
[dependencies]
byteorder = "1.3.2"
kvm-bindings = "0.1.1"
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "master" }
libc = "0.2.60"
acpi_tables = { path ="../acpi_tables" }
acpi_tables = { path = "../acpi_tables", optional = true }
arch_gen = { path = "../arch_gen" }
[dependencies.vm-memory]

View File

@@ -48,7 +48,7 @@ struct PCIRangeEntry {
pub segment: u16,
pub start: u8,
pub end: u8,
_reserved: u32
_reserved: u32,
}
pub fn create_dsdt_table(serial_enabled: bool) -> SDT {

View File

@@ -183,8 +183,11 @@ pub fn configure_system(
}
}
let rsdp_addr = acpi::create_acpi_tables(guest_mem, num_cpus, serial_enabled);
params.0.acpi_rsdp_addr = rsdp_addr.0;
#[cfg(feature = "acpi")]
{
let rsdp_addr = acpi::create_acpi_tables(guest_mem, num_cpus, serial_enabled);
params.0.acpi_rsdp_addr = rsdp_addr.0;
}
let zero_page_addr = layout::ZERO_PAGE_START;
guest_mem