xref: /onnv-gate/usr/src/uts/sparc/v7/sys/machtrap.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef	_SYS_MACHTRAP_H
28*0Sstevel@tonic-gate #define	_SYS_MACHTRAP_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #ifdef	__cplusplus
33*0Sstevel@tonic-gate extern "C" {
34*0Sstevel@tonic-gate #endif
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate /*
37*0Sstevel@tonic-gate  * This file is machine specific as is.
38*0Sstevel@tonic-gate  * Some trap types could be made common
39*0Sstevel@tonic-gate  * for all sparcs, but that is a project
40*0Sstevel@tonic-gate  * in and of itself.
41*0Sstevel@tonic-gate  */
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate /*
44*0Sstevel@tonic-gate  * Trap type values.
45*0Sstevel@tonic-gate  */
46*0Sstevel@tonic-gate #define	TT(X)			((X)<<4)
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate /*
49*0Sstevel@tonic-gate  * The Coprocessor bit.
50*0Sstevel@tonic-gate  */
51*0Sstevel@tonic-gate #define	CP_BIT 0x20
52*0Sstevel@tonic-gate 
53*0Sstevel@tonic-gate /*
54*0Sstevel@tonic-gate  * Hardware traps.
55*0Sstevel@tonic-gate  */
56*0Sstevel@tonic-gate #define	T_RESET			0x00
57*0Sstevel@tonic-gate #define	T_TEXT_FAULT		0x01
58*0Sstevel@tonic-gate #define	T_UNIMP_INSTR		0x02
59*0Sstevel@tonic-gate #define	T_PRIV_INSTR		0x03
60*0Sstevel@tonic-gate #define	T_FP_DISABLED		0x04
61*0Sstevel@tonic-gate #define	T_CP_DISABLED		(0x4 | CP_BIT)
62*0Sstevel@tonic-gate #define	T_WIN_OVERFLOW		0x05
63*0Sstevel@tonic-gate #define	T_WIN_UNDERFLOW		0x06
64*0Sstevel@tonic-gate #define	T_ALIGNMENT		0x07
65*0Sstevel@tonic-gate #define	T_FP_EXCEPTION		0x08
66*0Sstevel@tonic-gate #define	T_CP_EXCEPTION		(0x8 | CP_BIT)
67*0Sstevel@tonic-gate #define	T_DATA_FAULT		0x09
68*0Sstevel@tonic-gate #define	T_TAG_OVERFLOW		0x0A
69*0Sstevel@tonic-gate #define	T_INT			0x10
70*0Sstevel@tonic-gate #define	T_INT_LEVEL		0x0F
71*0Sstevel@tonic-gate #define	T_INT_LEVEL_1		0x11
72*0Sstevel@tonic-gate #define	T_INT_LEVEL_2		0x12
73*0Sstevel@tonic-gate #define	T_INT_LEVEL_3		0x13
74*0Sstevel@tonic-gate #define	T_INT_LEVEL_4		0x14
75*0Sstevel@tonic-gate #define	T_INT_LEVEL_5		0x15
76*0Sstevel@tonic-gate #define	T_INT_LEVEL_6		0x16
77*0Sstevel@tonic-gate #define	T_INT_LEVEL_7		0x17
78*0Sstevel@tonic-gate #define	T_INT_LEVEL_8		0x18
79*0Sstevel@tonic-gate #define	T_INT_LEVEL_9		0x19
80*0Sstevel@tonic-gate #define	T_INT_LEVEL_10		0x1A
81*0Sstevel@tonic-gate #define	T_INT_LEVEL_11		0x1B
82*0Sstevel@tonic-gate #define	T_INT_LEVEL_12		0x1C
83*0Sstevel@tonic-gate #define	T_INT_LEVEL_13		0x1D
84*0Sstevel@tonic-gate #define	T_INT_LEVEL_14		0x1E
85*0Sstevel@tonic-gate #define	T_INT_LEVEL_15		0x1F
86*0Sstevel@tonic-gate #define	T_TEXT_ERROR		0x21
87*0Sstevel@tonic-gate #define	T_UNIMP_FLUSH		0x25	/* IFLUSH - unimplemented flush */
88*0Sstevel@tonic-gate #define	T_DATA_ERROR		0x29
89*0Sstevel@tonic-gate #define	T_IDIV0			0x2A
90*0Sstevel@tonic-gate #define	T_DATA_STORE		0x2B
91*0Sstevel@tonic-gate 
92*0Sstevel@tonic-gate /*
93*0Sstevel@tonic-gate  * Software trap type values.
94*0Sstevel@tonic-gate  */
95*0Sstevel@tonic-gate #define	T_SOFTWARE_TRAP		0x80
96*0Sstevel@tonic-gate #define	T_ESOFTWARE_TRAP	0xFF
97*0Sstevel@tonic-gate #define	T_OSYSCALL		(T_SOFTWARE_TRAP + ST_OSYSCALL)
98*0Sstevel@tonic-gate #define	T_BREAKPOINT		(T_SOFTWARE_TRAP + ST_BREAKPOINT)
99*0Sstevel@tonic-gate #define	T_DIV0			(T_SOFTWARE_TRAP + ST_DIV0)
100*0Sstevel@tonic-gate #define	T_FLUSH_WINDOWS		(T_SOFTWARE_TRAP + ST_FLUSH_WINDOWS)
101*0Sstevel@tonic-gate #define	T_CLEAN_WINDOWS		(T_SOFTWARE_TRAP + ST_CLEAN_WINDOWS)
102*0Sstevel@tonic-gate #define	T_RANGE_CHECK		(T_SOFTWARE_TRAP + ST_RANGE_CHECK)
103*0Sstevel@tonic-gate #define	T_FIX_ALIGN		(T_SOFTWARE_TRAP + ST_FIX_ALIGN)
104*0Sstevel@tonic-gate #define	T_INT_OVERFLOW		(T_SOFTWARE_TRAP + ST_INT_OVERFLOW)
105*0Sstevel@tonic-gate #define	T_SYSCALL		(T_SOFTWARE_TRAP + ST_SYSCALL)
106*0Sstevel@tonic-gate 
107*0Sstevel@tonic-gate #define	T_GETCC			(T_SOFTWARE_TRAP + ST_GETCC)
108*0Sstevel@tonic-gate #define	T_SETCC			(T_SOFTWARE_TRAP + ST_SETCC)
109*0Sstevel@tonic-gate 
110*0Sstevel@tonic-gate 
111*0Sstevel@tonic-gate /*
112*0Sstevel@tonic-gate  * Pseudo traps.
113*0Sstevel@tonic-gate  */
114*0Sstevel@tonic-gate #define	T_INTERRUPT		0x100
115*0Sstevel@tonic-gate #define	T_SPURIOUS		(T_INTERRUPT | T_INT)
116*0Sstevel@tonic-gate #define	T_FAULT			0x200
117*0Sstevel@tonic-gate #define	T_AST			0x400
118*0Sstevel@tonic-gate #define	T_FLUSH_PCB		(T_AST + 0x10)
119*0Sstevel@tonic-gate #define	T_SYS_RTT_PAGE		(T_AST + 0x20)
120*0Sstevel@tonic-gate #define	T_ZERO			0x00
121*0Sstevel@tonic-gate 
122*0Sstevel@tonic-gate #ifdef	__cplusplus
123*0Sstevel@tonic-gate }
124*0Sstevel@tonic-gate #endif
125*0Sstevel@tonic-gate 
126*0Sstevel@tonic-gate #endif	/* _SYS_MACHTRAP_H */
127