3 #define ASI_BP ASI_M_BYPASS
6 .globl __switch_context, __switch_context_nosave, __exit_context, halt
10 .register %g2, #scratch
11 .register %g3, #scratch
12 .register %g6, #scratch
13 .register %g7, #scratch
16 * Switch execution context
17 * This saves registers in the stack, then
18 * switches the stack, and restores everything from the new stack.
19 * This function takes no argument. New stack pointer is
20 * taken from global variable __context, and old stack pointer
21 * is also saved to __context. This way we can just jump to
22 * this routine to get back to the original context.
25 /* XXX: totally bogus for sparc, need to save and restore all windows */
28 /* make sure caller's windows are on caller's stack */
31 /* Save everything in current stack */
33 setx __context, %g2, %g1
67 __switch_context_nosave:
68 /* Interrupts are not allowed... */
69 /* make sure caller's windows are on caller's stack */
73 setx __context, %g2, %g1
110 /* Finally, load new %pc */
115 /* Get back to the original context */
116 call __switch_context
119 /* We get here if the other context attempt to switch to this
120 * dead context. This should not happen. */