Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/fakecgo/asm_arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
MOVD F14, (13*4+8*7)(R13)
MOVD F15, (13*4+8*8)(R13)

BL runtime·load_g(SB)

// We set up the arguments to cgocallback when saving registers above.
BL runtime·cgocallback(SB)

Expand Down
1 change: 0 additions & 1 deletion internal/fakecgo/asm_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
STP (R29, R30), (8*22)(RSP)

// Initialize Go ABI environment
BL runtime·load_g(SB)
BL runtime·cgocallback(SB)

RESTORE_R19_TO_R28(8*4)
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/asm_loong64.s
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
MOVV R1, (22*8)(R3)

// Initialize Go ABI environment
JAL runtime·load_g(SB)

JAL runtime·cgocallback(SB)

RESTORE_R22_TO_R31((4*8))
Expand Down
3 changes: 0 additions & 3 deletions internal/fakecgo/asm_ppc64le.s
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
// Initialize R0 to 0 as expected by Go
MOVD $0, R0

// Load the current g.
BL runtime·load_g(SB)

// Set up arguments for cgocallback
MOVD R3, FIXED_FRAME+0(R1) // fn unsafe.Pointer
MOVD R4, FIXED_FRAME+8(R1) // a unsafe.Pointer
Expand Down
1 change: 0 additions & 1 deletion internal/fakecgo/asm_riscv64.s
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
SAVE_FPR((8*17))

// Initialize Go ABI environment
CALL runtime·load_g(SB)
CALL runtime·cgocallback(SB)

RESTORE_GPR((8*4))
Expand Down
3 changes: 0 additions & 3 deletions internal/fakecgo/asm_s390x.s
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ TEXT crosscall2(SB), NOSPLIT|NOFRAME, $0
FMOVD F14, 80(R15)
FMOVD F15, 88(R15)

// Initialize Go ABI environment.
BL runtime·load_g(SB)

MOVD R2, 8(R15) // fn unsafe.Pointer
MOVD R3, 16(R15) // a unsafe.Pointer

Expand Down
8 changes: 6 additions & 2 deletions internal/fakecgo/trampolines_ppc64le.s
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ TEXT x_cgo_bindm_trampoline(SB), NOSPLIT, $0-0

// func setg_trampoline(setg uintptr, g uintptr)
TEXT ·setg_trampoline(SB), NOSPLIT, $16-16
MOVD R31, 8(R1) // save R31 (load_g clobbers it)
MOVD R31, 8(R1) // save R31

MOVD setg+0(FP), R12
MOVD newg+8(FP), R3

MOVD R3, 16(R1) // save newg before call

MOVD R12, CTR
CALL CTR

CALL runtime·load_g(SB)
// Assign g directly instead of calling runtime·load_g
// setg_gcc has already stored newg into TLS; put it in the g register too.
MOVD 16(R1), g

MOVD 8(R1), R31
XOR R0, R0, R0
Expand Down
Loading