parent
32e7f0ed52
commit
a6b0da0c2f
@ -1,34 +1,39 @@
|
||||
pub const T_DIVIDE : u8 = 0 ; // divide error
|
||||
pub const T_DEBUG : u8 = 1 ; // debug exception
|
||||
pub const T_NMI : u8 = 2 ; // non-maskable interrupt
|
||||
pub const T_BRKPT : u8 = 3 ; // breakpoint
|
||||
pub const T_OFLOW : u8 = 4 ; // overflow
|
||||
pub const T_BOUND : u8 = 5 ; // bounds check
|
||||
pub const T_ILLOP : u8 = 6 ; // illegal opcode
|
||||
pub const T_DEVICE : u8 = 7 ; // device not available
|
||||
pub const T_DBLFLT : u8 = 8 ; // double fault
|
||||
pub const T_COPROC : u8 = 9 ; // reserved (not used since 486)
|
||||
pub const T_TSS : u8 = 10; // invalid task switch segment
|
||||
pub const T_SEGNP : u8 = 11; // segment not present
|
||||
pub const T_STACK : u8 = 12; // stack exception
|
||||
pub const T_GPFLT : u8 = 13; // general protection fault
|
||||
pub const T_PGFLT : u8 = 14; // page fault
|
||||
pub const T_RES : u8 = 15; // reserved
|
||||
pub const T_FPERR : u8 = 16; // floating point error
|
||||
pub const T_ALIGN : u8 = 17; // aligment check
|
||||
pub const T_MCHK : u8 = 18; // machine check
|
||||
pub const T_SIMDERR : u8 = 19; // SIMD floating point error
|
||||
pub const T_IRQ0 : u8 = 32; // IRQ 0 corresponds to int T_IRQ
|
||||
pub const IRQ_TIMER : u8 = 0;
|
||||
pub const IRQ_KBD : u8 = 1;
|
||||
pub const IRQ_COM2 : u8 = 3;
|
||||
pub const IRQ_COM1 : u8 = 4;
|
||||
pub const IRQ_IDE : u8 = 14;
|
||||
pub const IRQ_ERROR : u8 = 19;
|
||||
pub const IRQ_SPURIOUS : u8 = 31;
|
||||
pub const T_SYSCALL: u8 = 0x40;
|
||||
// xv6 x86_64 syscall
|
||||
pub const T_SYSCALL32: u8 = 0x80;
|
||||
// ucore syscall
|
||||
pub const T_SWITCH_TOU : u8 = 120; // user/kernel switch
|
||||
pub const T_SWITCH_TOK : u8 = 121; // user/kernel switch
|
||||
#![allow(non_upper_case_globals)]
|
||||
// Reference: https://wiki.osdev.org/Exceptions
|
||||
|
||||
pub const DivideError: u8 = 0;
|
||||
pub const Debug: u8 = 1;
|
||||
pub const NonMaskableInterrupt: u8 = 2;
|
||||
pub const Breakpoint: u8 = 3;
|
||||
pub const Overflow: u8 = 4;
|
||||
pub const BoundRangeExceeded: u8 = 5;
|
||||
pub const InvalidOpcode: u8 = 6;
|
||||
pub const DeviceNotAvailable: u8 = 7;
|
||||
pub const DoubleFault: u8 = 8;
|
||||
pub const CoprocessorSegmentOverrun: u8 = 9;
|
||||
pub const InvalidTSS: u8 = 10;
|
||||
pub const SegmentNotPresent: u8 = 11;
|
||||
pub const StackSegmentFault: u8 = 12;
|
||||
pub const GeneralProtectionFault: u8 = 13;
|
||||
pub const PageFault: u8 = 14;
|
||||
pub const FloatingPointException: u8 = 16;
|
||||
pub const AlignmentCheck: u8 = 17;
|
||||
pub const MachineCheck: u8 = 18;
|
||||
pub const SIMDFloatingPointException: u8 = 19;
|
||||
pub const VirtualizationException: u8 = 20;
|
||||
pub const SecurityException: u8 = 30;
|
||||
|
||||
pub const IRQ0: u8 = 32;
|
||||
pub const Syscall: u8 = 0x40;
|
||||
pub const Syscall32: u8 = 0x80;
|
||||
pub const SwitchToUser: u8 = 120;
|
||||
pub const SwitchToKernel: u8 = 121;
|
||||
|
||||
// IRQ
|
||||
pub const Timer: u8 = 0;
|
||||
pub const Keyboard: u8 = 1;
|
||||
pub const COM2: u8 = 3;
|
||||
pub const COM1: u8 = 4;
|
||||
pub const IDE: u8 = 14;
|
||||
pub const Error: u8 = 19;
|
||||
pub const Spurious: u8 = 31;
|
||||
|
Loading…
Reference in new issue