Substituted to the original ch7 code.

This commit is contained in:
Yifan Wu 2022-01-18 02:48:50 -08:00
parent 4fdd55e2e8
commit 57f7debbc6
50 changed files with 2786 additions and 128 deletions

View file

@ -89,6 +89,7 @@ pub fn trap_handler() -> ! {
panic!("Unsupported trap {:?}, stval = {:#x}!", scause.cause(), stval);
}
}
//println!("before trap_return");
trap_return();
}
@ -116,7 +117,9 @@ pub fn trap_return() -> ! {
#[no_mangle]
pub fn trap_from_kernel() -> ! {
use riscv::register::sepc;
println!("stval = {:#x}, sepc = {:#x}", stval::read(), sepc::read());
panic!("a trap {:?} from kernel!", scause::read().cause());
}
pub use context::{TrapContext};
pub use context::TrapContext;