diff --git a/src/context/signal.rs b/src/context/signal.rs index 19f4ebc01f..9c4de23879 100644 --- a/src/context/signal.rs +++ b/src/context/signal.rs @@ -74,7 +74,19 @@ pub fn signal_handler(token: &mut CleanLockToken) { pub fn excp_handler(excp: syscall::Exception) { let mut token = unsafe { CleanLockToken::new() }; - let current = context::current(); + let Some(current) = context::try_current() else { + let kind = excp.kind; + let code = excp.code; + let address = excp.address; + info!( + "excp_handler: no current context (early boot), CPU {}, kind {}, code {}, address {:#x}", + crate::cpu_id(), + kind, + code, + address + ); + panic!("unhandled exception during early boot (no context)"); + }; let context = current.write(token.token()); diff --git a/src/lib.rs b/src/lib.rs index e69de29bb2..5d8f73c3d2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -0,0 +1 @@ +#![cfg_attr(not(test), no_std)] diff --git a/src/main.rs b/src/main.rs index 32f491d0e8..75c68c371f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,6 +70,8 @@ mod log; /// Memory management mod memory; +mod numa; + /// Panic mod panic; diff --git a/src/numa.rs b/src/numa.rs index 40c5a06812..e484d12526 100644 --- a/src/numa.rs +++ b/src/numa.rs @@ -7,7 +7,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; const MAX_NUMA_NODES: usize = 8; -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct NumaHint { pub node_id: u8, pub cpus: LogicalCpuSet,