xref: /netbsd-src/sys/arch/mips/include/regnum.h (revision 404fbe5fb94ca1e054339640cabb2801ce52dd30)
1 /*	$NetBSD: regnum.h,v 1.8 2005/12/11 12:18:09 christos Exp $	*/
2 
3 /*
4  * Copyright (c) 1992, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * the Systems Programming Group of the University of Utah Computer
9  * Science Department and Ralph Campbell.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  * from: Utah Hdr: reg.h 1.1 90/07/09
36  *
37  *	@(#)reg.h	8.2 (Berkeley) 1/11/94
38  */
39 /*
40  * Copyright (c) 1988 University of Utah.
41  *
42  * This code is derived from software contributed to Berkeley by
43  * the Systems Programming Group of the University of Utah Computer
44  * Science Department and Ralph Campbell.
45  *
46  * Redistribution and use in source and binary forms, with or without
47  * modification, are permitted provided that the following conditions
48  * are met:
49  * 1. Redistributions of source code must retain the above copyright
50  *    notice, this list of conditions and the following disclaimer.
51  * 2. Redistributions in binary form must reproduce the above copyright
52  *    notice, this list of conditions and the following disclaimer in the
53  *    documentation and/or other materials provided with the distribution.
54  * 3. All advertising materials mentioning features or use of this software
55  *    must display the following acknowledgement:
56  *	This product includes software developed by the University of
57  *	California, Berkeley and its contributors.
58  * 4. Neither the name of the University nor the names of its contributors
59  *    may be used to endorse or promote products derived from this software
60  *    without specific prior written permission.
61  *
62  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72  * SUCH DAMAGE.
73  *
74  * from: Utah Hdr: reg.h 1.1 90/07/09
75  *
76  *	@(#)reg.h	8.2 (Berkeley) 1/11/94
77  */
78 
79 /*
80  * Location of the users' stored
81  * registers relative to ZERO.
82  * Usage is p->p_regs[XX].
83  */
84 #define _R_ZERO		0
85 #define _R_AST		1
86 #define _R_V0		2
87 #define _R_V1		3
88 #define _R_A0		4
89 #define _R_A1		5
90 #define _R_A2		6
91 #define _R_A3		7
92 #if defined(__mips_n32) || defined(__mips_n64)
93 #define _R_A4		8
94 #define _R_A5		9
95 #define _R_A6		10
96 #define _R_A7		11
97 #define _R_T0		12
98 #define _R_T1		13
99 #define _R_T2		14
100 #define _R_T3		15
101 #else
102 #define _R_T0		8
103 #define _R_T1		9
104 #define _R_T2		10
105 #define _R_T3		11
106 #define _R_T4		12
107 #define _R_T5		13
108 #define _R_T6		14
109 #define _R_T7		15
110 #endif /* __mips_n32 || __mips_n64 */
111 #define _R_S0		16
112 #define _R_S1		17
113 #define _R_S2		18
114 #define _R_S3		19
115 #define _R_S4		20
116 #define _R_S5		21
117 #define _R_S6		22
118 #define _R_S7		23
119 #define _R_T8		24
120 #define _R_T9		25
121 #define _R_K0		26
122 #define _R_K1		27
123 #define _R_GP		28
124 #define _R_SP		29
125 #define _R_S8		30
126 #define _R_RA		31
127 #define	_R_SR		32
128 #ifndef _KERNEL		/* clashes with netccitt/pk.h */
129 #define	_R_PS		_R_SR	/* alias for SR */
130 #endif
131 
132 /* See <mips/regdef.h> for an explanation. */
133 #if defined(__mips_n32) || defined(__mips_n64)
134 #define	_R_TA0		8
135 #define	_R_TA1		9
136 #define	_R_TA2		10
137 #define	_R_TA3		11
138 #else
139 #define	_R_TA0		12
140 #define	_R_TA1		13
141 #define	_R_TA2		14
142 #define	_R_TA3		15
143 #endif /* __mips_n32 || __mips_n64 */
144 
145 #define _R_MULLO	33
146 #define _R_MULHI	34
147 #define _R_BADVADDR	35
148 #define _R_CAUSE	36
149 #define	_R_PC		37
150 
151 #define _FPBASE	38
152 #define _R_F0		(_FPBASE+0)
153 #define _R_F1		(_FPBASE+1)
154 #define _R_F2		(_FPBASE+2)
155 #define _R_F3		(_FPBASE+3)
156 #define _R_F4		(_FPBASE+4)
157 #define _R_F5		(_FPBASE+5)
158 #define _R_F6		(_FPBASE+6)
159 #define _R_F7		(_FPBASE+7)
160 #define _R_F8		(_FPBASE+8)
161 #define _R_F9		(_FPBASE+9)
162 #define _R_F10		(_FPBASE+10)
163 #define _R_F11		(_FPBASE+11)
164 #define _R_F12		(_FPBASE+12)
165 #define _R_F13		(_FPBASE+13)
166 #define _R_F14		(_FPBASE+14)
167 #define _R_F15		(_FPBASE+15)
168 #define _R_F16		(_FPBASE+16)
169 #define _R_F17		(_FPBASE+17)
170 #define _R_F18		(_FPBASE+18)
171 #define _R_F19		(_FPBASE+19)
172 #define _R_F20		(_FPBASE+20)
173 #define _R_F21		(_FPBASE+21)
174 #define _R_F22		(_FPBASE+22)
175 #define _R_F23		(_FPBASE+23)
176 #define _R_F24		(_FPBASE+24)
177 #define _R_F25		(_FPBASE+25)
178 #define _R_F26		(_FPBASE+26)
179 #define _R_F27		(_FPBASE+27)
180 #define _R_F28		(_FPBASE+28)
181 #define _R_F29		(_FPBASE+29)
182 #define _R_F30		(_FPBASE+30)
183 #define _R_F31		(_FPBASE+31)
184 #define	_R_FSR		(_FPBASE+32)
185