trap.h revision 1.2 1 1.2 eeh /* $NetBSD: trap.h,v 1.2 1998/09/07 01:39:52 eeh Exp $ */
2 1.1 eeh
3 1.1 eeh /*
4 1.1 eeh * Copyright (c) 1992, 1993
5 1.1 eeh * The Regents of the University of California. All rights reserved.
6 1.1 eeh *
7 1.1 eeh * This software was developed by the Computer Systems Engineering group
8 1.1 eeh * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9 1.1 eeh * contributed to Berkeley.
10 1.1 eeh *
11 1.1 eeh * All advertising materials mentioning features or use of this software
12 1.1 eeh * must display the following acknowledgement:
13 1.1 eeh * This product includes software developed by the University of
14 1.1 eeh * California, Lawrence Berkeley Laboratory.
15 1.1 eeh *
16 1.1 eeh * Redistribution and use in source and binary forms, with or without
17 1.1 eeh * modification, are permitted provided that the following conditions
18 1.1 eeh * are met:
19 1.1 eeh * 1. Redistributions of source code must retain the above copyright
20 1.1 eeh * notice, this list of conditions and the following disclaimer.
21 1.1 eeh * 2. Redistributions in binary form must reproduce the above copyright
22 1.1 eeh * notice, this list of conditions and the following disclaimer in the
23 1.1 eeh * documentation and/or other materials provided with the distribution.
24 1.1 eeh * 3. All advertising materials mentioning features or use of this software
25 1.1 eeh * must display the following acknowledgement:
26 1.1 eeh * This product includes software developed by the University of
27 1.1 eeh * California, Berkeley and its contributors.
28 1.1 eeh * 4. Neither the name of the University nor the names of its contributors
29 1.1 eeh * may be used to endorse or promote products derived from this software
30 1.1 eeh * without specific prior written permission.
31 1.1 eeh *
32 1.1 eeh * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
33 1.1 eeh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 1.1 eeh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 1.1 eeh * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
36 1.1 eeh * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 1.1 eeh * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 1.1 eeh * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 1.1 eeh * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 1.1 eeh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 1.1 eeh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 1.1 eeh * SUCH DAMAGE.
43 1.1 eeh *
44 1.1 eeh * @(#)trap.h 8.1 (Berkeley) 6/11/93
45 1.1 eeh */
46 1.1 eeh /*
47 1.1 eeh * Sun4m support by Aaron Brown, Harvard University.
48 1.1 eeh * Changes Copyright (c) 1995 The President and Fellows of Harvard College.
49 1.1 eeh * All rights reserved.
50 1.1 eeh */
51 1.1 eeh
52 1.1 eeh #ifndef _MACHINE_TRAP_H
53 1.1 eeh #define _MACHINE_TRAP_H
54 1.1 eeh
55 1.1 eeh /* trap vec (pri) description */
56 1.1 eeh /* 0x000 unused */
57 1.1 eeh #define T_POR 0x001 /* (0) power on reset */
58 1.1 eeh #define T_WDR 0x002 /* (1) watchdog reset */
59 1.1 eeh #define T_XIR 0x003 /* (1) externally initiated reset */
60 1.1 eeh #define T_SIR 0x004 /* (1) software initiated reset */
61 1.1 eeh #define T_RED_EXCEPTION 0x005 /* (1) RED state exception */
62 1.1 eeh /* 0x006 unused */
63 1.1 eeh /* 0x007 unused */
64 1.1 eeh #define T_INST_EXCEPT 0x008 /* (5) instruction access exception */
65 1.1 eeh #define T_TEXTFAULT 0x009 /* (2) ? Text fault */
66 1.1 eeh #define T_INST_ERROR 0x00a /* (3) instruction access error */
67 1.1 eeh /* 0x00b unused */
68 1.1 eeh /* through 0x00f unused */
69 1.1 eeh #define T_ILLINST 0x010 /* (7) illegal instruction */
70 1.1 eeh #define T_PRIVINST 0x011 /* (6) privileged opcode */
71 1.1 eeh /* 0x012 unused */
72 1.1 eeh /* through 0x01f unused */
73 1.1 eeh #define T_FPDISABLED 0x020 /* (8) fpu disabled */
74 1.1 eeh #define T_FP_IEEE_754 0x021 /* (11) ieee 754 exception */
75 1.1 eeh #define T_FP_OTHER 0x022 /* (11) other fp exception */
76 1.1 eeh #define T_TAGOF 0x023 /* (14) tag overflow */
77 1.1 eeh #define T_CLEAN_WINDOW 0x024 /* (10) clean window exception */
78 1.1 eeh /* through 0x027 unused */
79 1.1 eeh #define T_DIV0 0x028 /* (15) division routine was handed 0 */
80 1.1 eeh /* 0x02a unused */
81 1.1 eeh /* through 0x02f unused */
82 1.1 eeh #define T_DATAFAULT 0x030 /* (12) address fault during data fetch */
83 1.1 eeh /* 0x031 unused */
84 1.1 eeh #define T_DATA_ERROR 0x032
85 1.1 eeh #define T_DATA_PROT 0x033 /* Data protection ??? */
86 1.1 eeh #define T_ALIGN 0x034 /* (10) address not properly aligned */
87 1.1 eeh #define T_LDDF_ALIGN 0x035 /* (10) LDDF address not properly aligned */
88 1.1 eeh #define T_STDF_ALIGN 0x036 /* (10) STDF address not properly aligned */
89 1.1 eeh #define T_PRIVACT 0x037 /* (11) privileged action */
90 1.1 eeh /* 0x038 unused */
91 1.1 eeh /* through 0x03F unused */
92 1.1 eeh #define T_ASYNC_ERROR 0x040 /* ???? */
93 1.1 eeh #define T_L1INT 0x041 /* (31) level 1 interrupt */
94 1.1 eeh #define T_L2INT 0x042 /* (30) level 2 interrupt */
95 1.1 eeh #define T_L3INT 0x043 /* (29) level 3 interrupt */
96 1.1 eeh #define T_L4INT 0x044 /* (28) level 4 interrupt */
97 1.1 eeh #define T_L5INT 0x045 /* (27) level 5 interrupt */
98 1.1 eeh #define T_L6INT 0x046 /* (26) level 6 interrupt */
99 1.1 eeh #define T_L7INT 0x047 /* (25) level 7 interrupt */
100 1.1 eeh #define T_L8INT 0x048 /* (24) level 8 interrupt */
101 1.1 eeh #define T_L9INT 0x049 /* (23) level 9 interrupt */
102 1.1 eeh #define T_L10INT 0x04a /* (22) level 10 interrupt */
103 1.1 eeh #define T_L11INT 0x04b /* (21) level 11 interrupt */
104 1.1 eeh #define T_L12INT 0x04c /* (20) level 12 interrupt */
105 1.1 eeh #define T_L13INT 0x04d /* (19) level 13 interrupt */
106 1.1 eeh #define T_L14INT 0x04e /* (18) level 14 interrupt */
107 1.1 eeh #define T_L15INT 0x04f /* (17) level 15 interrupt */
108 1.1 eeh /* 0x050 unused */
109 1.1 eeh /* through 0x05F unused */
110 1.1 eeh #define T_INTVEC 0x060 /* (16) interrupt vector [Interrupt Global Regs]*/
111 1.1 eeh #define T_PA_WATCHPT 0x061 /* (12) Physical addr data watchpoint */
112 1.1 eeh #define T_VA_WATCHPT 0x062 /* (11) Virtual addr data watchpoint */
113 1.1 eeh #define T_ECCERR 0x063 /* (33) ECC correction error */
114 1.1 eeh #define T_FIMMU_MISS 0x064 /* (2) fast instruction access MMU miss */
115 1.1 eeh /* through 0x067 unused */
116 1.1 eeh #define T_FDMMU_MISS 0x068 /* (2) fast data access MMU miss */
117 1.1 eeh /* through 0x06b unused */
118 1.1 eeh #define T_FDMMU_PROT 0x06C /* (2) fast data access protection */
119 1.1 eeh /* through 0x06F unused */
120 1.1 eeh /* 0x070...0x07f implementation dependent exceptions */
121 1.1 eeh #define T_SPILL_N_NORM 0x080 /* (9) spill (n=0..7) normal */
122 1.1 eeh /* through 0x09F unused */
123 1.1 eeh #define T_SPILL_N_OTHER 0x0a0 /* (9) spill (n=0..7) other */
124 1.1 eeh /* through 0x0bF unused */
125 1.1 eeh #define T_FILL_N_NORM 0x0c0 /* (9) fill (n=0..7) normal */
126 1.1 eeh /* through 0x0dF unused */
127 1.1 eeh #define T_FILL_N_OTHER 0x0e0 /* (9) fill (n=0..7) other */
128 1.1 eeh /* through 0x0fF unused */
129 1.1 eeh
130 1.1 eeh /* beginning of `user' vectors (from trap instructions) - all priority 16 */
131 1.1 eeh #define T_SUN_SYSCALL 0x100 /* system call */
132 1.1 eeh #define T_BREAKPOINT 0x101 /* breakpoint `instruction' */
133 1.1 eeh #define T_UDIV0 0x102 /* division routine was handed 0 */
134 1.1 eeh #define T_FLUSHWIN 0x103 /* flush windows */
135 1.1 eeh #define T_CLEANWIN 0x104 /* provide clean windows */
136 1.1 eeh #define T_RANGECHECK 0x105 /* ? */
137 1.1 eeh #define T_FIXALIGN 0x106 /* fix up unaligned accesses */
138 1.1 eeh #define T_INTOF 0x107 /* integer overflow ? */
139 1.1 eeh #define T_SVR4_SYSCALL 0x108 /* SVR4 system call */
140 1.1 eeh #define T_BSD_SYSCALL 0x109 /* BSD system call */
141 1.1 eeh #define T_KGDB_EXEC 0x10a /* for kernel gdb */
142 1.1 eeh
143 1.1 eeh /* 0x10b..0x1ff are currently unallocated, except the following */
144 1.1 eeh #define T_SVR4_GETCC 0x120
145 1.1 eeh #define T_SVR4_SETCC 0x121
146 1.1 eeh #define T_SVR4_GETPSR 0x122
147 1.1 eeh #define T_SVR4_SETPSR 0x123
148 1.1 eeh #define T_SVR4_GETHRTIME 0x124
149 1.1 eeh #define T_SVR4_GETHRVTIME 0x125
150 1.1 eeh #define T_SVR4_GETHRESTIME 0x127
151 1.2 eeh #define T_GETCC 0x132
152 1.2 eeh #define T_SETCC 0x133
153 1.2 eeh #define T_SVID_SYSCALL 0x164
154 1.2 eeh #define T_SPARC_INTL_SYSCALL 0x165
155 1.2 eeh #define T_OS_VENDOR_SYSCALL 0x166
156 1.2 eeh #define T_HW_OEM_SYSCALL 0x167
157 1.2 eeh #define T_RTF_DEF_TRAP 0x168
158 1.1 eeh
159 1.1 eeh #ifdef _KERNEL /* pseudo traps for locore.s */
160 1.1 eeh #define T_RWRET -1 /* need first user window for trap return */
161 1.1 eeh #define T_AST -2 /* no-op, just needed reschedule or profile */
162 1.1 eeh #endif
163 1.1 eeh
164 1.1 eeh /* flags to system call (flags in %g1 along with syscall number) */
165 1.1 eeh #define SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */
166 1.1 eeh #define SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */
167 1.1 eeh
168 1.1 eeh /*
169 1.1 eeh * `software trap' macros to keep people happy (sparc v8 manual says not
170 1.1 eeh * to set the upper bits).
171 1.1 eeh */
172 1.1 eeh #define ST_BREAKPOINT (T_BREAKPOINT & 0x7f)
173 1.1 eeh #define ST_DIV0 (T_DIV0 & 0x7f)
174 1.1 eeh #define ST_FLUSHWIN (T_FLUSHWIN & 0x7f)
175 1.1 eeh #define ST_SYSCALL (T_SUN_SYSCALL & 0x7f)
176 1.1 eeh
177 1.1 eeh #endif /* _MACHINE_TRAP_H_ */
178