aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_mips64x.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/asm_mips64x.s')
-rw-r--r--src/runtime/asm_mips64x.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/runtime/asm_mips64x.s b/src/runtime/asm_mips64x.s
index b2e2384c36..f3ac453d99 100644
--- a/src/runtime/asm_mips64x.s
+++ b/src/runtime/asm_mips64x.s
@@ -384,6 +384,22 @@ CALLFN(·call1073741824, 1073741824)
TEXT runtime·procyield(SB),NOSPLIT,$0-0
RET
+// void jmpdefer(fv, sp);
+// called from deferreturn.
+// 1. grab stored LR for caller
+// 2. sub 8 bytes to get back to JAL deferreturn
+// 3. JMP to fn
+TEXT runtime·jmpdefer(SB), NOSPLIT|NOFRAME, $0-16
+ MOVV 0(R29), R31
+ ADDV $-8, R31
+
+ MOVV fv+0(FP), REGCTXT
+ MOVV argp+8(FP), R29
+ ADDV $-8, R29
+ NOR R0, R0 // prevent scheduling
+ MOVV 0(REGCTXT), R4
+ JMP (R4)
+
// Save state of caller into g->sched,
// but using fake PC from systemstack_switch.
// Must only be called from functions with no locals ($0)