Fix last commit for exit_in_qemu

master
Jiajie Chen 6 years ago
parent b2585eb3bd
commit d285adf277

@ -7,6 +7,6 @@ pub fn id() -> usize {
0 0
} }
pub fn exit_in_qemu(error_code: u8) -> ! { pub unsafe fn exit_in_qemu(error_code: u8) -> ! {
unimplemented!() unimplemented!()
} }

@ -36,6 +36,6 @@ pub fn halt() {
unsafe { riscv::asm::wfi() } unsafe { riscv::asm::wfi() }
} }
pub fn exit_in_qemu(error_code: u8) -> ! { pub unsafe fn exit_in_qemu(error_code: u8) -> ! {
super::sbi::shutdown() super::sbi::shutdown()
} }

@ -117,7 +117,9 @@ const LINUX_REBOOT_CMD_HALT: u32 = 0xcdef0123;
pub fn sys_reboot(magic: u32, magic2: u32, cmd: u32, arg: *const u8) -> SysResult { pub fn sys_reboot(magic: u32, magic2: u32, cmd: u32, arg: *const u8) -> SysResult {
// we will skip verifying magic // we will skip verifying magic
if cmd == LINUX_REBOOT_CMD_HALT { if cmd == LINUX_REBOOT_CMD_HALT {
cpu::exit_in_qemu(1); unsafe {
cpu::exit_in_qemu(1);
}
} }
Ok(0) Ok(0)
} }

Loading…
Cancel
Save