GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / sparc / include / asm / ttable.h
blob53aa0cf941daf68f5e0fcacf939f5b1c9f70bd33
1 #ifndef _SPARC64_TTABLE_H
2 #define _SPARC64_TTABLE_H
4 #include <asm/utrap.h>
5 #include <asm/pil.h>
7 #ifdef __ASSEMBLY__
8 #include <asm/thread_info.h>
9 #endif
11 #define BOOT_KERNEL b sparc64_boot; nop; nop; nop; nop; nop; nop; nop;
13 /* We need a "cleaned" instruction... */
14 #define CLEAN_WINDOW \
15 rdpr %cleanwin, %l0; add %l0, 1, %l0; \
16 wrpr %l0, 0x0, %cleanwin; \
17 clr %o0; clr %o1; clr %o2; clr %o3; \
18 clr %o4; clr %o5; clr %o6; clr %o7; \
19 clr %l0; clr %l1; clr %l2; clr %l3; \
20 clr %l4; clr %l5; clr %l6; clr %l7; \
21 retry; \
22 nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
24 #define TRAP(routine) \
25 sethi %hi(109f), %g7; \
26 ba,pt %xcc, etrap; \
27 109: or %g7, %lo(109b), %g7; \
28 call routine; \
29 add %sp, PTREGS_OFF, %o0; \
30 ba,pt %xcc, rtrap; \
31 nop; \
32 nop;
34 #define TRAP_7INSNS(routine) \
35 sethi %hi(109f), %g7; \
36 ba,pt %xcc, etrap; \
37 109: or %g7, %lo(109b), %g7; \
38 call routine; \
39 add %sp, PTREGS_OFF, %o0; \
40 ba,pt %xcc, rtrap; \
41 nop;
43 #define TRAP_SAVEFPU(routine) \
44 sethi %hi(109f), %g7; \
45 ba,pt %xcc, do_fptrap; \
46 109: or %g7, %lo(109b), %g7; \
47 call routine; \
48 add %sp, PTREGS_OFF, %o0; \
49 ba,pt %xcc, rtrap; \
50 nop; \
51 nop;
53 #define TRAP_NOSAVE(routine) \
54 ba,pt %xcc, routine; \
55 nop; \
56 nop; nop; nop; nop; nop; nop;
58 #define TRAP_NOSAVE_7INSNS(routine) \
59 ba,pt %xcc, routine; \
60 nop; \
61 nop; nop; nop; nop; nop;
63 #define TRAPTL1(routine) \
64 sethi %hi(109f), %g7; \
65 ba,pt %xcc, etraptl1; \
66 109: or %g7, %lo(109b), %g7; \
67 call routine; \
68 add %sp, PTREGS_OFF, %o0; \
69 ba,pt %xcc, rtrap; \
70 nop; \
71 nop;
73 #define TRAP_ARG(routine, arg) \
74 sethi %hi(109f), %g7; \
75 ba,pt %xcc, etrap; \
76 109: or %g7, %lo(109b), %g7; \
77 add %sp, PTREGS_OFF, %o0; \
78 call routine; \
79 mov arg, %o1; \
80 ba,pt %xcc, rtrap; \
81 nop;
83 #define TRAPTL1_ARG(routine, arg) \
84 sethi %hi(109f), %g7; \
85 ba,pt %xcc, etraptl1; \
86 109: or %g7, %lo(109b), %g7; \
87 add %sp, PTREGS_OFF, %o0; \
88 call routine; \
89 mov arg, %o1; \
90 ba,pt %xcc, rtrap; \
91 nop;
93 #define SYSCALL_TRAP(routine, systbl) \
94 rdpr %pil, %g2; \
95 mov TSTATE_SYSCALL, %g3; \
96 sethi %hi(109f), %g7; \
97 ba,pt %xcc, etrap_syscall; \
98 109: or %g7, %lo(109b), %g7; \
99 sethi %hi(systbl), %l7; \
100 ba,pt %xcc, routine; \
101 or %l7, %lo(systbl), %l7;
103 #define TRAP_UTRAP(handler,lvl) \
104 mov handler, %g3; \
105 ba,pt %xcc, utrap_trap; \
106 mov lvl, %g4; \
107 nop; \
108 nop; \
109 nop; \
110 nop; \
111 nop;
113 #ifdef CONFIG_COMPAT
114 #define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
115 #else
116 #define LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
117 #endif
118 #define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
119 #define GETCC_TRAP TRAP(getcc)
120 #define SETCC_TRAP TRAP(setcc)
121 #define BREAKPOINT_TRAP TRAP(breakpoint_trap)
123 #ifdef CONFIG_TRACE_IRQFLAGS
125 #define TRAP_IRQ(routine, level) \
126 rdpr %pil, %g2; \
127 wrpr %g0, PIL_NORMAL_MAX, %pil; \
128 sethi %hi(1f-4), %g7; \
129 ba,pt %xcc, etrap_irq; \
130 or %g7, %lo(1f-4), %g7; \
131 nop; \
132 nop; \
133 nop; \
134 .subsection 2; \
135 1: call trace_hardirqs_off; \
136 nop; \
137 mov level, %o0; \
138 call routine; \
139 add %sp, PTREGS_OFF, %o1; \
140 ba,a,pt %xcc, rtrap_irq; \
141 .previous;
143 #else
145 #define TRAP_IRQ(routine, level) \
146 rdpr %pil, %g2; \
147 wrpr %g0, PIL_NORMAL_MAX, %pil; \
148 ba,pt %xcc, etrap_irq; \
149 rd %pc, %g7; \
150 mov level, %o0; \
151 call routine; \
152 add %sp, PTREGS_OFF, %o1; \
153 ba,a,pt %xcc, rtrap_irq;
155 #endif
157 #define TRAP_NMI_IRQ(routine, level) \
158 rdpr %pil, %g2; \
159 wrpr %g0, PIL_NMI, %pil; \
160 ba,pt %xcc, etrap_irq; \
161 rd %pc, %g7; \
162 mov level, %o0; \
163 call routine; \
164 add %sp, PTREGS_OFF, %o1; \
165 ba,a,pt %xcc, rtrap_nmi;
167 #define TRAP_IVEC TRAP_NOSAVE(do_ivec)
169 #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl)
171 #define BTRAPTL1(lvl) TRAPTL1_ARG(bad_trap_tl1, lvl)
173 #define FLUSH_WINDOW_TRAP \
174 ba,pt %xcc, etrap; \
175 rd %pc, %g7; \
176 flushw; \
177 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1; \
178 add %l1, 4, %l2; \
179 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]; \
180 ba,pt %xcc, rtrap; \
181 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC];
183 #ifdef CONFIG_KPROBES
184 #define KPROBES_TRAP(lvl) TRAP_IRQ(kprobe_trap, lvl)
185 #else
186 #define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
187 #endif
189 #ifdef CONFIG_KGDB
190 #define KGDB_TRAP(lvl) TRAP_IRQ(kgdb_trap, lvl)
191 #else
192 #define KGDB_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
193 #endif
195 #define SUN4V_ITSB_MISS \
196 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
197 ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4; \
198 ldx [%g2 + HV_FAULT_I_CTX_OFFSET], %g5; \
199 srlx %g4, 22, %g6; \
200 ba,pt %xcc, sun4v_itsb_miss; \
201 nop; \
202 nop; \
203 nop;
205 #define SUN4V_DTSB_MISS \
206 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
207 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4; \
208 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5; \
209 srlx %g4, 22, %g6; \
210 ba,pt %xcc, sun4v_dtsb_miss; \
211 nop; \
212 nop; \
213 nop;
216 /* Normal kernel spill */
217 #define SPILL_0_NORMAL \
218 stx %l0, [%sp + STACK_BIAS + 0x00]; \
219 stx %l1, [%sp + STACK_BIAS + 0x08]; \
220 stx %l2, [%sp + STACK_BIAS + 0x10]; \
221 stx %l3, [%sp + STACK_BIAS + 0x18]; \
222 stx %l4, [%sp + STACK_BIAS + 0x20]; \
223 stx %l5, [%sp + STACK_BIAS + 0x28]; \
224 stx %l6, [%sp + STACK_BIAS + 0x30]; \
225 stx %l7, [%sp + STACK_BIAS + 0x38]; \
226 stx %i0, [%sp + STACK_BIAS + 0x40]; \
227 stx %i1, [%sp + STACK_BIAS + 0x48]; \
228 stx %i2, [%sp + STACK_BIAS + 0x50]; \
229 stx %i3, [%sp + STACK_BIAS + 0x58]; \
230 stx %i4, [%sp + STACK_BIAS + 0x60]; \
231 stx %i5, [%sp + STACK_BIAS + 0x68]; \
232 stx %i6, [%sp + STACK_BIAS + 0x70]; \
233 stx %i7, [%sp + STACK_BIAS + 0x78]; \
234 saved; retry; nop; nop; nop; nop; nop; nop; \
235 nop; nop; nop; nop; nop; nop; nop; nop;
237 #define SPILL_0_NORMAL_ETRAP \
238 etrap_kernel_spill: \
239 stx %l0, [%sp + STACK_BIAS + 0x00]; \
240 stx %l1, [%sp + STACK_BIAS + 0x08]; \
241 stx %l2, [%sp + STACK_BIAS + 0x10]; \
242 stx %l3, [%sp + STACK_BIAS + 0x18]; \
243 stx %l4, [%sp + STACK_BIAS + 0x20]; \
244 stx %l5, [%sp + STACK_BIAS + 0x28]; \
245 stx %l6, [%sp + STACK_BIAS + 0x30]; \
246 stx %l7, [%sp + STACK_BIAS + 0x38]; \
247 stx %i0, [%sp + STACK_BIAS + 0x40]; \
248 stx %i1, [%sp + STACK_BIAS + 0x48]; \
249 stx %i2, [%sp + STACK_BIAS + 0x50]; \
250 stx %i3, [%sp + STACK_BIAS + 0x58]; \
251 stx %i4, [%sp + STACK_BIAS + 0x60]; \
252 stx %i5, [%sp + STACK_BIAS + 0x68]; \
253 stx %i6, [%sp + STACK_BIAS + 0x70]; \
254 stx %i7, [%sp + STACK_BIAS + 0x78]; \
255 saved; \
256 sub %g1, 2, %g1; \
257 ba,pt %xcc, etrap_save; \
258 wrpr %g1, %cwp; \
259 nop; nop; nop; nop; nop; nop; nop; nop; \
260 nop; nop; nop; nop;
262 /* Normal 64bit spill */
263 #define SPILL_1_GENERIC(ASI) \
264 add %sp, STACK_BIAS + 0x00, %g1; \
265 stxa %l0, [%g1 + %g0] ASI; \
266 mov 0x08, %g3; \
267 stxa %l1, [%g1 + %g3] ASI; \
268 add %g1, 0x10, %g1; \
269 stxa %l2, [%g1 + %g0] ASI; \
270 stxa %l3, [%g1 + %g3] ASI; \
271 add %g1, 0x10, %g1; \
272 stxa %l4, [%g1 + %g0] ASI; \
273 stxa %l5, [%g1 + %g3] ASI; \
274 add %g1, 0x10, %g1; \
275 stxa %l6, [%g1 + %g0] ASI; \
276 stxa %l7, [%g1 + %g3] ASI; \
277 add %g1, 0x10, %g1; \
278 stxa %i0, [%g1 + %g0] ASI; \
279 stxa %i1, [%g1 + %g3] ASI; \
280 add %g1, 0x10, %g1; \
281 stxa %i2, [%g1 + %g0] ASI; \
282 stxa %i3, [%g1 + %g3] ASI; \
283 add %g1, 0x10, %g1; \
284 stxa %i4, [%g1 + %g0] ASI; \
285 stxa %i5, [%g1 + %g3] ASI; \
286 add %g1, 0x10, %g1; \
287 stxa %i6, [%g1 + %g0] ASI; \
288 stxa %i7, [%g1 + %g3] ASI; \
289 saved; \
290 retry; nop; nop; \
291 b,a,pt %xcc, spill_fixup_dax; \
292 b,a,pt %xcc, spill_fixup_mna; \
293 b,a,pt %xcc, spill_fixup;
295 #define SPILL_1_GENERIC_ETRAP \
296 etrap_user_spill_64bit: \
297 stxa %l0, [%sp + STACK_BIAS + 0x00] %asi; \
298 stxa %l1, [%sp + STACK_BIAS + 0x08] %asi; \
299 stxa %l2, [%sp + STACK_BIAS + 0x10] %asi; \
300 stxa %l3, [%sp + STACK_BIAS + 0x18] %asi; \
301 stxa %l4, [%sp + STACK_BIAS + 0x20] %asi; \
302 stxa %l5, [%sp + STACK_BIAS + 0x28] %asi; \
303 stxa %l6, [%sp + STACK_BIAS + 0x30] %asi; \
304 stxa %l7, [%sp + STACK_BIAS + 0x38] %asi; \
305 stxa %i0, [%sp + STACK_BIAS + 0x40] %asi; \
306 stxa %i1, [%sp + STACK_BIAS + 0x48] %asi; \
307 stxa %i2, [%sp + STACK_BIAS + 0x50] %asi; \
308 stxa %i3, [%sp + STACK_BIAS + 0x58] %asi; \
309 stxa %i4, [%sp + STACK_BIAS + 0x60] %asi; \
310 stxa %i5, [%sp + STACK_BIAS + 0x68] %asi; \
311 stxa %i6, [%sp + STACK_BIAS + 0x70] %asi; \
312 stxa %i7, [%sp + STACK_BIAS + 0x78] %asi; \
313 saved; \
314 sub %g1, 2, %g1; \
315 ba,pt %xcc, etrap_save; \
316 wrpr %g1, %cwp; \
317 nop; nop; nop; nop; nop; \
318 nop; nop; nop; nop; \
319 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
320 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
321 ba,a,pt %xcc, etrap_spill_fixup_64bit;
323 #define SPILL_1_GENERIC_ETRAP_FIXUP \
324 etrap_spill_fixup_64bit: \
325 ldub [%g6 + TI_WSAVED], %g1; \
326 sll %g1, 3, %g3; \
327 add %g6, %g3, %g3; \
328 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
329 sll %g1, 7, %g3; \
330 add %g6, %g3, %g3; \
331 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
332 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]; \
333 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]; \
334 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]; \
335 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]; \
336 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]; \
337 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]; \
338 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]; \
339 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]; \
340 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]; \
341 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]; \
342 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]; \
343 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]; \
344 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]; \
345 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]; \
346 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]; \
347 add %g1, 1, %g1; \
348 stb %g1, [%g6 + TI_WSAVED]; \
349 saved; \
350 rdpr %cwp, %g1; \
351 sub %g1, 2, %g1; \
352 ba,pt %xcc, etrap_save; \
353 wrpr %g1, %cwp; \
354 nop; nop; nop
356 /* Normal 32bit spill */
357 #define SPILL_2_GENERIC(ASI) \
358 srl %sp, 0, %sp; \
359 stwa %l0, [%sp + %g0] ASI; \
360 mov 0x04, %g3; \
361 stwa %l1, [%sp + %g3] ASI; \
362 add %sp, 0x08, %g1; \
363 stwa %l2, [%g1 + %g0] ASI; \
364 stwa %l3, [%g1 + %g3] ASI; \
365 add %g1, 0x08, %g1; \
366 stwa %l4, [%g1 + %g0] ASI; \
367 stwa %l5, [%g1 + %g3] ASI; \
368 add %g1, 0x08, %g1; \
369 stwa %l6, [%g1 + %g0] ASI; \
370 stwa %l7, [%g1 + %g3] ASI; \
371 add %g1, 0x08, %g1; \
372 stwa %i0, [%g1 + %g0] ASI; \
373 stwa %i1, [%g1 + %g3] ASI; \
374 add %g1, 0x08, %g1; \
375 stwa %i2, [%g1 + %g0] ASI; \
376 stwa %i3, [%g1 + %g3] ASI; \
377 add %g1, 0x08, %g1; \
378 stwa %i4, [%g1 + %g0] ASI; \
379 stwa %i5, [%g1 + %g3] ASI; \
380 add %g1, 0x08, %g1; \
381 stwa %i6, [%g1 + %g0] ASI; \
382 stwa %i7, [%g1 + %g3] ASI; \
383 saved; \
384 retry; nop; nop; \
385 b,a,pt %xcc, spill_fixup_dax; \
386 b,a,pt %xcc, spill_fixup_mna; \
387 b,a,pt %xcc, spill_fixup;
389 #define SPILL_2_GENERIC_ETRAP \
390 etrap_user_spill_32bit: \
391 srl %sp, 0, %sp; \
392 stwa %l0, [%sp + 0x00] %asi; \
393 stwa %l1, [%sp + 0x04] %asi; \
394 stwa %l2, [%sp + 0x08] %asi; \
395 stwa %l3, [%sp + 0x0c] %asi; \
396 stwa %l4, [%sp + 0x10] %asi; \
397 stwa %l5, [%sp + 0x14] %asi; \
398 stwa %l6, [%sp + 0x18] %asi; \
399 stwa %l7, [%sp + 0x1c] %asi; \
400 stwa %i0, [%sp + 0x20] %asi; \
401 stwa %i1, [%sp + 0x24] %asi; \
402 stwa %i2, [%sp + 0x28] %asi; \
403 stwa %i3, [%sp + 0x2c] %asi; \
404 stwa %i4, [%sp + 0x30] %asi; \
405 stwa %i5, [%sp + 0x34] %asi; \
406 stwa %i6, [%sp + 0x38] %asi; \
407 stwa %i7, [%sp + 0x3c] %asi; \
408 saved; \
409 sub %g1, 2, %g1; \
410 ba,pt %xcc, etrap_save; \
411 wrpr %g1, %cwp; \
412 nop; nop; nop; nop; \
413 nop; nop; nop; nop; \
414 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
415 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
416 ba,a,pt %xcc, etrap_spill_fixup_32bit;
418 #define SPILL_2_GENERIC_ETRAP_FIXUP \
419 etrap_spill_fixup_32bit: \
420 ldub [%g6 + TI_WSAVED], %g1; \
421 sll %g1, 3, %g3; \
422 add %g6, %g3, %g3; \
423 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
424 sll %g1, 7, %g3; \
425 add %g6, %g3, %g3; \
426 stw %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
427 stw %l1, [%g3 + TI_REG_WINDOW + 0x04]; \
428 stw %l2, [%g3 + TI_REG_WINDOW + 0x08]; \
429 stw %l3, [%g3 + TI_REG_WINDOW + 0x0c]; \
430 stw %l4, [%g3 + TI_REG_WINDOW + 0x10]; \
431 stw %l5, [%g3 + TI_REG_WINDOW + 0x14]; \
432 stw %l6, [%g3 + TI_REG_WINDOW + 0x18]; \
433 stw %l7, [%g3 + TI_REG_WINDOW + 0x1c]; \
434 stw %i0, [%g3 + TI_REG_WINDOW + 0x20]; \
435 stw %i1, [%g3 + TI_REG_WINDOW + 0x24]; \
436 stw %i2, [%g3 + TI_REG_WINDOW + 0x28]; \
437 stw %i3, [%g3 + TI_REG_WINDOW + 0x2c]; \
438 stw %i4, [%g3 + TI_REG_WINDOW + 0x30]; \
439 stw %i5, [%g3 + TI_REG_WINDOW + 0x34]; \
440 stw %i6, [%g3 + TI_REG_WINDOW + 0x38]; \
441 stw %i7, [%g3 + TI_REG_WINDOW + 0x3c]; \
442 add %g1, 1, %g1; \
443 stb %g1, [%g6 + TI_WSAVED]; \
444 saved; \
445 rdpr %cwp, %g1; \
446 sub %g1, 2, %g1; \
447 ba,pt %xcc, etrap_save; \
448 wrpr %g1, %cwp; \
449 nop; nop; nop
451 #define SPILL_1_NORMAL SPILL_1_GENERIC(ASI_AIUP)
452 #define SPILL_2_NORMAL SPILL_2_GENERIC(ASI_AIUP)
453 #define SPILL_3_NORMAL SPILL_0_NORMAL
454 #define SPILL_4_NORMAL SPILL_0_NORMAL
455 #define SPILL_5_NORMAL SPILL_0_NORMAL
456 #define SPILL_6_NORMAL SPILL_0_NORMAL
457 #define SPILL_7_NORMAL SPILL_0_NORMAL
459 #define SPILL_0_OTHER SPILL_0_NORMAL
460 #define SPILL_1_OTHER SPILL_1_GENERIC(ASI_AIUS)
461 #define SPILL_2_OTHER SPILL_2_GENERIC(ASI_AIUS)
462 #define SPILL_3_OTHER SPILL_3_NORMAL
463 #define SPILL_4_OTHER SPILL_4_NORMAL
464 #define SPILL_5_OTHER SPILL_5_NORMAL
465 #define SPILL_6_OTHER SPILL_6_NORMAL
466 #define SPILL_7_OTHER SPILL_7_NORMAL
468 /* Normal kernel fill */
469 #define FILL_0_NORMAL \
470 ldx [%sp + STACK_BIAS + 0x00], %l0; \
471 ldx [%sp + STACK_BIAS + 0x08], %l1; \
472 ldx [%sp + STACK_BIAS + 0x10], %l2; \
473 ldx [%sp + STACK_BIAS + 0x18], %l3; \
474 ldx [%sp + STACK_BIAS + 0x20], %l4; \
475 ldx [%sp + STACK_BIAS + 0x28], %l5; \
476 ldx [%sp + STACK_BIAS + 0x30], %l6; \
477 ldx [%sp + STACK_BIAS + 0x38], %l7; \
478 ldx [%sp + STACK_BIAS + 0x40], %i0; \
479 ldx [%sp + STACK_BIAS + 0x48], %i1; \
480 ldx [%sp + STACK_BIAS + 0x50], %i2; \
481 ldx [%sp + STACK_BIAS + 0x58], %i3; \
482 ldx [%sp + STACK_BIAS + 0x60], %i4; \
483 ldx [%sp + STACK_BIAS + 0x68], %i5; \
484 ldx [%sp + STACK_BIAS + 0x70], %i6; \
485 ldx [%sp + STACK_BIAS + 0x78], %i7; \
486 restored; retry; nop; nop; nop; nop; nop; nop; \
487 nop; nop; nop; nop; nop; nop; nop; nop;
489 #define FILL_0_NORMAL_RTRAP \
490 kern_rtt_fill: \
491 rdpr %cwp, %g1; \
492 sub %g1, 1, %g1; \
493 wrpr %g1, %cwp; \
494 ldx [%sp + STACK_BIAS + 0x00], %l0; \
495 ldx [%sp + STACK_BIAS + 0x08], %l1; \
496 ldx [%sp + STACK_BIAS + 0x10], %l2; \
497 ldx [%sp + STACK_BIAS + 0x18], %l3; \
498 ldx [%sp + STACK_BIAS + 0x20], %l4; \
499 ldx [%sp + STACK_BIAS + 0x28], %l5; \
500 ldx [%sp + STACK_BIAS + 0x30], %l6; \
501 ldx [%sp + STACK_BIAS + 0x38], %l7; \
502 ldx [%sp + STACK_BIAS + 0x40], %i0; \
503 ldx [%sp + STACK_BIAS + 0x48], %i1; \
504 ldx [%sp + STACK_BIAS + 0x50], %i2; \
505 ldx [%sp + STACK_BIAS + 0x58], %i3; \
506 ldx [%sp + STACK_BIAS + 0x60], %i4; \
507 ldx [%sp + STACK_BIAS + 0x68], %i5; \
508 ldx [%sp + STACK_BIAS + 0x70], %i6; \
509 ldx [%sp + STACK_BIAS + 0x78], %i7; \
510 restored; \
511 add %g1, 1, %g1; \
512 ba,pt %xcc, kern_rtt_restore; \
513 wrpr %g1, %cwp; \
514 nop; nop; nop; nop; nop; \
515 nop; nop; nop; nop;
518 /* Normal 64bit fill */
519 #define FILL_1_GENERIC(ASI) \
520 add %sp, STACK_BIAS + 0x00, %g1; \
521 ldxa [%g1 + %g0] ASI, %l0; \
522 mov 0x08, %g2; \
523 mov 0x10, %g3; \
524 ldxa [%g1 + %g2] ASI, %l1; \
525 mov 0x18, %g5; \
526 ldxa [%g1 + %g3] ASI, %l2; \
527 ldxa [%g1 + %g5] ASI, %l3; \
528 add %g1, 0x20, %g1; \
529 ldxa [%g1 + %g0] ASI, %l4; \
530 ldxa [%g1 + %g2] ASI, %l5; \
531 ldxa [%g1 + %g3] ASI, %l6; \
532 ldxa [%g1 + %g5] ASI, %l7; \
533 add %g1, 0x20, %g1; \
534 ldxa [%g1 + %g0] ASI, %i0; \
535 ldxa [%g1 + %g2] ASI, %i1; \
536 ldxa [%g1 + %g3] ASI, %i2; \
537 ldxa [%g1 + %g5] ASI, %i3; \
538 add %g1, 0x20, %g1; \
539 ldxa [%g1 + %g0] ASI, %i4; \
540 ldxa [%g1 + %g2] ASI, %i5; \
541 ldxa [%g1 + %g3] ASI, %i6; \
542 ldxa [%g1 + %g5] ASI, %i7; \
543 restored; \
544 retry; nop; nop; nop; nop; \
545 b,a,pt %xcc, fill_fixup_dax; \
546 b,a,pt %xcc, fill_fixup_mna; \
547 b,a,pt %xcc, fill_fixup;
549 #define FILL_1_GENERIC_RTRAP \
550 user_rtt_fill_64bit: \
551 ldxa [%sp + STACK_BIAS + 0x00] %asi, %l0; \
552 ldxa [%sp + STACK_BIAS + 0x08] %asi, %l1; \
553 ldxa [%sp + STACK_BIAS + 0x10] %asi, %l2; \
554 ldxa [%sp + STACK_BIAS + 0x18] %asi, %l3; \
555 ldxa [%sp + STACK_BIAS + 0x20] %asi, %l4; \
556 ldxa [%sp + STACK_BIAS + 0x28] %asi, %l5; \
557 ldxa [%sp + STACK_BIAS + 0x30] %asi, %l6; \
558 ldxa [%sp + STACK_BIAS + 0x38] %asi, %l7; \
559 ldxa [%sp + STACK_BIAS + 0x40] %asi, %i0; \
560 ldxa [%sp + STACK_BIAS + 0x48] %asi, %i1; \
561 ldxa [%sp + STACK_BIAS + 0x50] %asi, %i2; \
562 ldxa [%sp + STACK_BIAS + 0x58] %asi, %i3; \
563 ldxa [%sp + STACK_BIAS + 0x60] %asi, %i4; \
564 ldxa [%sp + STACK_BIAS + 0x68] %asi, %i5; \
565 ldxa [%sp + STACK_BIAS + 0x70] %asi, %i6; \
566 ldxa [%sp + STACK_BIAS + 0x78] %asi, %i7; \
567 ba,pt %xcc, user_rtt_pre_restore; \
568 restored; \
569 nop; nop; nop; nop; nop; nop; \
570 nop; nop; nop; nop; nop; \
571 ba,a,pt %xcc, user_rtt_fill_fixup; \
572 ba,a,pt %xcc, user_rtt_fill_fixup; \
573 ba,a,pt %xcc, user_rtt_fill_fixup;
576 /* Normal 32bit fill */
577 #define FILL_2_GENERIC(ASI) \
578 srl %sp, 0, %sp; \
579 lduwa [%sp + %g0] ASI, %l0; \
580 mov 0x04, %g2; \
581 mov 0x08, %g3; \
582 lduwa [%sp + %g2] ASI, %l1; \
583 mov 0x0c, %g5; \
584 lduwa [%sp + %g3] ASI, %l2; \
585 lduwa [%sp + %g5] ASI, %l3; \
586 add %sp, 0x10, %g1; \
587 lduwa [%g1 + %g0] ASI, %l4; \
588 lduwa [%g1 + %g2] ASI, %l5; \
589 lduwa [%g1 + %g3] ASI, %l6; \
590 lduwa [%g1 + %g5] ASI, %l7; \
591 add %g1, 0x10, %g1; \
592 lduwa [%g1 + %g0] ASI, %i0; \
593 lduwa [%g1 + %g2] ASI, %i1; \
594 lduwa [%g1 + %g3] ASI, %i2; \
595 lduwa [%g1 + %g5] ASI, %i3; \
596 add %g1, 0x10, %g1; \
597 lduwa [%g1 + %g0] ASI, %i4; \
598 lduwa [%g1 + %g2] ASI, %i5; \
599 lduwa [%g1 + %g3] ASI, %i6; \
600 lduwa [%g1 + %g5] ASI, %i7; \
601 restored; \
602 retry; nop; nop; nop; nop; \
603 b,a,pt %xcc, fill_fixup_dax; \
604 b,a,pt %xcc, fill_fixup_mna; \
605 b,a,pt %xcc, fill_fixup;
607 #define FILL_2_GENERIC_RTRAP \
608 user_rtt_fill_32bit: \
609 srl %sp, 0, %sp; \
610 lduwa [%sp + 0x00] %asi, %l0; \
611 lduwa [%sp + 0x04] %asi, %l1; \
612 lduwa [%sp + 0x08] %asi, %l2; \
613 lduwa [%sp + 0x0c] %asi, %l3; \
614 lduwa [%sp + 0x10] %asi, %l4; \
615 lduwa [%sp + 0x14] %asi, %l5; \
616 lduwa [%sp + 0x18] %asi, %l6; \
617 lduwa [%sp + 0x1c] %asi, %l7; \
618 lduwa [%sp + 0x20] %asi, %i0; \
619 lduwa [%sp + 0x24] %asi, %i1; \
620 lduwa [%sp + 0x28] %asi, %i2; \
621 lduwa [%sp + 0x2c] %asi, %i3; \
622 lduwa [%sp + 0x30] %asi, %i4; \
623 lduwa [%sp + 0x34] %asi, %i5; \
624 lduwa [%sp + 0x38] %asi, %i6; \
625 lduwa [%sp + 0x3c] %asi, %i7; \
626 ba,pt %xcc, user_rtt_pre_restore; \
627 restored; \
628 nop; nop; nop; nop; nop; \
629 nop; nop; nop; nop; nop; \
630 ba,a,pt %xcc, user_rtt_fill_fixup; \
631 ba,a,pt %xcc, user_rtt_fill_fixup; \
632 ba,a,pt %xcc, user_rtt_fill_fixup;
635 #define FILL_1_NORMAL FILL_1_GENERIC(ASI_AIUP)
636 #define FILL_2_NORMAL FILL_2_GENERIC(ASI_AIUP)
637 #define FILL_3_NORMAL FILL_0_NORMAL
638 #define FILL_4_NORMAL FILL_0_NORMAL
639 #define FILL_5_NORMAL FILL_0_NORMAL
640 #define FILL_6_NORMAL FILL_0_NORMAL
641 #define FILL_7_NORMAL FILL_0_NORMAL
643 #define FILL_0_OTHER FILL_0_NORMAL
644 #define FILL_1_OTHER FILL_1_GENERIC(ASI_AIUS)
645 #define FILL_2_OTHER FILL_2_GENERIC(ASI_AIUS)
646 #define FILL_3_OTHER FILL_3_NORMAL
647 #define FILL_4_OTHER FILL_4_NORMAL
648 #define FILL_5_OTHER FILL_5_NORMAL
649 #define FILL_6_OTHER FILL_6_NORMAL
650 #define FILL_7_OTHER FILL_7_NORMAL
652 #endif /* !(_SPARC64_TTABLE_H) */