enum d'erreurs dans machine, du code pour gerer les erreurs dans le futur
This commit is contained in:
parent
172dad6598
commit
5f798edb94
@ -6,6 +6,29 @@ use super::{decode::{Instruction, decode}, interrupt::Interrupt};
|
|||||||
use super::global::*;
|
use super::global::*;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Decommenter la variant si il est utilisé quelque part
|
||||||
|
*/
|
||||||
|
enum ExceptionType {
|
||||||
|
NO_EXCEPTION,//Everything ok!
|
||||||
|
//SYSCALL_EXCEPTION,//A program executed a system call.
|
||||||
|
PAGEFAULT_EXCEPTION,//Page fault exception
|
||||||
|
READONLY_EXCEPTION,//Write attempted to a page marked "read-only" */
|
||||||
|
//BUSERROR_EXCEPTION,
|
||||||
|
/* translation resulted
|
||||||
|
in an invalid physical
|
||||||
|
address (mis-aligned or
|
||||||
|
out-of-bounds) */
|
||||||
|
ADDRESSERROR_EXCEPTION, /* Reference that was
|
||||||
|
not mapped in the address
|
||||||
|
space */
|
||||||
|
//OVERFLOW_EXCEPTION, //Integer overflow in add or sub.
|
||||||
|
//ILLEGALINSTR_EXCEPTION, //Unimplemented or reserved instr.
|
||||||
|
//NUM_EXCEPTION_TYPES
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pub const STACK_REG: usize = 2;
|
pub const STACK_REG: usize = 2;
|
||||||
|
|
||||||
pub const NUM_INT_REGS: usize = 32;
|
pub const NUM_INT_REGS: usize = 32;
|
||||||
|
Loading…
Reference in New Issue
Block a user