xref: /csrg-svn/sys/i386/include/trap.h (revision 45602)
141058Swilliam /*-
241058Swilliam  * Copyright (c) 1990 The Regents of the University of California.
341058Swilliam  * All rights reserved.
441058Swilliam  *
541058Swilliam  * This code is derived from software contributed to Berkeley by
641058Swilliam  * William Jolitz.
741058Swilliam  *
841058Swilliam  * %sccs.include.noredist.c%
941058Swilliam  *
10*45602Sbill  *	@(#)trap.h	5.2 (Berkeley) 11/14/90
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 */
36*45602Sbill #define	T_NMI		19	/* non-maskable trap */
37*45602Sbill #define	T_OFLOW		20	/* overflow trap */
38*45602Sbill #define	T_BOUND		21	/* bound instruction fault */
39*45602Sbill #define	T_DNA		22	/* device not available fault */
40*45602Sbill #define	T_DOUBLEFLT	23	/* double fault */
41*45602Sbill #define	T_FPOPFLT	24	/* fp coprocessor operand fetch fault */
42*45602Sbill #define	T_TSSFLT	25	/* invalid tss fault */
43*45602Sbill #define	T_SEGNPFLT	26	/* segment not present fault */
44*45602Sbill #define	T_STKFLT	27	/* stack fault */
45*45602Sbill #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
52*45602Sbill #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 */
60*45602Sbill #define	    FPE_FPU_NP_TRAP	0x6	/* floating point unit not present */
61*45602Sbill #define	    FPE_SUBRNG_TRAP	0x7	/* subrange out of bounds */
62*45602Sbill 
63*45602Sbill /* codes for SIGBUS */
64*45602Sbill #define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault protection base */
65*45602Sbill #define	    BUS_SEGNP_FAULT	T_SEGNPFLT	/* segment not present */
66*45602Sbill #define	    BUS_STK_FAULT	T_STKFLT	/* stack segment */
67*45602Sbill #define	    BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */
68