/* We need to check for a few things which are: * 1) The need to call schedule() because this * processes quantum is up. * 2) Pending signals for this process, if any * exist we need to call do_signal() to do * the needy. * * Else we just check if the rett would land us * in an invalid window, if so we need to grab * it off the user/kernel stack first.
*/
ret_trap_nobufwins: /* Load up the user's out registers so we can pull * a window from the stack, if necessary.
*/
LOAD_PT_INS(sp)
/* If there are already live user windows in the * set we can return from trap safely.
*/ ld [%curptr + TI_UWINMASK], %twin_tmp1
orcc %g0, %twin_tmp1, %g0
bne ret_trap_userwins_ok
nop
/* Calculate new %wim, we have to pull a register * window from the users stack.
*/
ret_trap_pull_one_window:
rd %wim, %t_wim sll %t_wim, 0x1, %twin_tmp1
rtrap_patch1: srl %t_wim, 0x7, %glob_tmp
or %glob_tmp, %twin_tmp1, %glob_tmp
rtrap_patch2: and %glob_tmp, 0xff, %glob_tmp
wr %glob_tmp, 0x0, %wim
/* Here comes the architecture specific * branch to the user stack checking routine * for return from traps.
*/
b srmmu_rett_stackchk
andcc %fp, 0x7, %g0
ret_trap_kernel: /* Will the rett land us in the invalid window? */
mov 2, %g1 sll %g1, %t_psr, %g1
rtrap_patch3: srl %g1, 8, %g2
or %g1, %g2, %g1
rd %wim, %g2
andcc %g2, %g1, %g0
be 1f ! Nope, just return from the trap sll %g2, 0x1, %g1
/* We have to grab a window before returning. */
rtrap_patch4: srl %g2, 7, %g2
or %g1, %g2, %g1
rtrap_patch5: and %g1, 0xff, %g1
wr %g1, 0x0, %wim
/* Grrr, make sure we load from the right %sp... */
LOAD_PT_ALL(sp, t_psr, t_pc, t_npc, g1)
restore %g0, %g0, %g0
LOAD_WINDOW(sp)
b 2f
save %g0, %g0, %g0
/* Reload the entire frame in case this is from a * kernel system call or whatever...
*/
1:
LOAD_PT_ALL(sp, t_psr, t_pc, t_npc, g1)
2: sethi %hi(PSR_SYSCALL), %twin_tmp1
andn %t_psr, %twin_tmp1, %t_psr
wr %t_psr, 0x0, %psr
WRITE_PAUSE
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.