141058Swilliam /*- 2*63359Sbostic * Copyright (c) 1990, 1993 3*63359Sbostic * The Regents of the University of California. All rights reserved. 441058Swilliam * 541058Swilliam * This code is derived from software contributed to Berkeley by 641058Swilliam * William Jolitz. 741058Swilliam * 846006Swilliam * %sccs.include.redist.c% 941058Swilliam * 10*63359Sbostic * @(#)trap.h 8.1 (Berkeley) 06/11/93 1141058Swilliam */ 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 */ 3441058Swilliam 3540471Sbill #define T_DIVIDE 18 /* integer divide fault */ 3645602Sbill #define T_NMI 19 /* non-maskable trap */ 3745602Sbill #define T_OFLOW 20 /* overflow trap */ 3845602Sbill #define T_BOUND 21 /* bound instruction fault */ 3945602Sbill #define T_DNA 22 /* device not available fault */ 4045602Sbill #define T_DOUBLEFLT 23 /* double fault */ 4145602Sbill #define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ 4245602Sbill #define T_TSSFLT 25 /* invalid tss fault */ 4345602Sbill #define T_SEGNPFLT 26 /* segment not present fault */ 4445602Sbill #define T_STKFLT 27 /* stack fault */ 4545602Sbill #define T_RESERVED 28 /* reserved fault base */ 4640471Sbill 4740471Sbill /* definitions for <sys/signal.h> */ 4840471Sbill #define ILL_RESAD_FAULT T_RESADFLT 4940471Sbill #define ILL_PRIVIN_FAULT T_PRIVINFLT 5040471Sbill #define ILL_RESOP_FAULT T_RESOPFLT 5140471Sbill #define ILL_ALIGN_FAULT T_ALIGNFLT 5245602Sbill #define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ 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 */ 6045602Sbill #define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ 6145602Sbill #define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ 6245602Sbill 6345602Sbill /* codes for SIGBUS */ 6445602Sbill #define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ 6545602Sbill #define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ 6645602Sbill #define BUS_STK_FAULT T_STKFLT /* stack segment */ 6745602Sbill #define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ 6849523Swilliam 6949523Swilliam /* Trap's coming from user mode */ 7049523Swilliam #define T_USER 0x100 71