summaryrefslogtreecommitdiff
path: root/system/alpha/h/ev5_alpha_defs.h
blob: 6dd9322c6f4ca51887940696263f3a1428e56d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
/*
 * Copyright 1993 Hewlett-Packard Development Company, L.P.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef EV5_ALPHA_DEFS_INCLUDED
#define EV5_ALPHA_DEFS_INCLUDED 1

// from ev5_alpha_defs.mar from Lance's fetch directory
// Lower-caseified and $ signs removed ... pb Nov/95

//
// PS Layout - PS
//	Loc	Size	name 	function
//	------	------	______	-----------------------------------
//	<31:29>	3	SA	stack alignment
//	<31:13>	24	RES	Reserved MBZ
//	<12:8>	5	IPL	Priority level
//	<7>	1	VMM	Virtual Mach Monitor
//	<6:5>	2	RES	Reserved MBZ
//	<4:3>	2	CM	Current Mode
//	<2>	1	IP	Interrupt Pending
//	<1:0>	2	SW	Software bits
//

#define ps_v_sw		0
#define ps_m_sw		(3<<ps_v_sw)

#define ps_v_ip		2
#define ps_m_ip		(1<<ps_v_ip)

#define ps_v_cm		3
#define ps_m_cm		(3<<ps_v_cm)

#define ps_v_vmm	7
#define ps_m_vmm	(1<<ps_v_vmm)

#define ps_v_ipl	8
#define ps_m_ipl	(0x1f<<ps_v_ipl)

#define ps_v_sp		(0x38)
#define ps_m_sp		(0x3f<<ps_v_sp)


#define ps_c_kern	(0x00)
#define ps_c_exec	(0x08)
#define ps_c_supr	(0x10)
#define ps_c_user	(0x18)
#define ps_c_ipl0	(0x0000)
#define ps_c_ipl1	(0x0100)
#define ps_c_ipl2	(0x0200)
#define ps_c_ipl3	(0x0300)
#define ps_c_ipl4	(0x0400)
#define ps_c_ipl5	(0x0500)
#define ps_c_ipl6	(0x0600)
#define ps_c_ipl7	(0x0700)
#define ps_c_ipl8	(0x0800)
#define ps_c_ipl9	(0x0900)
#define ps_c_ipl10	(0x0A00)
#define ps_c_ipl11	(0x0B00)
#define ps_c_ipl12	(0x0C00)
#define ps_c_ipl13	(0x0D00)
#define ps_c_ipl14	(0x0E00)
#define ps_c_ipl15	(0x0F00)
#define ps_c_ipl16	(0x1000)
#define ps_c_ipl17	(0x1100)
#define ps_c_ipl18	(0x1200)
#define ps_c_ipl19	(0x1300)
#define ps_c_ipl20	(0x1400)
#define ps_c_ipl21	(0x1500)
#define ps_c_ipl22	(0x1600)
#define ps_c_ipl23	(0x1700)
#define ps_c_ipl24	(0x1800)
#define ps_c_ipl25	(0x1900)
#define ps_c_ipl26	(0x1A00)
#define ps_c_ipl27	(0x1B00)
#define ps_c_ipl28	(0x1C00)
#define ps_c_ipl29	(0x1D00)
#define ps_c_ipl30	(0x1E00)
#define ps_c_ipl31	(0x1F00)

//
// PTE layout - symbol prefix PTE_
//
//	Loc	Size	name 	function
//	------	------	------	-----------------------------------
//	<63:32>	32	PFN	Page Frame Number
//	<31:16>	16	SOFT	Bits reserved for software use
//	<15>	1	UWE	User write enable
//	<14>	1	SWE	Super write enable
//	<13>	1	EWE	Exec write enable
//	<12>	1	KWE	Kernel write enable
//	<11>	1	URE	User read enable
//	<10>	1	SRE	Super read enable
//	<9>	1	ERE	Exec read enable
//	<8>	1	KRE	Kernel read enable
//	<7:6>	2	RES	Reserved SBZ
//	<5>	1	HPF	Huge Page Flag
//	<4>	1	ASM	Wild card address space number match
//	<3>	1	FOE	Fault On execute
//	<2>	1	FOW	Fault On Write
//	<1>	1	FOR	Fault On Read
// 	<0>	1	V	valid bit
//

#define pte_v_pfn	32
#define pte_m_soft	(0xFFFF0000)
#define pte_v_soft	16
#define pte_m_uwe	(0x8000)
#define pte_v_uwe	15
#define pte_m_swe	(0x4000)
#define pte_v_swe	14
#define pte_m_ewe	(0x2000)
#define pte_v_ewe	13
#define pte_m_kwe	(0x1000)
#define pte_v_kwe	12
#define pte_m_ure	(0x0800)
#define pte_v_ure	11
#define pte_m_sre	(0x0400)
#define pte_v_sre	10
#define pte_m_ere	(0x0200)
#define pte_v_ere	 9
#define pte_m_kre	(0x0100)
#define pte_v_kre	 8
#define pte_m_hpf	(0x0020)
#define pte_v_hpf	5
#define pte_m_asm	(0x0010)
#define pte_v_asm	4
#define pte_m_foe	(0x0008)
#define pte_v_foe	3
#define pte_m_fow	(0x0004)
#define pte_v_fow	2
#define pte_m_for	(0x0002)
#define pte_v_for	1
#define pte_m_v		(0x0001)
#define pte_v_v		0

//
// VA layout - symbol prefix VA_
//
//	Loc	Size	name 	function
//	------	------	-------	-----------------------------------
//	<42:33>	10	SEG1	First seg table offset for mapping
//	<32:23>	10	SEG2	Second seg table offset for mapping
//	<22:13>	10	SEG3	Third seg table offset for mapping
//	<12:0>	13	OFFSET	Byte within page
//

#define va_m_offset	(0x000000001FFF)
#define va_v_offset	0
#define va_m_seg3	(0x0000007FE000)
#define va_v_seg3	13
#define va_m_seg2	(0x0001FF800000)
#define va_v_seg2	23
#define va_m_seg1	(0x7FE00000000)
#define va_v_seg1	33

//
//PRIVILEGED CONTEXT BLOCK (PCB)
//
#define pcb_q_ksp	0
#define pcb_q_esp	8
#define pcb_q_ssp	16
#define pcb_q_usp	24
#define pcb_q_ptbr	32
#define pcb_q_asn	40
#define pcb_q_ast	48
#define pcb_q_fen	56
#define pcb_q_cc	64
#define pcb_q_unq	72
#define pcb_q_sct	80

#define pcb_v_asten	0
#define pcb_m_asten	(0x0f<<pcb_v_asten)
#define pcb_v_astsr	4
#define pcb_m_astsr	(0x0f<<pcb_v_astsr)
#define pcb_v_dat	63
#define pcb_v_pme	62

//
// SYSTEM CONTROL BLOCK (SCB)
//

#define scb_v_fen		(0x0010)
#define scb_v_acv		(0x0080)
#define scb_v_tnv		(0x0090)
#define scb_v_for		(0x00A0)
#define scb_v_fow		(0x00B0)
#define scb_v_foe		(0x00C0)
#define scb_v_arith		(0x0200)
#define scb_v_kast		(0x0240)
#define scb_v_east		(0x0250)
#define scb_v_sast		(0x0260)
#define scb_v_uast		(0x0270)
#define scb_v_unalign		(0x0280)
#define scb_v_bpt		(0x0400)
#define scb_v_bugchk		(0x0410)
#define scb_v_opcdec		(0x0420)
#define scb_v_illpal		(0x0430)
#define scb_v_trap		(0x0440)
#define scb_v_chmk		(0x0480)
#define scb_v_chme		(0x0490)
#define scb_v_chms		(0x04A0)
#define scb_v_chmu		(0x04B0)
#define scb_v_sw0		(0x0500)
#define scb_v_sw1		(0x0510)
#define scb_v_sw2		(0x0520)
#define scb_v_sw3		(0x0530)
#define scb_v_sw4		(0x0540)
#define scb_v_sw5		(0x0550)
#define scb_v_sw6		(0x0560)
#define scb_v_sw7		(0x0570)
#define scb_v_sw8		(0x0580)
#define scb_v_sw9		(0x0590)
#define scb_v_sw10		(0x05A0)
#define scb_v_sw11		(0x05B0)
#define scb_v_sw12		(0x05C0)
#define scb_v_sw13		(0x05D0)
#define scb_v_sw14		(0x05E0)
#define scb_v_sw15		(0x05F0)
#define scb_v_clock		(0x0600)
#define scb_v_inter		(0x0610)
#define scb_v_sys_corr_err	(0x0620)
#define scb_v_proc_corr_err	(0x0630)
#define scb_v_pwrfail		(0x0640)
#define scb_v_perfmon		(0x0650)
#define scb_v_sysmchk		(0x0660)
#define scb_v_procmchk		(0x0670)
#define scb_v_passive_rel	(0x06F0)

//
// Stack frame (FRM)
//

#define frm_v_r2		(0x0000)
#define frm_v_r3		(0x0008)
#define frm_v_r4		(0x0010)
#define frm_v_r5		(0x0018)
#define frm_v_r6		(0x0020)
#define frm_v_r7		(0x0028)
#define frm_v_pc		(0x0030)
#define frm_v_ps		(0x0038)

//
// Exeception summary register (EXS)
//
// exs_v_swc		<0>	; Software completion
// exs_v_inv		<1>	; Ivalid operation
// exs_v_dze		<2>	; Div by zero
// exs_v_fov		<3>	; Floating point overflow
// exs_v_unf		<4>	; Floating point underflow
// exs_v_ine		<5>	; Floating point inexact
// exs_v_iov		<6>	; Floating convert to integer overflow
#define exs_v_swc	  0
#define exs_v_inv	  1
#define exs_v_dze	  2
#define exs_v_fov	  3
#define exs_v_unf	  4
#define exs_v_ine	  5
#define exs_v_iov	  6

#define exs_m_swc               (1<<exs_v_swc)
#define exs_m_inv               (1<<exs_v_inv)
#define exs_m_dze               (1<<exs_v_dze)
#define exs_m_fov               (1<<exs_v_fov)
#define exs_m_unf               (1<<exs_v_unf)
#define exs_m_ine               (1<<exs_v_ine)
#define exs_m_iov               (1<<exs_v_iov)

//
// machine check error summary register (mces)
//
// mces_v_mchk		<0>	; machine check in progress
// mces_v_sce		<1>	; system correctable error
// mces_v_pce		<2>	; processor correctable error
// mces_v_dpc		<3>	; disable reporting of processor correctable errors
// mces_v_dsc		<4>	; disable reporting of system correctable errors
#define mces_v_mchk	 0
#define mces_v_sce	 1
#define mces_v_pce	 2
#define mces_v_dpc	 3
#define mces_v_dsc	 4

#define mces_m_mchk              (1<<mces_v_mchk)
#define mces_m_sce               (1<<mces_v_sce)
#define mces_m_pce               (1<<mces_v_pce)
#define mces_m_dpc               (1<<mces_v_dpc)
#define mces_m_dsc               (1<<mces_v_dsc)
#define mces_m_all		 ((1<<mces_v_mchk) | (1<<mces_v_sce) | (1<<mces_v_pce) | (1<<mces_v_dpc) | (1<<mces_v_dsc))

#endif