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) \
94 sethi %hi(109f), %g7; \
96 109: or %g7, %lo(109b), %g7; \
97 sethi %hi(systbl), %l7; \
98 ba,pt %xcc, routine; \
99 or %l7, %lo(systbl), %l7; \
102 #define INDIRECT_SOLARIS_SYSCALL(num) \
103 sethi %hi(109f), %g7; \
105 109: or %g7, %lo(109b), %g7; \
106 ba,pt %xcc, tl0_solaris + 0xc; \
110 #define TRAP_UTRAP(handler,lvl) \
112 ba,pt %xcc, utrap_trap; \
120 #ifdef CONFIG_SUNOS_EMUL
121 #define SUNOS_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sunos_sys_table)
123 #define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
126 #define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
128 #define LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
130 #define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
131 #define GETCC_TRAP TRAP(getcc)
132 #define SETCC_TRAP TRAP(setcc)
133 #ifdef CONFIG_SOLARIS_EMUL
134 #define SOLARIS_SYSCALL_TRAP TRAP(solaris_sparc_syscall)
136 #define SOLARIS_SYSCALL_TRAP TRAP(solaris_syscall)
138 #define BREAKPOINT_TRAP TRAP(breakpoint_trap)
140 #ifdef CONFIG_TRACE_IRQFLAGS
142 #define TRAP_IRQ(routine, level) \
144 wrpr %g0, 15, %pil; \
145 sethi %hi(1f-4), %g7; \
146 ba,pt %xcc, etrap_irq; \
147 or %g7, %lo(1f-4), %g7; \
152 1: call trace_hardirqs_off; \
156 add %sp, PTREGS_OFF, %o1; \
157 ba,a,pt %xcc, rtrap_irq; \
162 #define TRAP_IRQ(routine, level) \
164 wrpr %g0, 15, %pil; \
165 ba,pt %xcc, etrap_irq; \
169 add %sp, PTREGS_OFF, %o1; \
170 ba,a,pt %xcc, rtrap_irq;
174 #define TRAP_IVEC TRAP_NOSAVE(do_ivec)
176 #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl)
178 #define BTRAPTL1(lvl) TRAPTL1_ARG(bad_trap_tl1, lvl)
180 #define FLUSH_WINDOW_TRAP \
184 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1; \
186 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]; \
187 ba,pt %xcc, rtrap_clr_l6; \
188 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC];
190 #ifdef CONFIG_KPROBES
191 #define KPROBES_TRAP(lvl) TRAP_IRQ(kprobe_trap, lvl)
193 #define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
196 #define SUN4V_ITSB_MISS \
197 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
198 ldx [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4; \
199 ldx [%g2 + HV_FAULT_I_CTX_OFFSET], %g5; \
201 ba,pt %xcc, sun4v_itsb_miss; \
206 #define SUN4V_DTSB_MISS \
207 ldxa [%g0] ASI_SCRATCHPAD, %g2; \
208 ldx [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4; \
209 ldx [%g2 + HV_FAULT_D_CTX_OFFSET], %g5; \
211 ba,pt %xcc, sun4v_dtsb_miss; \
216 /* Before touching these macros, you owe it to yourself to go and
217 * see how arch/sparc64/kernel/winfixup.S works... -DaveM
219 * For the user cases we used to use the %asi register, but
220 * it turns out that the "wr xxx, %asi" costs ~5 cycles, so
221 * now we use immediate ASI loads and stores instead. Kudos
222 * to Greg Onufer for pointing out this performance anomaly.
224 * Further note that we cannot use the g2, g4, g5, and g7 alternate
225 * globals in the spill routines, check out the save instruction in
226 * arch/sparc64/kernel/etrap.S to see what I mean about g2, and
227 * g4/g5 are the globals which are preserved by etrap processing
228 * for the caller of it. The g7 register is the return pc for
229 * etrap. Finally, g6 is the current thread register so we cannot
230 * us it in the spill handlers either. Most of these rules do not
231 * apply to fill processing, only g6 is not usable.
234 /* Normal kernel spill */
235 #define SPILL_0_NORMAL \
236 stx %l0, [%sp + STACK_BIAS + 0x00]; \
237 stx %l1, [%sp + STACK_BIAS + 0x08]; \
238 stx %l2, [%sp + STACK_BIAS + 0x10]; \
239 stx %l3, [%sp + STACK_BIAS + 0x18]; \
240 stx %l4, [%sp + STACK_BIAS + 0x20]; \
241 stx %l5, [%sp + STACK_BIAS + 0x28]; \
242 stx %l6, [%sp + STACK_BIAS + 0x30]; \
243 stx %l7, [%sp + STACK_BIAS + 0x38]; \
244 stx %i0, [%sp + STACK_BIAS + 0x40]; \
245 stx %i1, [%sp + STACK_BIAS + 0x48]; \
246 stx %i2, [%sp + STACK_BIAS + 0x50]; \
247 stx %i3, [%sp + STACK_BIAS + 0x58]; \
248 stx %i4, [%sp + STACK_BIAS + 0x60]; \
249 stx %i5, [%sp + STACK_BIAS + 0x68]; \
250 stx %i6, [%sp + STACK_BIAS + 0x70]; \
251 stx %i7, [%sp + STACK_BIAS + 0x78]; \
252 saved; retry; nop; nop; nop; nop; nop; nop; \
253 nop; nop; nop; nop; nop; nop; nop; nop;
255 #define SPILL_0_NORMAL_ETRAP \
256 etrap_kernel_spill: \
257 stx %l0, [%sp + STACK_BIAS + 0x00]; \
258 stx %l1, [%sp + STACK_BIAS + 0x08]; \
259 stx %l2, [%sp + STACK_BIAS + 0x10]; \
260 stx %l3, [%sp + STACK_BIAS + 0x18]; \
261 stx %l4, [%sp + STACK_BIAS + 0x20]; \
262 stx %l5, [%sp + STACK_BIAS + 0x28]; \
263 stx %l6, [%sp + STACK_BIAS + 0x30]; \
264 stx %l7, [%sp + STACK_BIAS + 0x38]; \
265 stx %i0, [%sp + STACK_BIAS + 0x40]; \
266 stx %i1, [%sp + STACK_BIAS + 0x48]; \
267 stx %i2, [%sp + STACK_BIAS + 0x50]; \
268 stx %i3, [%sp + STACK_BIAS + 0x58]; \
269 stx %i4, [%sp + STACK_BIAS + 0x60]; \
270 stx %i5, [%sp + STACK_BIAS + 0x68]; \
271 stx %i6, [%sp + STACK_BIAS + 0x70]; \
272 stx %i7, [%sp + STACK_BIAS + 0x78]; \
275 ba,pt %xcc, etrap_save; \
277 nop; nop; nop; nop; nop; nop; nop; nop; \
280 /* Normal 64bit spill */
281 #define SPILL_1_GENERIC(ASI) \
282 add %sp, STACK_BIAS + 0x00, %g1; \
283 stxa %l0, [%g1 + %g0] ASI; \
285 stxa %l1, [%g1 + %g3] ASI; \
286 add %g1, 0x10, %g1; \
287 stxa %l2, [%g1 + %g0] ASI; \
288 stxa %l3, [%g1 + %g3] ASI; \
289 add %g1, 0x10, %g1; \
290 stxa %l4, [%g1 + %g0] ASI; \
291 stxa %l5, [%g1 + %g3] ASI; \
292 add %g1, 0x10, %g1; \
293 stxa %l6, [%g1 + %g0] ASI; \
294 stxa %l7, [%g1 + %g3] ASI; \
295 add %g1, 0x10, %g1; \
296 stxa %i0, [%g1 + %g0] ASI; \
297 stxa %i1, [%g1 + %g3] ASI; \
298 add %g1, 0x10, %g1; \
299 stxa %i2, [%g1 + %g0] ASI; \
300 stxa %i3, [%g1 + %g3] ASI; \
301 add %g1, 0x10, %g1; \
302 stxa %i4, [%g1 + %g0] ASI; \
303 stxa %i5, [%g1 + %g3] ASI; \
304 add %g1, 0x10, %g1; \
305 stxa %i6, [%g1 + %g0] ASI; \
306 stxa %i7, [%g1 + %g3] ASI; \
309 b,a,pt %xcc, spill_fixup_dax; \
310 b,a,pt %xcc, spill_fixup_mna; \
311 b,a,pt %xcc, spill_fixup;
313 #define SPILL_1_GENERIC_ETRAP \
314 etrap_user_spill_64bit: \
315 stxa %l0, [%sp + STACK_BIAS + 0x00] %asi; \
316 stxa %l1, [%sp + STACK_BIAS + 0x08] %asi; \
317 stxa %l2, [%sp + STACK_BIAS + 0x10] %asi; \
318 stxa %l3, [%sp + STACK_BIAS + 0x18] %asi; \
319 stxa %l4, [%sp + STACK_BIAS + 0x20] %asi; \
320 stxa %l5, [%sp + STACK_BIAS + 0x28] %asi; \
321 stxa %l6, [%sp + STACK_BIAS + 0x30] %asi; \
322 stxa %l7, [%sp + STACK_BIAS + 0x38] %asi; \
323 stxa %i0, [%sp + STACK_BIAS + 0x40] %asi; \
324 stxa %i1, [%sp + STACK_BIAS + 0x48] %asi; \
325 stxa %i2, [%sp + STACK_BIAS + 0x50] %asi; \
326 stxa %i3, [%sp + STACK_BIAS + 0x58] %asi; \
327 stxa %i4, [%sp + STACK_BIAS + 0x60] %asi; \
328 stxa %i5, [%sp + STACK_BIAS + 0x68] %asi; \
329 stxa %i6, [%sp + STACK_BIAS + 0x70] %asi; \
330 stxa %i7, [%sp + STACK_BIAS + 0x78] %asi; \
333 ba,pt %xcc, etrap_save; \
335 nop; nop; nop; nop; nop; \
336 nop; nop; nop; nop; \
337 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
338 ba,a,pt %xcc, etrap_spill_fixup_64bit; \
339 ba,a,pt %xcc, etrap_spill_fixup_64bit;
341 #define SPILL_1_GENERIC_ETRAP_FIXUP \
342 etrap_spill_fixup_64bit: \
343 ldub [%g6 + TI_WSAVED], %g1; \
346 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
349 stx %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
350 stx %l1, [%g3 + TI_REG_WINDOW + 0x08]; \
351 stx %l2, [%g3 + TI_REG_WINDOW + 0x10]; \
352 stx %l3, [%g3 + TI_REG_WINDOW + 0x18]; \
353 stx %l4, [%g3 + TI_REG_WINDOW + 0x20]; \
354 stx %l5, [%g3 + TI_REG_WINDOW + 0x28]; \
355 stx %l6, [%g3 + TI_REG_WINDOW + 0x30]; \
356 stx %l7, [%g3 + TI_REG_WINDOW + 0x38]; \
357 stx %i0, [%g3 + TI_REG_WINDOW + 0x40]; \
358 stx %i1, [%g3 + TI_REG_WINDOW + 0x48]; \
359 stx %i2, [%g3 + TI_REG_WINDOW + 0x50]; \
360 stx %i3, [%g3 + TI_REG_WINDOW + 0x58]; \
361 stx %i4, [%g3 + TI_REG_WINDOW + 0x60]; \
362 stx %i5, [%g3 + TI_REG_WINDOW + 0x68]; \
363 stx %i6, [%g3 + TI_REG_WINDOW + 0x70]; \
364 stx %i7, [%g3 + TI_REG_WINDOW + 0x78]; \
366 stb %g1, [%g6 + TI_WSAVED]; \
370 ba,pt %xcc, etrap_save; \
374 /* Normal 32bit spill */
375 #define SPILL_2_GENERIC(ASI) \
377 stwa %l0, [%sp + %g0] ASI; \
379 stwa %l1, [%sp + %g3] ASI; \
380 add %sp, 0x08, %g1; \
381 stwa %l2, [%g1 + %g0] ASI; \
382 stwa %l3, [%g1 + %g3] ASI; \
383 add %g1, 0x08, %g1; \
384 stwa %l4, [%g1 + %g0] ASI; \
385 stwa %l5, [%g1 + %g3] ASI; \
386 add %g1, 0x08, %g1; \
387 stwa %l6, [%g1 + %g0] ASI; \
388 stwa %l7, [%g1 + %g3] ASI; \
389 add %g1, 0x08, %g1; \
390 stwa %i0, [%g1 + %g0] ASI; \
391 stwa %i1, [%g1 + %g3] ASI; \
392 add %g1, 0x08, %g1; \
393 stwa %i2, [%g1 + %g0] ASI; \
394 stwa %i3, [%g1 + %g3] ASI; \
395 add %g1, 0x08, %g1; \
396 stwa %i4, [%g1 + %g0] ASI; \
397 stwa %i5, [%g1 + %g3] ASI; \
398 add %g1, 0x08, %g1; \
399 stwa %i6, [%g1 + %g0] ASI; \
400 stwa %i7, [%g1 + %g3] ASI; \
403 b,a,pt %xcc, spill_fixup_dax; \
404 b,a,pt %xcc, spill_fixup_mna; \
405 b,a,pt %xcc, spill_fixup;
407 #define SPILL_2_GENERIC_ETRAP \
408 etrap_user_spill_32bit: \
410 stwa %l0, [%sp + 0x00] %asi; \
411 stwa %l1, [%sp + 0x04] %asi; \
412 stwa %l2, [%sp + 0x08] %asi; \
413 stwa %l3, [%sp + 0x0c] %asi; \
414 stwa %l4, [%sp + 0x10] %asi; \
415 stwa %l5, [%sp + 0x14] %asi; \
416 stwa %l6, [%sp + 0x18] %asi; \
417 stwa %l7, [%sp + 0x1c] %asi; \
418 stwa %i0, [%sp + 0x20] %asi; \
419 stwa %i1, [%sp + 0x24] %asi; \
420 stwa %i2, [%sp + 0x28] %asi; \
421 stwa %i3, [%sp + 0x2c] %asi; \
422 stwa %i4, [%sp + 0x30] %asi; \
423 stwa %i5, [%sp + 0x34] %asi; \
424 stwa %i6, [%sp + 0x38] %asi; \
425 stwa %i7, [%sp + 0x3c] %asi; \
428 ba,pt %xcc, etrap_save; \
430 nop; nop; nop; nop; \
431 nop; nop; nop; nop; \
432 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
433 ba,a,pt %xcc, etrap_spill_fixup_32bit; \
434 ba,a,pt %xcc, etrap_spill_fixup_32bit;
436 #define SPILL_2_GENERIC_ETRAP_FIXUP \
437 etrap_spill_fixup_32bit: \
438 ldub [%g6 + TI_WSAVED], %g1; \
441 stx %sp, [%g3 + TI_RWIN_SPTRS]; \
444 stw %l0, [%g3 + TI_REG_WINDOW + 0x00]; \
445 stw %l1, [%g3 + TI_REG_WINDOW + 0x04]; \
446 stw %l2, [%g3 + TI_REG_WINDOW + 0x08]; \
447 stw %l3, [%g3 + TI_REG_WINDOW + 0x0c]; \
448 stw %l4, [%g3 + TI_REG_WINDOW + 0x10]; \
449 stw %l5, [%g3 + TI_REG_WINDOW + 0x14]; \
450 stw %l6, [%g3 + TI_REG_WINDOW + 0x18]; \
451 stw %l7, [%g3 + TI_REG_WINDOW + 0x1c]; \
452 stw %i0, [%g3 + TI_REG_WINDOW + 0x20]; \
453 stw %i1, [%g3 + TI_REG_WINDOW + 0x24]; \
454 stw %i2, [%g3 + TI_REG_WINDOW + 0x28]; \
455 stw %i3, [%g3 + TI_REG_WINDOW + 0x2c]; \
456 stw %i4, [%g3 + TI_REG_WINDOW + 0x30]; \
457 stw %i5, [%g3 + TI_REG_WINDOW + 0x34]; \
458 stw %i6, [%g3 + TI_REG_WINDOW + 0x38]; \
459 stw %i7, [%g3 + TI_REG_WINDOW + 0x3c]; \
461 stb %g1, [%g6 + TI_WSAVED]; \
465 ba,pt %xcc, etrap_save; \
469 #define SPILL_1_NORMAL SPILL_1_GENERIC(ASI_AIUP)
470 #define SPILL_2_NORMAL SPILL_2_GENERIC(ASI_AIUP)
471 #define SPILL_3_NORMAL SPILL_0_NORMAL
472 #define SPILL_4_NORMAL SPILL_0_NORMAL
473 #define SPILL_5_NORMAL SPILL_0_NORMAL
474 #define SPILL_6_NORMAL SPILL_0_NORMAL
475 #define SPILL_7_NORMAL SPILL_0_NORMAL
477 #define SPILL_0_OTHER SPILL_0_NORMAL
478 #define SPILL_1_OTHER SPILL_1_GENERIC(ASI_AIUS)
479 #define SPILL_2_OTHER SPILL_2_GENERIC(ASI_AIUS)
480 #define SPILL_3_OTHER SPILL_3_NORMAL
481 #define SPILL_4_OTHER SPILL_4_NORMAL
482 #define SPILL_5_OTHER SPILL_5_NORMAL
483 #define SPILL_6_OTHER SPILL_6_NORMAL
484 #define SPILL_7_OTHER SPILL_7_NORMAL
486 /* Normal kernel fill */
487 #define FILL_0_NORMAL \
488 ldx [%sp + STACK_BIAS + 0x00], %l0; \
489 ldx [%sp + STACK_BIAS + 0x08], %l1; \
490 ldx [%sp + STACK_BIAS + 0x10], %l2; \
491 ldx [%sp + STACK_BIAS + 0x18], %l3; \
492 ldx [%sp + STACK_BIAS + 0x20], %l4; \
493 ldx [%sp + STACK_BIAS + 0x28], %l5; \
494 ldx [%sp + STACK_BIAS + 0x30], %l6; \
495 ldx [%sp + STACK_BIAS + 0x38], %l7; \
496 ldx [%sp + STACK_BIAS + 0x40], %i0; \
497 ldx [%sp + STACK_BIAS + 0x48], %i1; \
498 ldx [%sp + STACK_BIAS + 0x50], %i2; \
499 ldx [%sp + STACK_BIAS + 0x58], %i3; \
500 ldx [%sp + STACK_BIAS + 0x60], %i4; \
501 ldx [%sp + STACK_BIAS + 0x68], %i5; \
502 ldx [%sp + STACK_BIAS + 0x70], %i6; \
503 ldx [%sp + STACK_BIAS + 0x78], %i7; \
504 restored; retry; nop; nop; nop; nop; nop; nop; \
505 nop; nop; nop; nop; nop; nop; nop; nop;
507 #define FILL_0_NORMAL_RTRAP \
512 ldx [%sp + STACK_BIAS + 0x00], %l0; \
513 ldx [%sp + STACK_BIAS + 0x08], %l1; \
514 ldx [%sp + STACK_BIAS + 0x10], %l2; \
515 ldx [%sp + STACK_BIAS + 0x18], %l3; \
516 ldx [%sp + STACK_BIAS + 0x20], %l4; \
517 ldx [%sp + STACK_BIAS + 0x28], %l5; \
518 ldx [%sp + STACK_BIAS + 0x30], %l6; \
519 ldx [%sp + STACK_BIAS + 0x38], %l7; \
520 ldx [%sp + STACK_BIAS + 0x40], %i0; \
521 ldx [%sp + STACK_BIAS + 0x48], %i1; \
522 ldx [%sp + STACK_BIAS + 0x50], %i2; \
523 ldx [%sp + STACK_BIAS + 0x58], %i3; \
524 ldx [%sp + STACK_BIAS + 0x60], %i4; \
525 ldx [%sp + STACK_BIAS + 0x68], %i5; \
526 ldx [%sp + STACK_BIAS + 0x70], %i6; \
527 ldx [%sp + STACK_BIAS + 0x78], %i7; \
530 ba,pt %xcc, kern_rtt_restore; \
532 nop; nop; nop; nop; nop; \
536 /* Normal 64bit fill */
537 #define FILL_1_GENERIC(ASI) \
538 add %sp, STACK_BIAS + 0x00, %g1; \
539 ldxa [%g1 + %g0] ASI, %l0; \
542 ldxa [%g1 + %g2] ASI, %l1; \
544 ldxa [%g1 + %g3] ASI, %l2; \
545 ldxa [%g1 + %g5] ASI, %l3; \
546 add %g1, 0x20, %g1; \
547 ldxa [%g1 + %g0] ASI, %l4; \
548 ldxa [%g1 + %g2] ASI, %l5; \
549 ldxa [%g1 + %g3] ASI, %l6; \
550 ldxa [%g1 + %g5] ASI, %l7; \
551 add %g1, 0x20, %g1; \
552 ldxa [%g1 + %g0] ASI, %i0; \
553 ldxa [%g1 + %g2] ASI, %i1; \
554 ldxa [%g1 + %g3] ASI, %i2; \
555 ldxa [%g1 + %g5] ASI, %i3; \
556 add %g1, 0x20, %g1; \
557 ldxa [%g1 + %g0] ASI, %i4; \
558 ldxa [%g1 + %g2] ASI, %i5; \
559 ldxa [%g1 + %g3] ASI, %i6; \
560 ldxa [%g1 + %g5] ASI, %i7; \
562 retry; nop; nop; nop; nop; \
563 b,a,pt %xcc, fill_fixup_dax; \
564 b,a,pt %xcc, fill_fixup_mna; \
565 b,a,pt %xcc, fill_fixup;
567 #define FILL_1_GENERIC_RTRAP \
568 user_rtt_fill_64bit: \
569 ldxa [%sp + STACK_BIAS + 0x00] %asi, %l0; \
570 ldxa [%sp + STACK_BIAS + 0x08] %asi, %l1; \
571 ldxa [%sp + STACK_BIAS + 0x10] %asi, %l2; \
572 ldxa [%sp + STACK_BIAS + 0x18] %asi, %l3; \
573 ldxa [%sp + STACK_BIAS + 0x20] %asi, %l4; \
574 ldxa [%sp + STACK_BIAS + 0x28] %asi, %l5; \
575 ldxa [%sp + STACK_BIAS + 0x30] %asi, %l6; \
576 ldxa [%sp + STACK_BIAS + 0x38] %asi, %l7; \
577 ldxa [%sp + STACK_BIAS + 0x40] %asi, %i0; \
578 ldxa [%sp + STACK_BIAS + 0x48] %asi, %i1; \
579 ldxa [%sp + STACK_BIAS + 0x50] %asi, %i2; \
580 ldxa [%sp + STACK_BIAS + 0x58] %asi, %i3; \
581 ldxa [%sp + STACK_BIAS + 0x60] %asi, %i4; \
582 ldxa [%sp + STACK_BIAS + 0x68] %asi, %i5; \
583 ldxa [%sp + STACK_BIAS + 0x70] %asi, %i6; \
584 ldxa [%sp + STACK_BIAS + 0x78] %asi, %i7; \
585 ba,pt %xcc, user_rtt_pre_restore; \
587 nop; nop; nop; nop; nop; nop; \
588 nop; nop; nop; nop; nop; \
589 ba,a,pt %xcc, user_rtt_fill_fixup; \
590 ba,a,pt %xcc, user_rtt_fill_fixup; \
591 ba,a,pt %xcc, user_rtt_fill_fixup;
594 /* Normal 32bit fill */
595 #define FILL_2_GENERIC(ASI) \
597 lduwa [%sp + %g0] ASI, %l0; \
600 lduwa [%sp + %g2] ASI, %l1; \
602 lduwa [%sp + %g3] ASI, %l2; \
603 lduwa [%sp + %g5] ASI, %l3; \
604 add %sp, 0x10, %g1; \
605 lduwa [%g1 + %g0] ASI, %l4; \
606 lduwa [%g1 + %g2] ASI, %l5; \
607 lduwa [%g1 + %g3] ASI, %l6; \
608 lduwa [%g1 + %g5] ASI, %l7; \
609 add %g1, 0x10, %g1; \
610 lduwa [%g1 + %g0] ASI, %i0; \
611 lduwa [%g1 + %g2] ASI, %i1; \
612 lduwa [%g1 + %g3] ASI, %i2; \
613 lduwa [%g1 + %g5] ASI, %i3; \
614 add %g1, 0x10, %g1; \
615 lduwa [%g1 + %g0] ASI, %i4; \
616 lduwa [%g1 + %g2] ASI, %i5; \
617 lduwa [%g1 + %g3] ASI, %i6; \
618 lduwa [%g1 + %g5] ASI, %i7; \
620 retry; nop; nop; nop; nop; \
621 b,a,pt %xcc, fill_fixup_dax; \
622 b,a,pt %xcc, fill_fixup_mna; \
623 b,a,pt %xcc, fill_fixup;
625 #define FILL_2_GENERIC_RTRAP \
626 user_rtt_fill_32bit: \
628 lduwa [%sp + 0x00] %asi, %l0; \
629 lduwa [%sp + 0x04] %asi, %l1; \
630 lduwa [%sp + 0x08] %asi, %l2; \
631 lduwa [%sp + 0x0c] %asi, %l3; \
632 lduwa [%sp + 0x10] %asi, %l4; \
633 lduwa [%sp + 0x14] %asi, %l5; \
634 lduwa [%sp + 0x18] %asi, %l6; \
635 lduwa [%sp + 0x1c] %asi, %l7; \
636 lduwa [%sp + 0x20] %asi, %i0; \
637 lduwa [%sp + 0x24] %asi, %i1; \
638 lduwa [%sp + 0x28] %asi, %i2; \
639 lduwa [%sp + 0x2c] %asi, %i3; \
640 lduwa [%sp + 0x30] %asi, %i4; \
641 lduwa [%sp + 0x34] %asi, %i5; \
642 lduwa [%sp + 0x38] %asi, %i6; \
643 lduwa [%sp + 0x3c] %asi, %i7; \
644 ba,pt %xcc, user_rtt_pre_restore; \
646 nop; nop; nop; nop; nop; \
647 nop; nop; nop; nop; nop; \
648 ba,a,pt %xcc, user_rtt_fill_fixup; \
649 ba,a,pt %xcc, user_rtt_fill_fixup; \
650 ba,a,pt %xcc, user_rtt_fill_fixup;
653 #define FILL_1_NORMAL FILL_1_GENERIC(ASI_AIUP)
654 #define FILL_2_NORMAL FILL_2_GENERIC(ASI_AIUP)
655 #define FILL_3_NORMAL FILL_0_NORMAL
656 #define FILL_4_NORMAL FILL_0_NORMAL
657 #define FILL_5_NORMAL FILL_0_NORMAL
658 #define FILL_6_NORMAL FILL_0_NORMAL
659 #define FILL_7_NORMAL FILL_0_NORMAL
661 #define FILL_0_OTHER FILL_0_NORMAL
662 #define FILL_1_OTHER FILL_1_GENERIC(ASI_AIUS)
663 #define FILL_2_OTHER FILL_2_GENERIC(ASI_AIUS)
664 #define FILL_3_OTHER FILL_3_NORMAL
665 #define FILL_4_OTHER FILL_4_NORMAL
666 #define FILL_5_OTHER FILL_5_NORMAL
667 #define FILL_6_OTHER FILL_6_NORMAL
668 #define FILL_7_OTHER FILL_7_NORMAL
670 #endif /* !(_SPARC64_TTABLE_H) */