Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / arch / sun4u / traptable.fth
CommitLineData
920dae64
AT
1\ ========== Copyright Header Begin ==========================================
2\
3\ Hypervisor Software File: traptable.fth
4\
5\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6\
7\ - Do no alter or remove copyright notices
8\
9\ - Redistribution and use of this software in source and binary forms, with
10\ or without modification, are permitted provided that the following
11\ conditions are met:
12\
13\ - Redistribution of source code must retain the above copyright notice,
14\ this list of conditions and the following disclaimer.
15\
16\ - Redistribution in binary form must reproduce the above copyright notice,
17\ this list of conditions and the following disclaimer in the
18\ documentation and/or other materials provided with the distribution.
19\
20\ Neither the name of Sun Microsystems, Inc. or the names of contributors
21\ may be used to endorse or promote products derived from this software
22\ without specific prior written permission.
23\
24\ This software is provided "AS IS," without a warranty of any kind.
25\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
26\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
27\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
28\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
29\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
30\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
31\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
32\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
33\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
34\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
35\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
36\
37\ You acknowledge that this software is not designed, licensed or
38\ intended for use in the design, construction, operation or maintenance of
39\ any nuclear facility.
40\
41\ ========== Copyright Header End ============================================
42id: @(#)traptable.fth 1.18 06/02/16
43purpose:
44copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47also assembler definitions
48
49headers
50transient
51
52: window-spill ( -- )
53 %o6 1 %g0 andcc \ 1
54 0<> if %g0 h# 80 wrasi \ 2,3
55 %l0 %o6 V9_SP_BIAS d# 0 na+ %asi stxa \ 4
56 %l1 %o6 V9_SP_BIAS d# 1 na+ %asi stxa \ 5
57 %l2 %o6 V9_SP_BIAS d# 2 na+ %asi stxa \ 6
58 %l3 %o6 V9_SP_BIAS d# 3 na+ %asi stxa \ 7
59 %l4 %o6 V9_SP_BIAS d# 4 na+ %asi stxa \ 8
60 %l5 %o6 V9_SP_BIAS d# 5 na+ %asi stxa \ 9
61 %l6 %o6 V9_SP_BIAS d# 6 na+ %asi stxa \ 10
62 %l7 %o6 V9_SP_BIAS d# 7 na+ %asi stxa \ 11
63 %i0 %o6 V9_SP_BIAS d# 8 na+ %asi stxa \ 12
64 %i1 %o6 V9_SP_BIAS d# 9 na+ %asi stxa \ 13
65 %i2 %o6 V9_SP_BIAS d# 10 na+ %asi stxa \ 14
66 %i3 %o6 V9_SP_BIAS d# 11 na+ %asi stxa \ 15
67 %i4 %o6 V9_SP_BIAS d# 12 na+ %asi stxa \ 16
68 %i5 %o6 V9_SP_BIAS d# 13 na+ %asi stxa \ 17
69 %i6 %o6 V9_SP_BIAS d# 14 na+ %asi stxa \ 18
70 %i7 %o6 V9_SP_BIAS d# 15 na+ %asi stxa \ 19
71 else nop \ 20,21
72 %o6 0 %o6 srl \ 22
73 %l0 %o6 0 /n* %asi stda \ 23
74 %l2 %o6 1 /n* %asi stda \ 24
75 %l4 %o6 2 /n* %asi stda \ 25
76 %l6 %o6 3 /n* %asi stda \ 26
77 %i0 %o6 4 /n* %asi stda \ 27
78 %i2 %o6 5 /n* %asi stda \ 28
79 %i4 %o6 6 /n* %asi stda \ 29
80 %i6 %o6 7 /n* %asi stda \ 30
81 then
82 saved \ 31
83 retry \ 32
84;
85
86: window-fill ( -- )
87 %o6 1 %g0 andcc \ 1
88 0<> if %g0 h# 80 wrasi \ 2,3
89 %o6 V9_SP_BIAS d# 0 na+ %asi %l0 ldxa \ 4
90 %o6 V9_SP_BIAS d# 1 na+ %asi %l1 ldxa \ 5
91 %o6 V9_SP_BIAS d# 2 na+ %asi %l2 ldxa \ 6
92 %o6 V9_SP_BIAS d# 3 na+ %asi %l3 ldxa \ 7
93 %o6 V9_SP_BIAS d# 4 na+ %asi %l4 ldxa \ 8
94 %o6 V9_SP_BIAS d# 5 na+ %asi %l5 ldxa \ 9
95 %o6 V9_SP_BIAS d# 6 na+ %asi %l6 ldxa \ 10
96 %o6 V9_SP_BIAS d# 7 na+ %asi %l7 ldxa \ 11
97 %o6 V9_SP_BIAS d# 8 na+ %asi %i0 ldxa \ 12
98 %o6 V9_SP_BIAS d# 9 na+ %asi %i1 ldxa \ 13
99 %o6 V9_SP_BIAS d# 10 na+ %asi %i2 ldxa \ 14
100 %o6 V9_SP_BIAS d# 11 na+ %asi %i3 ldxa \ 15
101 %o6 V9_SP_BIAS d# 12 na+ %asi %i4 ldxa \ 16
102 %o6 V9_SP_BIAS d# 13 na+ %asi %i5 ldxa \ 17
103 %o6 V9_SP_BIAS d# 14 na+ %asi %i6 ldxa \ 18
104 %o6 V9_SP_BIAS d# 15 na+ %asi %i7 ldxa \ 19
105 else nop \ 20,21
106 %o6 0 %o6 srl \ 22
107 %o6 0 /n* %asi %l0 ldda \ 23
108 %o6 1 /n* %asi %l2 ldda \ 24
109 %o6 2 /n* %asi %l4 ldda \ 25
110 %o6 3 /n* %asi %l6 ldda \ 26
111 %o6 4 /n* %asi %i0 ldda \ 27
112 %o6 5 /n* %asi %i2 ldda \ 28
113 %o6 6 /n* %asi %i4 ldda \ 29
114 %o6 7 /n* %asi %i6 ldda \ 30
115 then
116 restored \ 31
117 retry \ 32
118;
119
120: level-interrupt ( -- )
121 save-state always brif nop
122;
123
124: set-RED-vector ( vector# vadr -- )
125 over begin-trap ( vector# offset )
126 here - 2 >> h# 3080.0000 + l,
127 nop nop
128 ( vector# )
129 dup dup 1+ end-trap 2drop
130;
131
132previous definitions
133
134assembler alias set-vector set-vector forth
135
136resident
137
138\ Set all Trap Types to save-state
139\ Selected Trap Types will be replaced later
140h# 400 2 do i save-state set-vector loop
141
142\ 001 Power On Reset
143\ 002 Watchdog Reset
144\ 003 XIR
145\ 004 SIR
146\ 005 RED
147\ 006 Reserved
148h# 007 begin-trap
149( 01 ) nop
150( 02 ) nop
151( 03 ) nop
152( 04 ) nop
153( 05 ) nop
154( 06 ) nop \ prom-cold-code always brif
155( 07 ) nop
156( 08 ) nop
157h# 008 end-trap
158\ 006 .. 007 *** Reserved
159\ 008 Instruction Access Exception
160\ 009 Instruction Access MMU Miss *** Unused in Sun4u
161\ 00a Instruction Access Error
162\ 00b .. 00f *** Reserved
163\ 010 Illegal Instruction
164\ 011 Privileged Opcode
165\ 012 Unimplemented LDD
166\ 013 Unimplemented STD
167\ 014 .. 01f *** Reserved
168\ 020 FP Disabled
169\ 021 FP Exception IEEE 754
170\ 022 FP Exception Other
171\ 023 Tag Overflow
172h# 024 begin-trap \ Clean Window
173 %l0 rdcleanwin
174 %l0 1 %l0 add
175 %l0 0 wrcleanwin
176 %g0 0 %l0 or
177 %g0 0 %l1 or
178 %g0 0 %l2 or
179 %g0 0 %l3 or
180 %g0 0 %l4 or
181 %g0 0 %l5 or
182 %g0 0 %l6 or
183 %g0 0 %l7 or
184 %g0 0 %o0 or
185 %g0 0 %o1 or
186 %g0 0 %o2 or
187 %g0 0 %o3 or
188 %g0 0 %o4 or
189 %g0 0 %o5 or
190 %g0 0 %o6 or
191 %g0 0 %o7 or
192 retry
193 align80
194h# 028 end-trap \ Clean Window
195\ 028 Division by Zero
196\ 029 Internal Processor Error
197\ 030 Data Access Exception
198\ 031 Data Access MMU Miss *** Unused in Sun4u
199\ 032 Data Access Error
200\ 033 Data Access Protection *** Unused in Sun4u
201\ 034 Memory Address not Aligned
202\ 035 LDDF Memory Address not Aligned
203\ 036 STDF Memory Address not Aligned
204\ 037 Privileged Action
205\ 038 LDQF Memory Address not Aligned
206\ 039 STQF Memory Address not Aligned
207\ 03a .. 03f *** Reserved
208\ 040 Async Data Error
209h# 041 begin-trap level-interrupt h# 042 end-trap \ Interrupt Level 1
210h# 042 begin-trap level-interrupt h# 043 end-trap \ Interrupt Level 2
211h# 043 begin-trap level-interrupt h# 044 end-trap \ Interrupt Level 3
212h# 044 begin-trap level-interrupt h# 045 end-trap \ Interrupt Level 4
213h# 045 begin-trap level-interrupt h# 046 end-trap \ Interrupt Level 5
214h# 046 begin-trap level-interrupt h# 047 end-trap \ Interrupt Level 6
215h# 047 begin-trap level-interrupt h# 048 end-trap \ Interrupt Level 7
216h# 048 begin-trap level-interrupt h# 049 end-trap \ Interrupt Level 8
217h# 049 begin-trap level-interrupt h# 04a end-trap \ Interrupt Level 9
218h# 04a begin-trap level-interrupt h# 04b end-trap \ Interrupt Level 10
219h# 04b begin-trap level-interrupt h# 04c end-trap \ Interrupt Level 11
220h# 04c begin-trap level-interrupt h# 04d end-trap \ Interrupt Level 12
221h# 04d begin-trap level-interrupt h# 04e end-trap \ Interrupt Level 13
222h# 04e begin-trap level-interrupt h# 04f end-trap \ Interrupt Level 14
223h# 04f begin-trap level-interrupt h# 050 end-trap \ Interrupt Level 15
224\ 050 .. 05f *** Reserved 512 Bytes
225\ 060 Vector Interrupt *** Sun4u
226\ 061 PA Watchpoint *** Sun4u
227\ 062 VA Watchpoint *** Sun4u
228\ 063 Corrected ECC Error *** Sun4u
229\ 064 .. 067 Instruction Access MMU Miss *** Sun4u
230\ 068 .. 06b Data Access MMU Miss *** Sun4u
231\ 06c .. 06f Data Access Protection *** Sun4u
232\ 070 .. 07f Fast ECC Error *** Sun4u ( US-III )
233h# 080 begin-trap window-spill h# 084 end-trap \ Spill 0 Normal
234h# 084 begin-trap window-spill h# 088 end-trap \ Spill 1 Normal
235h# 088 begin-trap window-spill h# 08c end-trap \ Spill 2 Normal
236h# 08c begin-trap window-spill h# 090 end-trap \ Spill 3 Normal
237h# 090 begin-trap window-spill h# 094 end-trap \ Spill 4 Normal
238h# 094 begin-trap window-spill h# 098 end-trap \ Spill 5 Normal
239h# 098 begin-trap window-spill h# 09c end-trap \ Spill 6 Normal
240h# 09c begin-trap window-spill h# 0a0 end-trap \ Spill 7 Normal
241h# 0a0 begin-trap window-spill h# 0a4 end-trap \ Spill 0 Other
242h# 0a4 begin-trap window-spill h# 0a8 end-trap \ Spill 1 Other
243h# 0a8 begin-trap window-spill h# 0ac end-trap \ Spill 2 Other
244h# 0ac begin-trap window-spill h# 0b0 end-trap \ Spill 3 Other
245h# 0b0 begin-trap window-spill h# 0b4 end-trap \ Spill 4 Other
246h# 0b4 begin-trap window-spill h# 0b8 end-trap \ Spill 5 Other
247h# 0b8 begin-trap window-spill h# 0bc end-trap \ Spill 6 Other
248h# 0bc begin-trap window-spill h# 0c0 end-trap \ Spill 7 Other
249h# 0c0 begin-trap window-fill h# 0c4 end-trap \ Fill 0 Normal
250h# 0c4 begin-trap window-fill h# 0c8 end-trap \ Fill 1 Normal
251h# 0c8 begin-trap window-fill h# 0cc end-trap \ Fill 2 Normal
252h# 0cc begin-trap window-fill h# 0d0 end-trap \ Fill 3 Normal
253h# 0d0 begin-trap window-fill h# 0d4 end-trap \ Fill 4 Normal
254h# 0d4 begin-trap window-fill h# 0d8 end-trap \ Fill 5 Normal
255h# 0d8 begin-trap window-fill h# 0dc end-trap \ Fill 6 Normal
256h# 0dc begin-trap window-fill h# 0e0 end-trap \ Fill 7 Normal
257h# 0e0 begin-trap window-fill h# 0e4 end-trap \ Fill 0 Other
258h# 0e4 begin-trap window-fill h# 0e8 end-trap \ Fill 1 Other
259h# 0e8 begin-trap window-fill h# 0ec end-trap \ Fill 2 Other
260h# 0ec begin-trap window-fill h# 0f0 end-trap \ Fill 3 Other
261h# 0f0 begin-trap window-fill h# 0f4 end-trap \ Fill 4 Other
262h# 0f4 begin-trap window-fill h# 0f8 end-trap \ Fill 5 Other
263h# 0f8 begin-trap window-fill h# 0fc end-trap \ Fill 6 Other
264h# 0fc begin-trap window-fill h# 100 end-trap \ Fill 7 h# Other
265\ 100 .. 17f Trap Instruction
266h# 170 begin-trap
267( 00 ) done
268( 01 ) nop
269( 02 ) nop
270( 03 ) nop
271h# 171 end-trap
272\ 180 .. 1ff *** Reserved 4 K
273\ 200 .. 201 *** Unused ( V8 Reset )
274\ 201 .. 209 *** Unused
275\ 20a Instruction Access Error
276\ 20b .. 231 Unused 1 K
277\ 232 Data Access Error
278\ 233 .. 260 Unused 1 K
279\ 260 Vector Interrupt *** Sun4u
280\ 261 PA Watchpoint *** Sun4u
281\ 262 VA Watchpoint *** Sun4u
282\ 263 Corrected ECC Error *** Sun4u
283\ 264 .. 267 Instruction Access MMU Miss *** Sun4u
284h# 264 begin-trap
285( 01 ) immu-miss-trap always brif annul
286( 02 ) nop
287( 03 ) nop
288( 04 ) nop
289( 05 ) nop
290( 06 ) nop
291( 07 ) nop
292( 08 ) nop
293h# 268 end-trap
294\ 26c .. 26f Data Access Protection *** Sun4u
295\ 070 .. 07f Fast ECC Error *** Sun4u ( US-III )
296\ 280 .. 2bf Unused ( Window Spill ) 2 K
297\ 2c0 .. 2ff Unused ( Window Fill ) 2 K
298\ 300 .. 3ff Unused ( Trap Instruction ) 8 K
299
300headers
301
302[ifdef] SUN4V
303h# 009 immu-miss-trap set-vector
304h# 031 dmmu-miss-trap set-vector
305[then]
306
307h# 064 immu-miss-trap set-vector
308
309[ifdef] SUN4V
310h# 068 dmmu-miss-trap set-vector
311h# 268 dmmu-miss-trap set-vector
312[else]
313h# 068 dmmu-miss-trap-TL=1 set-vector
314h# 268 dmmu-miss-trap-TL>1 set-vector
315[then]