Fixed C-string usage

riscv
hheik 2024-05-15 00:41:50 +03:00
parent 1d51f09bd1
commit 48ae217e41
1 changed files with 3 additions and 4 deletions

View File

@ -11,17 +11,16 @@ pub mod uart;
extern "C" { extern "C" {
// printf.c // printf.c
fn panic(s: *const u8); fn panic(s: *const i8);
} }
/// '!RUST PANIC!\0' static PANIC_MSG: &CStr = c"!RUST PANIC!";
static PANIC_MSG: [u8; 13] = [33, 82, 85, 83, 84, 32, 80, 65, 78, 73, 67, 33, 0];
#[panic_handler] #[panic_handler]
#[no_mangle] #[no_mangle]
fn panic_handler(_info: &core::panic::PanicInfo) -> ! { fn panic_handler(_info: &core::panic::PanicInfo) -> ! {
unsafe { unsafe {
panic(core::ptr::addr_of!(PANIC_MSG[0])); panic(PANIC_MSG.as_ptr());
} }
loop {} loop {}
} }