5 // These are processor defined:
6 #define T_DIVIDE 0 // divide error
7 #define T_DEBUG 1 // debug exception
8 #define T_NMI 2 // non-maskable interrupt
9 #define T_BRKPT 3 // breakpoint
10 #define T_OFLOW 4 // overflow
11 #define T_BOUND 5 // bounds check
12 #define T_ILLOP 6 // illegal opcode
13 #define T_DEVICE 7 // device not available
14 #define T_DBLFLT 8 // double fault
15 /* #define T_COPROC 9 */ // reserved (not generated by recent processors)
16 #define T_TSS 10 // invalid task switch segment
17 #define T_SEGNP 11 // segment not present
18 #define T_STACK 12 // stack exception
19 #define T_GPFLT 13 // general protection fault
20 #define T_PGFLT 14 // page fault
21 /* #define T_RES 15 */ // reserved
22 #define T_FPERR 16 // floating point error
23 #define T_ALIGN 17 // aligment check
24 #define T_MCHK 18 // machine check
25 #define T_SIMDERR 19 // SIMD floating point error
27 // These are arbitrarily chosen, but with care not to overlap
28 // processor defined exceptions or interrupt vectors.
29 #define T_SYSCALL 48 // system call
30 #define T_DEFAULT 500 // catchall
32 // Hardware IRQ numbers. We receive these as (IRQ_OFFSET+IRQ_WHATEVER)
36 #define IRQ_SPURIOUS 7
42 #include <inc/types.h>
45 /* registers as pushed by pusha */
49 uint32_t reg_oesp
; /* Useless */
54 } __attribute__((packed
));
57 struct PushRegs tf_regs
;
63 /* below here defined by x86 hardware */
69 /* below here only when crossing rings, such as from user to kernel */
73 } __attribute__((packed
));
76 /* information about the fault */
77 uint32_t utf_fault_va
; /* va for T_PGFLT, 0 otherwise */
79 /* trap-time return state */
80 struct PushRegs utf_regs
;
83 /* the trap-time stack to return to */
85 } __attribute__((packed
));
87 #endif /* !__ASSEMBLER__ */
89 // Must equal 'sizeof(struct Trapframe)'.
90 // A static_assert in kern/trap.c checks this.
91 #define SIZEOF_STRUCT_TRAPFRAME 0x44
93 #endif /* !JOS_INC_TRAP_H */