Skip to content
Snippets Groups Projects
traps.h 1.49 KiB
Newer Older
rsc's avatar
rsc committed
// x86 trap and interrupt constants.

// Processor-defined:
rsc's avatar
rsc committed
#define T_DIVIDE         0      // divide error
#define T_DEBUG          1      // debug exception
#define T_NMI            2      // non-maskable interrupt
#define T_BRKPT          3      // breakpoint
#define T_OFLOW          4      // overflow
#define T_BOUND          5      // bounds check
#define T_ILLOP          6      // illegal opcode
#define T_DEVICE         7      // device not available
#define T_DBLFLT         8      // double fault
// #define T_COPROC      9      // reserved (not used since 486)
#define T_TSS           10      // invalid task switch segment
#define T_SEGNP         11      // segment not present
#define T_STACK         12      // stack exception
rsc's avatar
rsc committed
#define T_GPFLT         13      // general protection fault
rsc's avatar
rsc committed
#define T_PGFLT         14      // page fault
// #define T_RES        15      // reserved
#define T_FPERR         16      // floating point error
#define T_ALIGN         17      // aligment check
#define T_MCHK          18      // machine check
#define T_SIMDERR       19      // SIMD floating point error
rtm's avatar
rtm committed

// These are arbitrarily chosen, but with care not to overlap
// processor defined exceptions or interrupt vectors.
rsc's avatar
rsc committed
#define T_SYSCALL       48      // system call
#define T_DEFAULT      500      // catchall
kaashoek's avatar
kaashoek committed

rsc's avatar
rsc committed
#define IRQ_OFFSET      32      // IRQ 0 corresponds to int IRQ_OFFSET
kaashoek's avatar
kaashoek committed

#define IRQ_TIMER        0
#define IRQ_KBD          1
kaashoek's avatar
kaashoek committed
#define IRQ_IDE         14
kaashoek's avatar
kaashoek committed
#define IRQ_ERROR       19
#define IRQ_SPURIOUS    31