aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_386.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2021-04-13 23:30:19 -0400
committerAustin Clements <austin@google.com>2021-04-15 12:38:13 +0000
commit7ad496b6f5300131d6f1fbafe44ac882897889e4 (patch)
tree99f5c84ae8cebe176f35097effee24bc5e93e4bb /src/runtime/sys_linux_386.s
parentdba2eab8267599f5f59f1f586b47f31b6552938c (diff)
downloadgo-7ad496b6f5300131d6f1fbafe44ac882897889e4.tar.gz
go-7ad496b6f5300131d6f1fbafe44ac882897889e4.zip
runtime: unify C->Go ABI transitions
The previous CL introduced macros for transitions from the Windows ABI to the Go ABI. This CL does the same for SysV and uses them in almost all places where we transition from the C ABI to the Go ABI. Compared to Windows, this transition is much simpler and I didn't find any places that were getting it wrong. But this does let us unify a lot of code nicely and introduces some degree of abstraction around these ABI transitions. Change-Id: Ib6bdecafce587ce18fca4c8300fcf401284a2bcd Reviewed-on: https://go-review.googlesource.com/c/go/+/309930 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
-rw-r--r--src/runtime/sys_linux_386.s7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s
index 1e3a834812..6e7737e89f 100644
--- a/src/runtime/sys_linux_386.s
+++ b/src/runtime/sys_linux_386.s
@@ -412,6 +412,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$12-16
MOVL AX, SP
RET
+// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$28
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)
@@ -421,11 +422,11 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$28
// We don't save mxcsr or the x87 control word because sigtrampgo doesn't
// modify them.
- MOVL sig+0(FP), BX
+ MOVL (28+4)(SP), BX
MOVL BX, 0(SP)
- MOVL info+4(FP), BX
+ MOVL (28+8)(SP), BX
MOVL BX, 4(SP)
- MOVL ctx+8(FP), BX
+ MOVL (28+12)(SP), BX
MOVL BX, 8(SP)
CALL runtime·sigtrampgo(SB)