aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_loong64.s4
-rw-r--r--src/runtime/cgo/gcc_loong64.S7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/runtime/asm_loong64.s b/src/runtime/asm_loong64.s
index d5dc61ff68..604b1243f7 100644
--- a/src/runtime/asm_loong64.s
+++ b/src/runtime/asm_loong64.s
@@ -656,9 +656,9 @@ TEXT runtime·setg(SB), NOSPLIT, $0-8
JAL runtime·save_g(SB)
RET
-// void setg_gcc(G*); set g called from gcc with g in R19
+// void setg_gcc(G*); set g called from gcc with g in R4
TEXT setg_gcc<>(SB),NOSPLIT,$0-0
- MOVV R19, g
+ MOVV R4, g
JAL runtime·save_g(SB)
RET
diff --git a/src/runtime/cgo/gcc_loong64.S b/src/runtime/cgo/gcc_loong64.S
index 6b7668f288..c84a3715b2 100644
--- a/src/runtime/cgo/gcc_loong64.S
+++ b/src/runtime/cgo/gcc_loong64.S
@@ -34,10 +34,11 @@ crosscall1:
fst.d $f30, $r3, 136
fst.d $f31, $r3, 144
- move $r18, $r4 // save R4
- move $r19, $r6
+ // r4 = *fn, r5 = *setg_gcc, r6 = *g
+ move $r23, $r4 // save R4
+ move $r4, $r6
jirl $r1, $r5, 0 // call setg_gcc (clobbers R4)
- jirl $r1, $r18, 0 // call fn
+ jirl $r1, $r23, 0 // call fn
ld.d $r23, $r3, 8
ld.d $r24, $r3, 16