xref: /titanic_51/usr/src/uts/intel/ia32/sys/trap.h (revision ea8dc4b6d2251b437950c0056bc626b311c73c27)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
23 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
24 /*	  All Rights Reserved  	*/
25 
26 /*
27  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 #ifndef _IA32_SYS_TRAP_H
32 #define	_IA32_SYS_TRAP_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Trap type values
42  */
43 
44 #define	T_ZERODIV	0x0	/* #de	divide by 0 error		*/
45 #define	T_SGLSTP	0x1	/* #db	single step			*/
46 #define	T_NMIFLT	0x2	/* 	NMI				*/
47 #define	T_BPTFLT	0x3	/* #bp	breakpoint fault, INT3 insn	*/
48 #define	T_OVFLW		0x4	/* #of	INTO overflow fault		*/
49 #define	T_BOUNDFLT	0x5	/* #br	BOUND insn fault		*/
50 #define	T_ILLINST	0x6	/* #ud	invalid opcode fault		*/
51 #define	T_NOEXTFLT	0x7	/* #nm	device not available: x87	*/
52 #define	T_DBLFLT	0x8	/* #df	double fault			*/
53 #define	T_EXTOVRFLT	0x9	/* 	[not generated: 386 only]	*/
54 #define	T_TSSFLT	0xa	/* #ts	invalid TSS fault		*/
55 #define	T_SEGFLT	0xb	/* #np	segment not present fault	*/
56 #define	T_STKFLT	0xc	/* #ss	stack fault			*/
57 #define	T_GPFLT		0xd	/* #gp	general protection fault	*/
58 #define	T_PGFLT		0xe	/* #pf	page fault			*/
59 #define	T_EXTERRFLT	0x10	/* #mf	x87 FPU error fault		*/
60 #define	T_ALIGNMENT	0x11	/* #ac	alignment check error		*/
61 #define	T_MCE		0x12	/* #mc	machine check exception		*/
62 #define	T_SIMDFPE	0x13	/* #xm	SSE/SSE exception		*/
63 #define	T_DBGENTR	0x14	/*	debugger entry 			*/
64 #define	T_ENDPERR	0x21	/*	emulated extension error flt	*/
65 #define	T_ENOEXTFLT	0x20	/*	emulated ext not present	*/
66 #define	T_FASTTRAP	0xd2	/*	fast system call		*/
67 #define	T_SYSCALLINT	0x91	/*	general system call		*/
68 #define	T_DTRACE_PROBE	0x7e	/*	DTrace fasttrap probe		*/
69 #define	T_DTRACE_RET	0x7f	/*	DTrace pid return		*/
70 #define	T_SOFTINT	0x50fd	/*	pseudo softint trap type	*/
71 
72 /*
73  * Pseudo traps.
74  */
75 #define	T_INTERRUPT		0x100
76 #define	T_FAULT			0x200
77 #define	T_AST			0x400
78 #define	T_SYSCALL		0x180
79 
80 
81 /*
82  *  Values of error code on stack in case of page fault
83  */
84 
85 #define	PF_ERR_MASK	0x01	/* Mask for error bit */
86 #define	PF_ERR_PAGE	0x00	/* page not present */
87 #define	PF_ERR_PROT	0x01	/* protection error */
88 #define	PF_ERR_WRITE	0x02	/* fault caused by write (else read) */
89 #define	PF_ERR_USER	0x04	/* processor was in user mode */
90 				/*	(else supervisor) */
91 #define	PF_ERR_EXEC	0x10	/* attempt to execute a No eXec page (AMD) */
92 
93 /*
94  *  Definitions for fast system call subfunctions
95  */
96 #define	T_FNULL		0	/* Null trap for testing		*/
97 #define	T_FGETFP	1	/* Get emulated FP context		*/
98 #define	T_FSETFP	2	/* Set emulated FP context		*/
99 #define	T_GETHRTIME	3	/* Get high resolution time		*/
100 #define	T_GETHRVTIME	4	/* Get high resolution virtual time	*/
101 #define	T_GETHRESTIME	5	/* Get high resolution time		*/
102 #define	T_GETLGRP	6	/* Get home lgrpid			*/
103 
104 #define	T_LASTFAST	6	/* Last valid subfunction		*/
105 
106 #ifdef	__cplusplus
107 }
108 #endif
109 
110 #endif	/* _IA32_SYS_TRAP_H */
111