diff options
Diffstat (limited to 'src/runtime/sys_openbsd_amd64.s')
-rw-r--r-- | src/runtime/sys_openbsd_amd64.s | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/runtime/sys_openbsd_amd64.s b/src/runtime/sys_openbsd_amd64.s index fc6d5dc387..f71f5ccead 100644 --- a/src/runtime/sys_openbsd_amd64.s +++ b/src/runtime/sys_openbsd_amd64.s @@ -62,16 +62,24 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 // Transition from C ABI to Go ABI. PUSH_REGS_HOST_TO_ABI0() - // Call into the Go signal handler + // Set up ABIInternal environment: g in R14, cleared X15. + get_tls(R12) + MOVQ g(R12), R14 + PXOR X15, X15 + + // Reserve space for spill slots. NOP SP // disable vet stack checking - ADJSP $24 - MOVQ DI, 0(SP) // sig - MOVQ SI, 8(SP) // info - MOVQ DX, 16(SP) // ctx - CALL ·sigtrampgo(SB) + ADJSP $24 + + // Call into the Go signal handler + MOVQ DI, AX // sig + MOVQ SI, BX // info + MOVQ DX, CX // ctx + CALL ·sigtrampgo<ABIInternal>(SB) + ADJSP $-24 - POP_REGS_HOST_TO_ABI0() + POP_REGS_HOST_TO_ABI0() RET // |