diff --git a/hal-x86_64/Cargo.toml b/hal-x86_64/Cargo.toml index a5489ef9a..ea66edc22 100644 --- a/hal-x86_64/Cargo.toml +++ b/hal-x86_64/Cargo.toml @@ -6,7 +6,9 @@ edition = "2018" license = "MIT" [features] +default = ["alloc"] log = ["tracing/log"] +alloc = [] [dependencies] acpi = "4.1.1" diff --git a/hal-x86_64/src/cpu.rs b/hal-x86_64/src/cpu.rs index b18b5eb80..6100c8806 100644 --- a/hal-x86_64/src/cpu.rs +++ b/hal-x86_64/src/cpu.rs @@ -3,6 +3,7 @@ use mycelium_util::bits; pub mod entropy; pub mod intrinsics; +#[cfg(feature = "alloc")] pub mod local; mod msr; pub use self::msr::Msr; diff --git a/hal-x86_64/src/lib.rs b/hal-x86_64/src/lib.rs index 773fc0129..011f4f9d7 100644 --- a/hal-x86_64/src/lib.rs +++ b/hal-x86_64/src/lib.rs @@ -3,18 +3,17 @@ // Allow const operands in asm. #![feature(asm_const)] #![feature(abi_x86_interrupt)] -#![feature(doc_cfg)] +#![feature(doc_cfg, doc_auto_cfg)] +#![feature(extern_types)] // A bunch of const fn features. #![feature(const_mut_refs)] // Oftentimes it's necessary to write to a value at a particular location in // memory, and these types don't implement Copy to ensure they aren't // inadvertantly copied. #![allow(clippy::trivially_copy_pass_by_ref)] -// Macros generated by `tracing` often generate large amounts of code, which -// causes this lint to complain about relatively simple methods. -#![allow(clippy::cognitive_complexity)] pub(crate) use hal_core::{PAddr, VAddr}; +#[cfg(feature = "alloc")] extern crate alloc; pub mod control_regs;