diff --git a/acpid/src/acpi.rs b/acpid/src/acpi.rs index 4d08cfe919..7e24025997 100644 --- a/acpid/src/acpi.rs +++ b/acpid/src/acpi.rs @@ -393,6 +393,7 @@ pub struct FadtAcpi2Struct { } unsafe impl plain::Plain for FadtAcpi2Struct {} +#[derive(Clone)] pub struct Fadt(Sdt); impl Fadt { @@ -456,6 +457,7 @@ impl Fadt { } }; + context.fadt = Some(fadt.clone()); context.dsdt = Some(Dsdt(dsdt_sdt.clone())); context.tables.push(dsdt_sdt); diff --git a/acpid/src/aml/namespace.rs b/acpid/src/aml/namespace.rs index 600a253a56..4dfd18516f 100644 --- a/acpid/src/aml/namespace.rs +++ b/acpid/src/aml/namespace.rs @@ -129,7 +129,10 @@ pub enum AmlValue { String(String), PowerResource(PowerResource), Processor(Processor), + + #[allow(dead_code)] RawDataBuffer(Vec), + ThermalZone(ThermalZone) } diff --git a/acpid/src/main.rs b/acpid/src/main.rs index 83ea52b090..bc1e10afc5 100644 --- a/acpid/src/main.rs +++ b/acpid/src/main.rs @@ -36,6 +36,7 @@ fn monotonic() -> (u64, u64) { fn setup_logging() -> Option<&'static RedoxLogger> { use redox_log::OutputBuilder; + #[allow(unused_mut)] let mut logger = RedoxLogger::new() .with_output( OutputBuilder::stderr() @@ -45,6 +46,12 @@ fn setup_logging() -> Option<&'static RedoxLogger> { .build() ); + #[cfg(target_os = "redox")] + match File::open("debug:") { + Ok(d) => logger = logger.with_output(OutputBuilder::with_endpoint(d).flush_on_newline(true).with_filter(log::LevelFilter::Info).build()), + Err(error) => eprintln!("Failed to open `debug:` scheme: {}", error), + } + #[cfg(target_os = "redox")] match OutputBuilder::in_redox_logging_scheme("misc", "acpi", "acpid.log") { Ok(b) => logger = logger.with_output( @@ -231,6 +238,7 @@ fn main() { let _ = event_queue.read(&mut event).expect("acpid: failed to read from event queue"); if event.flags.contains(EventFlags::EVENT_READ) && event.id == shutdown_pipe.as_raw_fd() as usize { + log::info!("Received shutdown request from kernel."); break 'events; } if !event.flags.contains(EventFlags::EVENT_READ) || event.id != scheme_socket.as_raw_fd() as usize {