Skip to content

Commit be99751

Browse files
committed
Move panic_handler into lib.rs
1 parent d794b5e commit be99751

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ pub(crate) mod fd;
7878
mod mm;
7979
#[cfg(feature = "tcp")]
8080
mod net;
81-
#[cfg(target_os = "none")]
82-
mod runtime_glue;
8381
mod scheduler;
8482
mod synch;
8583
mod syscalls;
@@ -381,3 +379,12 @@ fn application_processor_main() -> ! {
381379
// Run the scheduler loop.
382380
core_scheduler.run();
383381
}
382+
383+
#[cfg(target_os = "none")]
384+
#[panic_handler]
385+
fn panic(info: &core::panic::PanicInfo<'_>) -> ! {
386+
let core_id = crate::arch::core_local::core_id();
387+
println!("[{core_id}][PANIC] {info}");
388+
389+
crate::syscalls::shutdown(1)
390+
}

src/runtime_glue.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)