@ -7,6 +7,6 @@ pub fn id() -> usize {
0
}
pub fn exit_in_qemu(error_code: u8) -> ! {
pub unsafe fn exit_in_qemu(error_code: u8) -> ! {
unimplemented!()
@ -36,6 +36,6 @@ pub fn halt() {
unsafe { riscv::asm::wfi() }
super::sbi::shutdown()
@ -117,8 +117,10 @@ const LINUX_REBOOT_CMD_HALT: u32 = 0xcdef0123;
pub fn sys_reboot(magic: u32, magic2: u32, cmd: u32, arg: *const u8) -> SysResult {
// we will skip verifying magic
if cmd == LINUX_REBOOT_CMD_HALT {
unsafe {
cpu::exit_in_qemu(1);
Ok(0)