1*41058Swilliam /*- 2*41058Swilliam * Copyright (c) 1990 The Regents of the University of California. 3*41058Swilliam * All rights reserved. 4*41058Swilliam * 5*41058Swilliam * This code is derived from software contributed to Berkeley by 6*41058Swilliam * William Jolitz. 7*41058Swilliam * 8*41058Swilliam * %sccs.include.noredist.c% 9*41058Swilliam * 10*41058Swilliam * @(#)trap.h 5.1 (Berkeley) 04/24/90 11*41058Swilliam */ 1240471Sbill 1340471Sbill /* 1440471Sbill * Trap type values 1540471Sbill * also known in trap.c for name strings 1640471Sbill */ 1740471Sbill 1840471Sbill #define T_RESADFLT 0 /* reserved addressing */ 1940471Sbill #define T_PRIVINFLT 1 /* privileged instruction */ 2040471Sbill #define T_RESOPFLT 2 /* reserved operand */ 2140471Sbill #define T_BPTFLT 3 /* breakpoint instruction */ 2240471Sbill #define T_SYSCALL 5 /* system call (kcall) */ 2340471Sbill #define T_ARITHTRAP 6 /* arithmetic trap */ 2440471Sbill #define T_ASTFLT 7 /* system forced exception */ 2540471Sbill #define T_SEGFLT 8 /* segmentation (limit) fault */ 2640471Sbill #define T_PROTFLT 9 /* protection fault */ 2740471Sbill #define T_TRCTRAP 10 /* trace trap */ 2840471Sbill #define T_PAGEFLT 12 /* page fault */ 2940471Sbill #define T_TABLEFLT 13 /* page table fault */ 3040471Sbill #define T_ALIGNFLT 14 /* alignment fault */ 3140471Sbill #define T_KSPNOTVAL 15 /* kernel stack pointer not valid */ 3240471Sbill #define T_BUSERR 16 /* bus error */ 3340471Sbill #define T_KDBTRAP 17 /* kernel debugger trap */ 34*41058Swilliam 3540471Sbill #define T_DIVIDE 18 /* integer divide fault */ 36*41058Swilliam #define T_DEBUG 19 /* debug fault/trap catchall */ 37*41058Swilliam #define T_NMI 20 /* non-maskable trap */ 38*41058Swilliam #define T_OFLOW 21 /* overflow trap */ 39*41058Swilliam #define T_BOUND 22 /* bound instruction fault */ 40*41058Swilliam #define T_DNA 23 /* device not available fault */ 4140471Sbill #define T_DOUBLEFLT 24 /* double fault */ 4240471Sbill #define T_FPOPFLT 25 /* fp coprocessor operand fetch fault */ 4340471Sbill #define T_TSSFLT 26 /* invalid tss fault */ 4440471Sbill #define T_SEGNPFLT 27 /* segment not present fault */ 4540471Sbill #define T_STKFLT 28 /* stack fault */ 4640471Sbill #define T_RESERVED 29 /* stack fault */ 4740471Sbill 4840471Sbill /* definitions for <sys/signal.h> */ 4940471Sbill #define ILL_RESAD_FAULT T_RESADFLT 5040471Sbill #define ILL_PRIVIN_FAULT T_PRIVINFLT 5140471Sbill #define ILL_RESOP_FAULT T_RESOPFLT 5240471Sbill #define ILL_ALIGN_FAULT T_ALIGNFLT 5340471Sbill 5440471Sbill /* codes for SIGFPE/ARITHTRAP */ 5540471Sbill #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 5640471Sbill #define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ 5740471Sbill #define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ 5840471Sbill #define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ 5940471Sbill #define FPE_FLTUND_TRAP 0x5 /* floating underflow */ 60