.set at
.set reorder
+ /* Setup the lisp stack. */
move reg_OCFP, reg_CFP
move reg_CFP, reg_CSP
addu reg_CSP, reg_CFP, 32
/* Convert the return address to an offset and save it on the stack. */
subu reg_NFP, reg_LIP, reg_CODE
addu reg_NFP, OTHER_POINTER_LOWTAG
- sw reg_NFP, (reg_CFP)
+ sw reg_LRA, (reg_CFP)
sw reg_CODE, 4(reg_CFP)
sw gp, 8(reg_CFP)
move reg_NL0, v0 # reg_CFUNC
move reg_NL1, v1 # reg_NL4
- /* Clear unsaved boxed descriptor regs before allowing an interrupt */
+ /*
+ * Clear boxed descriptor registers before allowing an interrupt.
+ * We can't rely on C saving some of those registers, they might
+ * have been GCed in the meanwhile.
+ */
li reg_A0, 0 # t0
li reg_A1, 0 # t1
li reg_A2, 0 # t2
li reg_A5, 0 # t5
li reg_FDEFN, 0 # t6
li reg_LEXENV, 0 # t7
+ /*
+ * reg_NFP and reg_OCFP are pointing to fixed locations and are
+ * preserved by C.
+ */
+ li reg_LRA, 0 # s2
+ li reg_L0, 0 # s3
li reg_L1, 0 # t8
+ li reg_CODE, 0 # s8
li reg_LIP, 0 # ra
/* Turn on pseudo-atomic. */
lw reg_BSP, current_binding_stack_pointer
/* Restore LRA & CODE */
- lw reg_LIP, (reg_CFP)
+ lw reg_LRA, (reg_CFP)
lw reg_CODE, 4(reg_CFP)
- subu reg_LIP, OTHER_POINTER_LOWTAG
+ subu reg_LIP, reg_NFP, OTHER_POINTER_LOWTAG
addu reg_LIP, reg_CODE
/* Check for interrupt */
.word NIL /* arglist */
.word NIL /* type */
LEAF(undefined_tramp)
- break trap_Error
- .byte 4
- .byte UNDEFINED_FUN_ERROR
- .byte 254
- .byte (0xc0 + sc_DescriptorReg)
- .byte 1
+ .set noreorder
+ b 1f
+ break trap_Cerror
+ /* Error data length. */
+ .byte 4
+ /* Error number. */
+ .byte UNDEFINED_FUN_ERROR
+ /* Magic value 254 means a 16bit little endian value follows.
+ See debug-var-io.lisp. */
+ .byte 254
+ /* reg_FDEFN is #14. */
+ .byte ((14 << 5) + sc_DescriptorReg) % 0x100
+ .byte ((14 << 5) + sc_DescriptorReg) / 0x100
.align 2
+ .set reorder
+1: lw reg_CODE, FDEFN_FUN_OFFSET(reg_FDEFN)
+ lw reg_LIP, SIMPLE_FUN_CODE_OFFSET(reg_CODE)
+ jr reg_LIP
END(undefined_tramp)
/*
* The closure trampoline.
*/
- .align 2
+ .align 5 /* common MIPS cacheline size */
+ .word 0 /* pad 1 */
+ .word 0 /* pad 2 */
.word SIMPLE_FUN_HEADER_WIDETAG /* header */
.word closure_tramp - SIMPLE_FUN_CODE_OFFSET /* self */
.word NIL /* next */
/*
* Function-end breakpoint magic.
*/
- .align 3
+ .align 2
LEAF(fun_end_breakpoint_guts)
.set noreorder
.word RETURN_PC_HEADER_WIDETAG