1 /*- 2 * Copyright (c) 1988 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Computer Consoles Inc. 7 * 8 * %sccs.include.proprietary.c% 9 * 10 * @(#)trap.h 7.2 (Berkeley) 05/08/91 11 */ 12 13 /* 14 * Trap type values 15 * also known in trap.c for name strings 16 */ 17 18 #define T_RESADFLT 0 /* reserved addressing */ 19 #define T_PRIVINFLT 1 /* privileged instruction */ 20 #define T_RESOPFLT 2 /* reserved operand */ 21 #define T_BPTFLT 3 /* breakpoint instruction */ 22 #define T_SYSCALL 5 /* system call (kcall) */ 23 #define T_ARITHTRAP 6 /* arithmetic trap */ 24 #define T_ASTFLT 7 /* system forced exception */ 25 #define T_SEGFLT 8 /* segmentation (limit) fault */ 26 #define T_PROTFLT 9 /* protection fault */ 27 #define T_TRCTRAP 10 /* trace trap */ 28 #define T_PAGEFLT 12 /* page fault */ 29 #define T_TABLEFLT 13 /* page table fault */ 30 #define T_ALIGNFLT 14 /* alignment fault */ 31 #define T_KSPNOTVAL 15 /* kernel stack pointer not valid */ 32 #define T_BUSERR 16 /* bus error */ 33 #define T_KDBTRAP 17 /* kernel debugger trap */ 34 35 /* definitions for <sys/signal.h> */ 36 #define ILL_RESAD_FAULT T_RESADFLT 37 #define ILL_PRIVIN_FAULT T_PRIVINFLT 38 #define ILL_RESOP_FAULT T_RESOPFLT 39 #define ILL_ALIGN_FAULT T_ALIGNFLT 40 41 /* codes for SIGFPE/ARITHTRAP */ 42 #define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 43 #define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ 44 #define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ 45 #define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ 46 #define FPE_FLTUND_TRAP 0x5 /* floating underflow */ 47