From d6ce30924713db3a1355e0c644adb9e845f1df4e Mon Sep 17 00:00:00 2001 From: Yuhao Zhou Date: Wed, 10 Apr 2019 00:38:31 +0800 Subject: [PATCH] Fix some review issues. --- kernel/src/arch/mipsel/compiler_rt.rs | 8 -------- kernel/src/arch/mipsel/context.rs | 4 ++-- kernel/src/arch/mipsel/cpu.rs | 3 ++- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 kernel/src/arch/mipsel/compiler_rt.rs diff --git a/kernel/src/arch/mipsel/compiler_rt.rs b/kernel/src/arch/mipsel/compiler_rt.rs deleted file mode 100644 index b49a3ce..0000000 --- a/kernel/src/arch/mipsel/compiler_rt.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! Workaround for missing compiler-builtin symbols -//! -//! [atomic](http://llvm.org/docs/Atomics.html#libcalls-atomic) - -#[no_mangle] -pub extern fn abort() { - panic!("abort"); -} diff --git a/kernel/src/arch/mipsel/context.rs b/kernel/src/arch/mipsel/context.rs index 7e473ad..e0502ee 100644 --- a/kernel/src/arch/mipsel/context.rs +++ b/kernel/src/arch/mipsel/context.rs @@ -50,8 +50,8 @@ pub struct TrapFrame { pub sp: usize, pub fp: usize, pub ra: usize, - /// Reserve space for hartid - pub _hartid: usize, + /// Reserved + pub reserved: usize, } impl TrapFrame { diff --git a/kernel/src/arch/mipsel/cpu.rs b/kernel/src/arch/mipsel/cpu.rs index ea27d1f..764d472 100644 --- a/kernel/src/arch/mipsel/cpu.rs +++ b/kernel/src/arch/mipsel/cpu.rs @@ -1,4 +1,5 @@ use mips::registers::cp0; +use mips::instructions; use crate::consts::MAX_CPU_NUM; use core::ptr::{read_volatile, write_volatile}; @@ -21,7 +22,7 @@ pub unsafe fn start_others(hart_mask: usize) { } pub fn halt() { - /* nothing to do */ + unsafe { instructions::wait(); } } pub unsafe fn exit_in_qemu(error_code: u8) -> ! {