Move arch to seperate crate
This commit is contained in:
parent
3967c0f291
commit
2730144e2a
1 changed files with 156 additions and 101 deletions
25
kernel/panic.rs
Normal file
25
kernel/panic.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//! Intrinsics for panic handling
|
||||
|
||||
use arch::interrupt::halt;
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[lang = "eh_personality"]
|
||||
extern "C" fn eh_personality() {}
|
||||
|
||||
#[cfg(not(test))]
|
||||
/// Required to handle panics
|
||||
#[lang = "panic_fmt"]
|
||||
extern "C" fn panic_fmt() -> ! {
|
||||
loop {
|
||||
unsafe { halt() };
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[no_mangle]
|
||||
/// Required to handle panics
|
||||
pub extern "C" fn _Unwind_Resume() -> ! {
|
||||
loop {
|
||||
unsafe { halt() }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue