1 /* $Id: ttable.h,v 1.18 2002/02/09 19:49:32 davem Exp $ */
2 #ifndef _SPARC64_TTABLE_H
3 #define _SPARC64_TTABLE_H
8 #include <asm/thread_info.h>
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; \
22 nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
24 #define TRAP(routine) \
25 sethi %hi(109f), %g7; \
27 109: or %g7, %lo(109b), %g7; \
29 add %sp, PTREGS_OFF, %o0; \
34 #define TRAP_7INSNS(routine) \
35 sethi %hi(109f), %g7; \
37 109: or %g7, %lo(109b), %g7; \
39 add %sp, PTREGS_OFF, %o0; \
43 #define TRAP_SAVEFPU(routine) \
44 sethi %hi(109f), %g7; \
45 ba,pt %xcc, do_fptrap; \
46 109: or %g7, %lo(109b), %g7; \
48 add %sp, PTREGS_OFF, %o0; \
53 #define TRAP_NOSAVE(routine) \
54 ba,pt %xcc, routine; \
56 nop; nop; nop; nop; nop; nop;
58 #define TRAP_NOSAVE_7INSNS(routine) \
59 ba,pt %xcc, routine; \
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; \
68 add %sp, PTREGS_OFF, %o0; \
73 #define TRAP_ARG(routine, arg) \
74 sethi %hi(109f), %g7; \
76 109: or %g7, %lo(109b), %g7; \
77 add %sp, PTREGS_OFF, %o0; \
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; \
93 #define SYSCALL_TRAP(routine, systbl) \
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) \
105 ba,pt %xcc, utrap_trap; \
114 #define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
116 #define LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
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) \
127 wrpr %g0, 15, %pil; \
128 sethi %hi(1f-4), %g7; \
129 ba,pt %xcc, etrap_irq; \
130 or %g7, %lo(1f-4), %g7; \
135 1: call trace_hardirqs_off; \
139 add %sp, PTREGS_OFF, %o1; \
140 ba,a,pt %xcc, rtrap_irq; \
145 #define TRAP_IRQ(routine, level) \
147 wrpr %g0, 15, %pil; \
148 ba,pt %xcc, etrap_irq; \
152 add %sp, PTREGS_OFF, %o1; \
153 ba,a,pt %xcc, rtrap_irq;
157 #define TRAP_IVEC TRAP_NOSAVE(do_ivec)
159 #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl)
161 #define BTRAPTL1(lvl) TRAPTL1_ARG(bad_trap_tl1, lvl)
163 #define FLUSH_WINDOW_TRAP \
167 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1; \
169 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]; \
171 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC];
173 #ifdef CONFIG_KPROBES
174 #define KPROBES_TRAP(lvl) TRAP_IRQ(kprobe_trap, lvl)
176 #define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
180 #define KGDB_TRAP(lvl) TRAP_IRQ(kgdb_trap, lvl)
182 #define KGDB_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
185 #define SUN4V_ITSB_MISS \
186 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
187 ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4; \
188 ldx [%g2 + HV_FAULT_I_CTX_OFFSET], %g5; \
190 ba,pt %xcc, sun4v_itsb_miss; \
195 #define SUN4V_DTSB_MISS \
196 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
197 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4; \
198 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5; \
200 ba,pt %xcc, sun4v_dtsb_miss; \
205 /* Before touching these macros, you owe it to yourself to go and
206 * see how arch/sparc64/kernel/winfixup.S works... -DaveM
208 * For the user cases we used to use the %asi register, but
209 * it turns out that the "wr xxx, %asi" costs ~5 cycles, so
210 * now we use immediate ASI loads and stores instead. Kudos
211 * to Greg Onufer for pointing out this performance anomaly.
213 * Further note that we cannot use the g2, g4, g5, and g7 alternate
214 * globals in the spill routines, check out the save instruction in
215 * arch/sparc64/kernel/etrap.S to see what I mean about g2, and
216 * g4/g5 are the globals which are preserved by etrap processing
217 * for the caller of it. The g7 register is the return pc for
218 * etrap. Finally, g6 is the current thread register so we cannot
219 * us it in the spill handlers either. Most of these rules do not
220 * apply to fill processing, only g6 is not usable.
223 /* Normal kernel spill */
224 #define SPILL_0_NORMAL \
225 stx %l0, [%sp + STACK_BIAS + 0x00]; \
226 stx %l1, [%sp + STACK_BIAS + 0x08]; \
227 stx %l2, [%sp + STACK_BIAS + 0x10]; \
228 stx %l3, [%sp + STACK_BIAS + 0x18]; \
229 stx %l4, [%sp + STACK_BIAS + 0x20]; \
230 stx %l5, [%sp + STACK_BIAS + 0x28]; \
231 stx %l6, [%sp + STACK_BIAS + 0x30]; \
232 stx %l7, [%sp + STACK_BIAS + 0x38]; \
233 stx %i0, [%sp + STACK_BIAS + 0x40]; \
234 stx %i1, [%sp + STACK_BIAS + 0x48]; \
235 stx %i2, [%sp + STACK_BIAS + 0x50]; \
236 stx %i3, [%sp + STACK_BIAS + 0x58]; \
237 stx %i4, [%sp + STACK_BIAS + 0x60]; \
238 stx %i5, [%sp + STACK_BIAS + 0x68]; \
239 stx %i6, [%sp + STACK_BIAS + 0x70]; \
240 stx %i7, [%sp + STACK_BIAS + 0x78]; \
241 saved; retry; nop; nop; nop; nop; nop; nop; \
242 nop; nop; nop; nop; nop; nop; nop; nop;
244 #define SPILL_0_NORMAL_ETRAP \
245 etrap_kernel_spill: \
246 stx %l0, [%sp + STACK_BIAS + 0x00]; \
247 stx %l1, [%sp + STACK_BIAS + 0x08]; \
248 stx %l2, [%sp + STACK_BIAS + 0x10]; \
249 stx %l3, [%sp + STACK_BIAS + 0x18]; \
250 stx %l4, [%sp + STACK_BIAS + 0x20]; \
251 stx %l5, [%sp + STACK_BIAS + 0x28]; \
252 stx %l6, [%sp + STACK_BIAS + 0x30]; \
253 stx %l7, [%sp + STACK_BIAS + 0x38]; \
254 stx %i0, [%sp + STACK_BIAS + 0x40]; \
255 stx %i1, [%sp + STACK_BIAS + 0x48]; \
256 stx %i2, [%sp + STACK_BIAS + 0x50]; \
257 stx %i3, [%sp + STACK_BIAS + 0x58]; \
258 stx %i4, [%sp + STACK_BIAS + 0x60]; \
259 stx %i5, [%sp + STACK_BIAS + 0x68]; \
260 stx %i6, [%sp + STACK_BIAS + 0x70]; \
261 stx %i7, [%sp + STACK_BIAS + 0x78]; \
264 ba,pt %xcc, etrap_save; \
266 nop; nop; nop; nop; nop; nop; nop; nop; \
269 /* Normal 64bit spill */
270 #define SPILL_1_GENERIC(ASI) \
271 add %sp, STACK_BIAS + 0x00, %g1; \
272 stxa %l0, [%g1 + %g0] ASI; \
274 stxa %l1, [%g1 + %g3] ASI; \
275 add %g1, 0x10, %g1; \
276 stxa %l2, [%g1 + %g0] ASI; \
277 stxa %l3, [%g1 + %g3] ASI; \
278 add %g1, 0x10, %g1; \
279 stxa %l4, [%g1 + %g0] ASI; \
280 stxa %l5, [%g1 + %g3] ASI; \
281 add %g1, 0x10, %g1; \
282 stxa %l6, [%g1 + %g0] ASI; \
283 stxa %l7, [%g1 + %g3] ASI; \
284 add %g1, 0x10, %g1; \
285 stxa %i0, [%g1 + %g0] ASI; \
286 stxa %i1, [%g1 + %g3] ASI; \
287 add %g1, 0x10, %g1; \
288 stxa %i2, [%g1 + %g0] ASI; \
289 stxa %i3, [%g1 + %g3] ASI; \
290 add %g1, 0x10, %g1; \
291 stxa %i4, [%g1 + %g0] ASI; \
292 stxa %i5, [%g1 + %g3] ASI; \
293 add %g1, 0x10, %g1; \
294 stxa %i6, [%g1 + %g0] ASI; \
295 stxa %i7, [%g1 + %g3] ASI; \
298 b,a,pt %xcc, spill_fixup_dax; \
299 b,a,pt %xcc, spill_fixup_mna; \
300 b,a,pt %xcc, spill_fixup;
302 #define SPILL_1_GENERIC_ETRAP \
303 etrap_user_spill_64bit: \
304 stxa %l0, [%sp + STACK_BIAS + 0x00] %asi; \
305 stxa %l1, [%sp + STACK_BIAS + 0x08] %asi; \
306 stxa %l2, [%sp + STACK_BIAS + 0x10] %asi; \
307 stxa %l3, [%sp + STACK_BIAS + 0x18] %asi; \
308 stxa %l4, [%sp + STACK_BIAS + 0x20] %asi; \
309 stxa %l5, [%sp + STACK_BIAS + 0x28] %asi; \
310 stxa %l6, [%sp + STACK_BIAS + 0x30] %asi; \
311 stxa %l7, [%sp + STACK_BIAS + 0x38] %asi; \
312 stxa %i0, [%sp + STACK_BIAS + 0x40] %asi; \
313 stxa %i1, [%sp + STACK_BIAS + 0x48] %asi; \
314 stxa %i2, [%sp + STACK_BIAS + 0x50] %asi; \
315 stxa %i3, [%sp + STACK_BIAS + 0x58] %asi; \
316 stxa %i4, [%sp + STACK_BIAS + 0x60] %asi; \
317 stxa %i5, [%sp + STACK_BIAS + 0x68] %asi; \
318 stxa %i6, [%sp + STACK_BIAS + 0x70] %asi; \
319 stxa %i7, [%sp + STACK_BIAS + 0x78] %asi; \
322 ba,pt %xcc, etrap_save; \
324 nop; nop; nop; nop; nop; \
325 nop; nop; nop; nop; \
326 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
327 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
328 ba,a,pt %xcc, etrap_spill_fixup_64bit;
330 #define SPILL_1_GENERIC_ETRAP_FIXUP \
331 etrap_spill_fixup_64bit: \
332 ldub [%g6 + TI_WSAVED], %g1; \
335 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
338 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
339 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]; \
340 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]; \
341 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]; \
342 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]; \
343 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]; \
344 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]; \
345 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]; \
346 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]; \
347 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]; \
348 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]; \
349 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]; \
350 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]; \
351 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]; \
352 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]; \
353 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]; \
355 stb %g1, [%g6 + TI_WSAVED]; \
359 ba,pt %xcc, etrap_save; \
363 /* Normal 32bit spill */
364 #define SPILL_2_GENERIC(ASI) \
366 stwa %l0, [%sp + %g0] ASI; \
368 stwa %l1, [%sp + %g3] ASI; \
369 add %sp, 0x08, %g1; \
370 stwa %l2, [%g1 + %g0] ASI; \
371 stwa %l3, [%g1 + %g3] ASI; \
372 add %g1, 0x08, %g1; \
373 stwa %l4, [%g1 + %g0] ASI; \
374 stwa %l5, [%g1 + %g3] ASI; \
375 add %g1, 0x08, %g1; \
376 stwa %l6, [%g1 + %g0] ASI; \
377 stwa %l7, [%g1 + %g3] ASI; \
378 add %g1, 0x08, %g1; \
379 stwa %i0, [%g1 + %g0] ASI; \
380 stwa %i1, [%g1 + %g3] ASI; \
381 add %g1, 0x08, %g1; \
382 stwa %i2, [%g1 + %g0] ASI; \
383 stwa %i3, [%g1 + %g3] ASI; \
384 add %g1, 0x08, %g1; \
385 stwa %i4, [%g1 + %g0] ASI; \
386 stwa %i5, [%g1 + %g3] ASI; \
387 add %g1, 0x08, %g1; \
388 stwa %i6, [%g1 + %g0] ASI; \
389 stwa %i7, [%g1 + %g3] ASI; \
392 b,a,pt %xcc, spill_fixup_dax; \
393 b,a,pt %xcc, spill_fixup_mna; \
394 b,a,pt %xcc, spill_fixup;
396 #define SPILL_2_GENERIC_ETRAP \
397 etrap_user_spill_32bit: \
399 stwa %l0, [%sp + 0x00] %asi; \
400 stwa %l1, [%sp + 0x04] %asi; \
401 stwa %l2, [%sp + 0x08] %asi; \
402 stwa %l3, [%sp + 0x0c] %asi; \
403 stwa %l4, [%sp + 0x10] %asi; \
404 stwa %l5, [%sp + 0x14] %asi; \
405 stwa %l6, [%sp + 0x18] %asi; \
406 stwa %l7, [%sp + 0x1c] %asi; \
407 stwa %i0, [%sp + 0x20] %asi; \
408 stwa %i1, [%sp + 0x24] %asi; \
409 stwa %i2, [%sp + 0x28] %asi; \
410 stwa %i3, [%sp + 0x2c] %asi; \
411 stwa %i4, [%sp + 0x30] %asi; \
412 stwa %i5, [%sp + 0x34] %asi; \
413 stwa %i6, [%sp + 0x38] %asi; \
414 stwa %i7, [%sp + 0x3c] %asi; \
417 ba,pt %xcc, etrap_save; \
419 nop; nop; nop; nop; \
420 nop; nop; nop; nop; \
421 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
422 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
423 ba,a,pt %xcc, etrap_spill_fixup_32bit;
425 #define SPILL_2_GENERIC_ETRAP_FIXUP \
426 etrap_spill_fixup_32bit: \
427 ldub [%g6 + TI_WSAVED], %g1; \
430 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
433 stw %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
434 stw %l1, [%g3 + TI_REG_WINDOW + 0x04]; \
435 stw %l2, [%g3 + TI_REG_WINDOW + 0x08]; \
436 stw %l3, [%g3 + TI_REG_WINDOW + 0x0c]; \
437 stw %l4, [%g3 + TI_REG_WINDOW + 0x10]; \
438 stw %l5, [%g3 + TI_REG_WINDOW + 0x14]; \
439 stw %l6, [%g3 + TI_REG_WINDOW + 0x18]; \
440 stw %l7, [%g3 + TI_REG_WINDOW + 0x1c]; \
441 stw %i0, [%g3 + TI_REG_WINDOW + 0x20]; \
442 stw %i1, [%g3 + TI_REG_WINDOW + 0x24]; \
443 stw %i2, [%g3 + TI_REG_WINDOW + 0x28]; \
444 stw %i3, [%g3 + TI_REG_WINDOW + 0x2c]; \
445 stw %i4, [%g3 + TI_REG_WINDOW + 0x30]; \
446 stw %i5, [%g3 + TI_REG_WINDOW + 0x34]; \
447 stw %i6, [%g3 + TI_REG_WINDOW + 0x38]; \
448 stw %i7, [%g3 + TI_REG_WINDOW + 0x3c]; \
450 stb %g1, [%g6 + TI_WSAVED]; \
454 ba,pt %xcc, etrap_save; \
458 #define SPILL_1_NORMAL SPILL_1_GENERIC(ASI_AIUP)
459 #define SPILL_2_NORMAL SPILL_2_GENERIC(ASI_AIUP)
460 #define SPILL_3_NORMAL SPILL_0_NORMAL
461 #define SPILL_4_NORMAL SPILL_0_NORMAL
462 #define SPILL_5_NORMAL SPILL_0_NORMAL
463 #define SPILL_6_NORMAL SPILL_0_NORMAL
464 #define SPILL_7_NORMAL SPILL_0_NORMAL
466 #define SPILL_0_OTHER SPILL_0_NORMAL
467 #define SPILL_1_OTHER SPILL_1_GENERIC(ASI_AIUS)
468 #define SPILL_2_OTHER SPILL_2_GENERIC(ASI_AIUS)
469 #define SPILL_3_OTHER SPILL_3_NORMAL
470 #define SPILL_4_OTHER SPILL_4_NORMAL
471 #define SPILL_5_OTHER SPILL_5_NORMAL
472 #define SPILL_6_OTHER SPILL_6_NORMAL
473 #define SPILL_7_OTHER SPILL_7_NORMAL
475 /* Normal kernel fill */
476 #define FILL_0_NORMAL \
477 ldx [%sp + STACK_BIAS + 0x00], %l0; \
478 ldx [%sp + STACK_BIAS + 0x08], %l1; \
479 ldx [%sp + STACK_BIAS + 0x10], %l2; \
480 ldx [%sp + STACK_BIAS + 0x18], %l3; \
481 ldx [%sp + STACK_BIAS + 0x20], %l4; \
482 ldx [%sp + STACK_BIAS + 0x28], %l5; \
483 ldx [%sp + STACK_BIAS + 0x30], %l6; \
484 ldx [%sp + STACK_BIAS + 0x38], %l7; \
485 ldx [%sp + STACK_BIAS + 0x40], %i0; \
486 ldx [%sp + STACK_BIAS + 0x48], %i1; \
487 ldx [%sp + STACK_BIAS + 0x50], %i2; \
488 ldx [%sp + STACK_BIAS + 0x58], %i3; \
489 ldx [%sp + STACK_BIAS + 0x60], %i4; \
490 ldx [%sp + STACK_BIAS + 0x68], %i5; \
491 ldx [%sp + STACK_BIAS + 0x70], %i6; \
492 ldx [%sp + STACK_BIAS + 0x78], %i7; \
493 restored; retry; nop; nop; nop; nop; nop; nop; \
494 nop; nop; nop; nop; nop; nop; nop; nop;
496 #define FILL_0_NORMAL_RTRAP \
501 ldx [%sp + STACK_BIAS + 0x00], %l0; \
502 ldx [%sp + STACK_BIAS + 0x08], %l1; \
503 ldx [%sp + STACK_BIAS + 0x10], %l2; \
504 ldx [%sp + STACK_BIAS + 0x18], %l3; \
505 ldx [%sp + STACK_BIAS + 0x20], %l4; \
506 ldx [%sp + STACK_BIAS + 0x28], %l5; \
507 ldx [%sp + STACK_BIAS + 0x30], %l6; \
508 ldx [%sp + STACK_BIAS + 0x38], %l7; \
509 ldx [%sp + STACK_BIAS + 0x40], %i0; \
510 ldx [%sp + STACK_BIAS + 0x48], %i1; \
511 ldx [%sp + STACK_BIAS + 0x50], %i2; \
512 ldx [%sp + STACK_BIAS + 0x58], %i3; \
513 ldx [%sp + STACK_BIAS + 0x60], %i4; \
514 ldx [%sp + STACK_BIAS + 0x68], %i5; \
515 ldx [%sp + STACK_BIAS + 0x70], %i6; \
516 ldx [%sp + STACK_BIAS + 0x78], %i7; \
519 ba,pt %xcc, kern_rtt_restore; \
521 nop; nop; nop; nop; nop; \
525 /* Normal 64bit fill */
526 #define FILL_1_GENERIC(ASI) \
527 add %sp, STACK_BIAS + 0x00, %g1; \
528 ldxa [%g1 + %g0] ASI, %l0; \
531 ldxa [%g1 + %g2] ASI, %l1; \
533 ldxa [%g1 + %g3] ASI, %l2; \
534 ldxa [%g1 + %g5] ASI, %l3; \
535 add %g1, 0x20, %g1; \
536 ldxa [%g1 + %g0] ASI, %l4; \
537 ldxa [%g1 + %g2] ASI, %l5; \
538 ldxa [%g1 + %g3] ASI, %l6; \
539 ldxa [%g1 + %g5] ASI, %l7; \
540 add %g1, 0x20, %g1; \
541 ldxa [%g1 + %g0] ASI, %i0; \
542 ldxa [%g1 + %g2] ASI, %i1; \
543 ldxa [%g1 + %g3] ASI, %i2; \
544 ldxa [%g1 + %g5] ASI, %i3; \
545 add %g1, 0x20, %g1; \
546 ldxa [%g1 + %g0] ASI, %i4; \
547 ldxa [%g1 + %g2] ASI, %i5; \
548 ldxa [%g1 + %g3] ASI, %i6; \
549 ldxa [%g1 + %g5] ASI, %i7; \
551 retry; nop; nop; nop; nop; \
552 b,a,pt %xcc, fill_fixup_dax; \
553 b,a,pt %xcc, fill_fixup_mna; \
554 b,a,pt %xcc, fill_fixup;
556 #define FILL_1_GENERIC_RTRAP \
557 user_rtt_fill_64bit: \
558 ldxa [%sp + STACK_BIAS + 0x00] %asi, %l0; \
559 ldxa [%sp + STACK_BIAS + 0x08] %asi, %l1; \
560 ldxa [%sp + STACK_BIAS + 0x10] %asi, %l2; \
561 ldxa [%sp + STACK_BIAS + 0x18] %asi, %l3; \
562 ldxa [%sp + STACK_BIAS + 0x20] %asi, %l4; \
563 ldxa [%sp + STACK_BIAS + 0x28] %asi, %l5; \
564 ldxa [%sp + STACK_BIAS + 0x30] %asi, %l6; \
565 ldxa [%sp + STACK_BIAS + 0x38] %asi, %l7; \
566 ldxa [%sp + STACK_BIAS + 0x40] %asi, %i0; \
567 ldxa [%sp + STACK_BIAS + 0x48] %asi, %i1; \
568 ldxa [%sp + STACK_BIAS + 0x50] %asi, %i2; \
569 ldxa [%sp + STACK_BIAS + 0x58] %asi, %i3; \
570 ldxa [%sp + STACK_BIAS + 0x60] %asi, %i4; \
571 ldxa [%sp + STACK_BIAS + 0x68] %asi, %i5; \
572 ldxa [%sp + STACK_BIAS + 0x70] %asi, %i6; \
573 ldxa [%sp + STACK_BIAS + 0x78] %asi, %i7; \
574 ba,pt %xcc, user_rtt_pre_restore; \
576 nop; nop; nop; nop; nop; nop; \
577 nop; nop; nop; nop; nop; \
578 ba,a,pt %xcc, user_rtt_fill_fixup; \
579 ba,a,pt %xcc, user_rtt_fill_fixup; \
580 ba,a,pt %xcc, user_rtt_fill_fixup;
583 /* Normal 32bit fill */
584 #define FILL_2_GENERIC(ASI) \
586 lduwa [%sp + %g0] ASI, %l0; \
589 lduwa [%sp + %g2] ASI, %l1; \
591 lduwa [%sp + %g3] ASI, %l2; \
592 lduwa [%sp + %g5] ASI, %l3; \
593 add %sp, 0x10, %g1; \
594 lduwa [%g1 + %g0] ASI, %l4; \
595 lduwa [%g1 + %g2] ASI, %l5; \
596 lduwa [%g1 + %g3] ASI, %l6; \
597 lduwa [%g1 + %g5] ASI, %l7; \
598 add %g1, 0x10, %g1; \
599 lduwa [%g1 + %g0] ASI, %i0; \
600 lduwa [%g1 + %g2] ASI, %i1; \
601 lduwa [%g1 + %g3] ASI, %i2; \
602 lduwa [%g1 + %g5] ASI, %i3; \
603 add %g1, 0x10, %g1; \
604 lduwa [%g1 + %g0] ASI, %i4; \
605 lduwa [%g1 + %g2] ASI, %i5; \
606 lduwa [%g1 + %g3] ASI, %i6; \
607 lduwa [%g1 + %g5] ASI, %i7; \
609 retry; nop; nop; nop; nop; \
610 b,a,pt %xcc, fill_fixup_dax; \
611 b,a,pt %xcc, fill_fixup_mna; \
612 b,a,pt %xcc, fill_fixup;
614 #define FILL_2_GENERIC_RTRAP \
615 user_rtt_fill_32bit: \
617 lduwa [%sp + 0x00] %asi, %l0; \
618 lduwa [%sp + 0x04] %asi, %l1; \
619 lduwa [%sp + 0x08] %asi, %l2; \
620 lduwa [%sp + 0x0c] %asi, %l3; \
621 lduwa [%sp + 0x10] %asi, %l4; \
622 lduwa [%sp + 0x14] %asi, %l5; \
623 lduwa [%sp + 0x18] %asi, %l6; \
624 lduwa [%sp + 0x1c] %asi, %l7; \
625 lduwa [%sp + 0x20] %asi, %i0; \
626 lduwa [%sp + 0x24] %asi, %i1; \
627 lduwa [%sp + 0x28] %asi, %i2; \
628 lduwa [%sp + 0x2c] %asi, %i3; \
629 lduwa [%sp + 0x30] %asi, %i4; \
630 lduwa [%sp + 0x34] %asi, %i5; \
631 lduwa [%sp + 0x38] %asi, %i6; \
632 lduwa [%sp + 0x3c] %asi, %i7; \
633 ba,pt %xcc, user_rtt_pre_restore; \
635 nop; nop; nop; nop; nop; \
636 nop; nop; nop; nop; nop; \
637 ba,a,pt %xcc, user_rtt_fill_fixup; \
638 ba,a,pt %xcc, user_rtt_fill_fixup; \
639 ba,a,pt %xcc, user_rtt_fill_fixup;
642 #define FILL_1_NORMAL FILL_1_GENERIC(ASI_AIUP)
643 #define FILL_2_NORMAL FILL_2_GENERIC(ASI_AIUP)
644 #define FILL_3_NORMAL FILL_0_NORMAL
645 #define FILL_4_NORMAL FILL_0_NORMAL
646 #define FILL_5_NORMAL FILL_0_NORMAL
647 #define FILL_6_NORMAL FILL_0_NORMAL
648 #define FILL_7_NORMAL FILL_0_NORMAL
650 #define FILL_0_OTHER FILL_0_NORMAL
651 #define FILL_1_OTHER FILL_1_GENERIC(ASI_AIUS)
652 #define FILL_2_OTHER FILL_2_GENERIC(ASI_AIUS)
653 #define FILL_3_OTHER FILL_3_NORMAL
654 #define FILL_4_OTHER FILL_4_NORMAL
655 #define FILL_5_OTHER FILL_5_NORMAL
656 #define FILL_6_OTHER FILL_6_NORMAL
657 #define FILL_7_OTHER FILL_7_NORMAL
659 #endif /* !(_SPARC64_TTABLE_H) */