trap.h revision 17520
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 3717520Sdg * $Id: trap.h,v 1.4 1995/01/14 13:20:26 bde Exp $ 384Srgrimes */ 394Srgrimes 40719Swollman#ifndef _MACHINE_TRAP_H_ 415603Sbde#define _MACHINE_TRAP_H_ 42719Swollman 434Srgrimes/* 444Srgrimes * Trap type values 454Srgrimes * also known in trap.c for name strings 464Srgrimes */ 474Srgrimes 484Srgrimes#define T_PRIVINFLT 1 /* privileged instruction */ 494Srgrimes#define T_BPTFLT 3 /* breakpoint instruction */ 504Srgrimes#define T_ARITHTRAP 6 /* arithmetic trap */ 514Srgrimes#define T_ASTFLT 7 /* system forced exception */ 524Srgrimes#define T_PROTFLT 9 /* protection fault */ 535603Sbde#define T_TRCTRAP 10 /* debug exception (sic) */ 544Srgrimes#define T_PAGEFLT 12 /* page fault */ 554Srgrimes#define T_ALIGNFLT 14 /* alignment fault */ 564Srgrimes 574Srgrimes#define T_DIVIDE 18 /* integer divide fault */ 584Srgrimes#define T_NMI 19 /* non-maskable trap */ 594Srgrimes#define T_OFLOW 20 /* overflow trap */ 604Srgrimes#define T_BOUND 21 /* bound instruction fault */ 614Srgrimes#define T_DNA 22 /* device not available fault */ 624Srgrimes#define T_DOUBLEFLT 23 /* double fault */ 634Srgrimes#define T_FPOPFLT 24 /* fp coprocessor operand fetch fault */ 644Srgrimes#define T_TSSFLT 25 /* invalid tss fault */ 654Srgrimes#define T_SEGNPFLT 26 /* segment not present fault */ 664Srgrimes#define T_STKFLT 27 /* stack fault */ 6717520Sdg#define T_MCHK 28 /* machine check trap */ 6817520Sdg#define T_RESERVED 29 /* reserved (unknown) */ 694Srgrimes 705603Sbde/* XXX most of the following codes aren't used, but could be. */ 715603Sbde 724Srgrimes/* definitions for <sys/signal.h> */ 734Srgrimes#define ILL_RESAD_FAULT T_RESADFLT 744Srgrimes#define ILL_PRIVIN_FAULT T_PRIVINFLT 754Srgrimes#define ILL_RESOP_FAULT T_RESOPFLT 764Srgrimes#define ILL_ALIGN_FAULT T_ALIGNFLT 774Srgrimes#define ILL_FPOP_FAULT T_FPOPFLT /* coprocessor operand fault */ 784Srgrimes 794Srgrimes/* codes for SIGFPE/ARITHTRAP */ 804Srgrimes#define FPE_INTOVF_TRAP 0x1 /* integer overflow */ 814Srgrimes#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */ 824Srgrimes#define FPE_FLTDIV_TRAP 0x3 /* floating/decimal divide by zero */ 834Srgrimes#define FPE_FLTOVF_TRAP 0x4 /* floating overflow */ 844Srgrimes#define FPE_FLTUND_TRAP 0x5 /* floating underflow */ 854Srgrimes#define FPE_FPU_NP_TRAP 0x6 /* floating point unit not present */ 864Srgrimes#define FPE_SUBRNG_TRAP 0x7 /* subrange out of bounds */ 874Srgrimes 884Srgrimes/* codes for SIGBUS */ 894Srgrimes#define BUS_PAGE_FAULT T_PAGEFLT /* page fault protection base */ 904Srgrimes#define BUS_SEGNP_FAULT T_SEGNPFLT /* segment not present */ 914Srgrimes#define BUS_STK_FAULT T_STKFLT /* stack segment */ 924Srgrimes#define BUS_SEGM_FAULT T_RESERVED /* segment protection base */ 934Srgrimes 944Srgrimes/* Trap's coming from user mode */ 954Srgrimes#define T_USER 0x100 965603Sbde 975603Sbde#endif /* !_MACHINE_TRAP_H_ */ 98