aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgo/asm_mips64x.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/cgo/asm_mips64x.s')
-rw-r--r--src/runtime/cgo/asm_mips64x.s19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/runtime/cgo/asm_mips64x.s b/src/runtime/cgo/asm_mips64x.s
index 1235852dbe..e51cdf3d12 100644
--- a/src/runtime/cgo/asm_mips64x.s
+++ b/src/runtime/cgo/asm_mips64x.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, 8(R29) will be the
* first arg.
*/
@@ -22,9 +22,9 @@ TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
#else
ADDV $(-8*15), R29
#endif
- MOVV R5, (8*1)(R29) // void*
- MOVW R6, (8*2)(R29) // int32
- MOVV R7, (8*3)(R29) // uintptr
+ MOVV R4, (8*1)(R29) // fn unsafe.Pointer
+ MOVV R5, (8*2)(R29) // a unsafe.Pointer
+ MOVV R7, (8*3)(R29) // ctxt uintptr
MOVV R16, (8*4)(R29)
MOVV R17, (8*5)(R29)
MOVV R18, (8*6)(R29)
@@ -52,7 +52,8 @@ TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
SRLV $32, R31, RSB
SLLV $32, RSB
JAL runtimeĀ·load_g(SB)
- JAL (R4)
+
+ JAL runtimeĀ·cgocallback(SB)
MOVV (8*4)(R29), R16
MOVV (8*5)(R29), R17