aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgo/asm_mipsx.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/cgo/asm_mipsx.s')
-rw-r--r--src/runtime/cgo/asm_mipsx.s19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/runtime/cgo/asm_mipsx.s b/src/runtime/cgo/asm_mipsx.s
index e3090da223..1127c8beb4 100644
--- a/src/runtime/cgo/asm_mipsx.s
+++ b/src/runtime/cgo/asm_mipsx.s
@@ -6,14 +6,14 @@
#include "textflag.h"
-/*
- * void crosscall2(void (*fn)(void*, int32, uintptr), void*, int32, uintptr)
- * Save registers and call fn with two arguments.
- */
+// Called by C code generated by cmd/cgo.
+// func crosscall2(fn, a unsafe.Pointer, n int32, ctxt uintptr)
+// Saves C callee-saved registers and calls cgocallback with three arguments.
+// fn is the PC of a func(a unsafe.Pointer) function.
TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
/*
* We still need to save all callee save register as before, and then
- * push 3 args for fn (R5, R6, R7).
+ * push 3 args for fn (R4, R5, R7), skipping R6.
* Also note that at procedure entry in gc world, 4(R29) will be the
* first arg.
*/
@@ -25,9 +25,9 @@ TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
#else
SUBU $(4*14-16), R29 // For soft-float, no FPR.
#endif
- MOVW R5, (4*1)(R29)
- MOVW R6, (4*2)(R29)
- MOVW R7, (4*3)(R29)
+ MOVW R4, (4*1)(R29) // fn unsafe.Pointer
+ MOVW R5, (4*2)(R29) // a unsafe.Pointer
+ MOVW R7, (4*3)(R29) // ctxt uintptr
MOVW R16, (4*4)(R29)
MOVW R17, (4*5)(R29)
MOVW R18, (4*6)(R29)
@@ -47,7 +47,8 @@ TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
MOVD F30, (4*14+8*5)(R29)
#endif
JAL runtimeĀ·load_g(SB)
- JAL (R4)
+
+ JAL runtimeĀ·cgocallback(SB)
MOVW (4*4)(R29), R16
MOVW (4*5)(R29), R17