xref: /titanic_51/usr/src/uts/sparc/v9/sys/machtrap.h (revision bbaa8b60dd95d714741fc474adad3cf710ef4efd)
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 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_MACHTRAP_H
28 #define	_SYS_MACHTRAP_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * This file is machine specific as is.
38  * Some trap types could be made common
39  * for all sparcs, but that is a project
40  * in and of itself.
41  */
42 
43 /*
44  * Hardware traps.
45  */
46 #define	T_POR			0x001
47 #define	T_WDR			0x002
48 #define	T_XIR			0x003
49 #define	T_SIR			0x004
50 #define	T_RED_EXCEPTION		0x005
51 #define	T_INSTR_EXCEPTION	0x008
52 #define	T_INSTR_MMU_MISS	0x009
53 #define	T_INSTR_ERROR		0x00A
54 #define	T_UNIMP_INSTR		0x010
55 #define	T_PRIV_INSTR		0x011
56 #define	T_UNIMP_LDD		0x012
57 #define	T_UNIMP_STD		0x013
58 #define	T_FP_DISABLED		0x020
59 #define	T_FP_EXCEPTION_IEEE	0x021
60 #define	T_FP_EXCEPTION_OTHER	0x022
61 #define	T_TAG_OVERFLOW		0x023
62 #define	T_CLEAN_WINDOW		0x024
63 #define	T_IDIV0			0x028
64 #define	T_DATA_EXCEPTION	0x030
65 #define	T_DATA_MMU_MISS		0x031
66 #define	T_DATA_ERROR		0x032
67 #define	T_DATA_PROT		0x033
68 #define	T_ALIGNMENT		0x034
69 #define	T_LDDF_ALIGN		0x035
70 #define	T_STDF_ALIGN		0x036
71 #define	T_PRIV_ACTION		0x037
72 #define	T_ASYNC_ERROR		0x040
73 #define	T_INT_LEVEL_1		0x041
74 #define	T_INT_LEVEL_2		0x042
75 #define	T_INT_LEVEL_3		0x043
76 #define	T_INT_LEVEL_4		0x044
77 #define	T_INT_LEVEL_5		0x045
78 #define	T_INT_LEVEL_6		0x046
79 #define	T_INT_LEVEL_7		0x047
80 #define	T_INT_LEVEL_8		0x048
81 #define	T_INT_LEVEL_9		0x049
82 #define	T_INT_LEVEL_10		0x04A
83 #define	T_INT_LEVEL_11		0x04B
84 #define	T_INT_LEVEL_12		0x04C
85 #define	T_INT_LEVEL_13		0x04D
86 #define	T_INT_LEVEL_14		0x04E
87 #define	T_INT_LEVEL_15		0x04F
88 #define	T_VECTORED_INT		0x060
89 #define	T_PA_WATCHPOINT		0x061
90 #define	T_VA_WATCHPOINT		0x062
91 #define	T_FAST_INSTR_MMU_MISS	0x064
92 #define	T_FAST_DATA_MMU_MISS	0x068
93 #define	T_FAST_DATA_MMU_PROT	0x06C
94 #define	T_WIN_OVERFLOW		0x080
95 #define	T_WIN_UNDERFLOW		0x0C0
96 
97 /*
98  * T_TL1 is the bit that is used to compute the trap vector address when the
99  * trap is taken at TL>0.  This flag is for trap_table.s use, not trap.c use.
100  */
101 #define	T_TL1			0x200
102 
103 /*
104  * Software trap type values.
105  */
106 #define	T_SOFTWARE_TRAP		0x100
107 #define	T_ESOFTWARE_TRAP	0x1FF
108 #define	T_OSYSCALL		(T_SOFTWARE_TRAP + ST_OSYSCALL)
109 #define	T_BREAKPOINT		(T_SOFTWARE_TRAP + ST_BREAKPOINT)
110 #define	T_DIV0			(T_SOFTWARE_TRAP + ST_DIV0)
111 #define	T_FLUSH_WINDOWS		(T_SOFTWARE_TRAP + ST_FLUSH_WINDOWS)
112 #define	T_CLEAN_WINDOWS		(T_SOFTWARE_TRAP + ST_CLEAN_WINDOWS)
113 #define	T_RANGE_CHECK		(T_SOFTWARE_TRAP + ST_RANGE_CHECK)
114 #define	T_FIX_ALIGN		(T_SOFTWARE_TRAP + ST_FIX_ALIGN)
115 #define	T_INT_OVERFLOW		(T_SOFTWARE_TRAP + ST_INT_OVERFLOW)
116 #define	T_SYSCALL		(T_SOFTWARE_TRAP + ST_SYSCALL)
117 #define	T_GETCC			(T_SOFTWARE_TRAP + ST_GETCC)
118 #define	T_SETCC			(T_SOFTWARE_TRAP + ST_SETCC)
119 
120 #define	T_AST			0x200
121 #define	T_FLUSH_PCB		(T_AST + 0x10)
122 #define	T_SYS_RTT_PAGE		(T_AST + 0x20)
123 #define	T_SYS_RTT_ALIGN		(T_AST + 0x30)
124 #define	T_FLUSHW		(T_AST + 0x40)
125 
126 /* user mode flag added to trap type */
127 #define	T_USER			0x10000
128 
129 
130 #ifdef	__cplusplus
131 }
132 #endif
133 
134 #endif	/* _SYS_MACHTRAP_H */
135