trap.h revision 621
14Srgrimes/*- 24Srgrimes * Copyright (c) 1990 The Regents of the University of California. 34Srgrimes * All rights reserved. 44Srgrimes * 54Srgrimes * This code is derived from software contributed to Berkeley by 64Srgrimes * William Jolitz. 74Srgrimes * 84Srgrimes * Redistribution and use in source and binary forms, with or without 94Srgrimes * modification, are permitted provided that the following conditions 104Srgrimes * are met: 114Srgrimes * 1. Redistributions of source code must retain the above copyright 124Srgrimes * notice, this list of conditions and the following disclaimer. 134Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 144Srgrimes * notice, this list of conditions and the following disclaimer in the 154Srgrimes * documentation and/or other materials provided with the distribution. 164Srgrimes * 3. All advertising materials mentioning features or use of this software 174Srgrimes * must display the following acknowledgement: 184Srgrimes * This product includes software developed by the University of 194Srgrimes * California, Berkeley and its contributors. 204Srgrimes * 4. Neither the name of the University nor the names of its contributors 214Srgrimes * may be used to endorse or promote products derived from this software 224Srgrimes * without specific prior written permission. 234Srgrimes * 244Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 254Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 264Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 274Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 284Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 294Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 304Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 314Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 324Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 334Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 344Srgrimes * SUCH DAMAGE. 354Srgrimes * 36621Srgrimes * from: @(#)trap.h 5.4 (Berkeley) 5/9/91 37621Srgrimes * $Id$ 384Srgrimes */ 394Srgrimes 404Srgrimes/* 414Srgrimes * Trap type values 424Srgrimes * also known in trap.c for name strings 434Srgrimes */ 444Srgrimes 454Srgrimes#define T_RESADFLT 0 /* reserved addressing */ 464Srgrimes#define T_PRIVINFLT 1 /* privileged instruction */ 474Srgrimes#define T_RESOPFLT 2 /* reserved operand */ 484Srgrimes#define T_BPTFLT 3 /* breakpoint instruction */ 494Srgrimes#define T_SYSCALL 5 /* system call (kcall) */ 504Srgrimes#define T_ARITHTRAP 6 /* arithmetic trap */ 514Srgrimes#define T_ASTFLT 7 /* system forced exception */ 524Srgrimes#define T_SEGFLT 8 /* segmentation (limit) fault */ 534Srgrimes#define T_PROTFLT 9 /* protection fault */ 544Srgrimes#define T_TRCTRAP 10 /* trace trap */ 554Srgrimes#define T_PAGEFLT 12 /* page fault */ 564Srgrimes#define T_TABLEFLT 13 /* page table fault */ 574Srgrimes#define T_ALIGNFLT 14 /* alignment fault */ 584Srgrimes#define T_KSPNOTVAL 15 /* kernel stack pointer not valid */ 594Srgrimes#define T_BUSERR 16 /* bus error */ 604Srgrimes#define T_KDBTRAP 17 /* kernel debugger trap */ 614Srgrimes 624Srgrimes#define T_DIVIDE 18 /* integer divide fault */ 634Srgrimes#define T_NMI 19 /* non-maskable trap */ 644Srgrimes#define T_OFLOW 20 /* overflow trap */ 654Srgrimes#define T_BOUND 21 /* bound instruction fault */ 664Srgrimes#define T_DNA 22 /* device not available fault */ 674Srgrimes#define T_DOUBLEFLT 23 /* double fault */ 684Srgrimes#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ 694Srgrimes#define T_TSSFLT 25 /* invalid tss fault */ 704Srgrimes#define T_SEGNPFLT 26 /* segment not present fault */ 714Srgrimes#define T_STKFLT 27 /* stack fault */ 724Srgrimes#define T_RESERVED 28 /* reserved fault base */ 734Srgrimes 744Srgrimes/* definitions for <sys/signal.h> */ 754Srgrimes#define ILL_RESAD_FAULT T_RESADFLT 764Srgrimes#define ILL_PRIVIN_FAULT T_PRIVINFLT 774Srgrimes#define ILL_RESOP_FAULT T_RESOPFLT 784Srgrimes#define ILL_ALIGN_FAULT T_ALIGNFLT 794Srgrimes#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ 804Srgrimes 814Srgrimes/* codes for SIGFPE/ARITHTRAP */ 824Srgrimes#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 834Srgrimes#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ 844Srgrimes#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ 854Srgrimes#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ 864Srgrimes#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ 874Srgrimes#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ 884Srgrimes#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ 894Srgrimes 904Srgrimes/* codes for SIGBUS */ 914Srgrimes#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ 924Srgrimes#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ 934Srgrimes#define BUS_STK_FAULT T_STKFLT /* stack segment */ 944Srgrimes#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ 954Srgrimes 964Srgrimes/* Trap's coming from user mode */ 974Srgrimes#define T_USER 0x100 98