From 11a3315255ba34d552a885a30ea29454b8b7df95 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 4 May 2021 08:33:00 -0600 Subject: [PATCH] Re-enable acpi feature and gate it for x86_64 only --- Cargo.toml | 2 +- src/lib.rs | 2 +- src/scheme/irq.rs | 4 ++-- src/scheme/mod.rs | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8eaecf6..24be2fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ raw-cpuid = "8.0.0" x86 = { version = "0.32.0", default-features = false } [features] -default = ["serial_debug"] +default = ["acpi", "multi_core", "serial_debug"] acpi = [] doc = [] graphical_debug = [] diff --git a/src/lib.rs b/src/lib.rs index 0966e62..1b4aa69 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,7 +95,7 @@ use crate::log::info; pub mod allocator; /// ACPI table parsing -#[cfg(feature = "acpi")] +#[cfg(all(feature = "acpi", target_arch = "x86_64"))] mod acpi; /// Context management diff --git a/src/scheme/irq.rs b/src/scheme/irq.rs index ee24f7d..09d4e5c 100644 --- a/src/scheme/irq.rs +++ b/src/scheme/irq.rs @@ -83,7 +83,7 @@ impl IrqScheme { *HANDLES.write() = Some(BTreeMap::new()); - #[cfg(feature = "acpi")] + #[cfg(all(feature = "acpi", target_arch = "x86_64"))] let cpus = { use crate::acpi::madt::*; @@ -94,7 +94,7 @@ impl IrqScheme { _ => None, }).collect::>() }; - #[cfg(not(feature = "acpi"))] + #[cfg(not(all(feature = "acpi", target_arch = "x86_64")))] let cpus = vec!(0); IrqScheme { diff --git a/src/scheme/mod.rs b/src/scheme/mod.rs index 55d1cb9..ebb49aa 100644 --- a/src/scheme/mod.rs +++ b/src/scheme/mod.rs @@ -19,7 +19,7 @@ use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard}; use crate::syscall::error::*; use crate::syscall::scheme::Scheme; -#[cfg(feature = "acpi")] +#[cfg(all(feature = "acpi", target_arch = "x86_64"))] use self::acpi::AcpiScheme; use self::debug::DebugScheme; @@ -36,7 +36,7 @@ use self::sys::SysScheme; use self::time::TimeScheme; /// When compiled with the "acpi" feature - `acpi:` - allows drivers to read a limited set of ACPI tables. -#[cfg(feature = "acpi")] +#[cfg(all(feature = "acpi", target_arch = "x86_64"))] pub mod acpi; /// `debug:` - provides access to serial console @@ -161,7 +161,7 @@ impl SchemeList { let ns = self.new_ns(); // These schemes should only be available on the root - #[cfg(feature = "acpi")] { + #[cfg(all(feature = "acpi", target_arch = "x86_64"))] { self.insert(ns, "acpi", |_| Arc::new(AcpiScheme::new())).unwrap(); } self.insert(ns, "debug", |scheme_id| Arc::new(DebugScheme::new(scheme_id))).unwrap();