Clearify exception

master
Harry Cheng 5 years ago
parent 17d447ff6f
commit 0e89d291ab

@ -108,7 +108,8 @@ pub extern "C" fn rust_trap(tf: &mut TrapFrame) {
} }
Syscall32 => syscall32(tf), Syscall32 => syscall32(tf),
InvalidOpcode => invalid_opcode(tf), InvalidOpcode => invalid_opcode(tf),
DivideError | GeneralProtectionFault => error(tf), DivideError => divide_error(tf),
GeneralProtectionFault => general_protection_fault(tf),
IPIFuncCall => { IPIFuncCall => {
let irq = tf.trap_num as u8 - IRQ0; let irq = tf.trap_num as u8 - IRQ0;
super::ack(irq); // must ack before switching super::ack(irq); // must ack before switching
@ -127,6 +128,16 @@ fn double_fault(tf: &TrapFrame) {
loop {} loop {}
} }
fn divide_error(tf: &TrapFrame) {
error!("\nEXCEPTION: Divide Error");
error(tf);
}
fn general_protection_fault(tf: &TrapFrame) {
error!("\nEXCEPTION: General Protection Fault");
error(tf);
}
fn page_fault(tf: &mut TrapFrame) { fn page_fault(tf: &mut TrapFrame) {
let addr: usize; let addr: usize;
unsafe { unsafe {

Loading…
Cancel
Save