summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2022-03-16 19:21:49 -0400
committerCherry Mui <cherryyz@google.com>2022-03-17 01:29:17 +0000
commit66865363f017a8d4cb0b07d84a3a6117fcf1cd30 (patch)
tree85339add5d23206316f1b720b21e18a9d838f020 /src
parent1cfe1007cdf17ee381443cd0d8ae31962805f96e (diff)
downloadgo-git-66865363f017a8d4cb0b07d84a3a6117fcf1cd30.tar.gz
syscall: call ABI0 exitsyscall on Plan 9/AMD64
CL 376356 changes syscall.Syscall to call ABIInternal entersyscall and exitsyscall. As mentioned in the CL description, it is important to call entersyscall without ABI wrapper, but it is not important to call exitsyscall this way. In fact, it is actually problematic -- on Plan 9, syscall may clobber our fixed G register, and we did not restore it. This CL changes it back to ABI0 exitsyscall, which will restore the G register through the wrapper. Should fix Plan 9/AMD64 build. Change-Id: I1f03d553f03e7b9f36d64686f20f2b2df0a0bf79 Reviewed-on: https://go-review.googlesource.com/c/go/+/393494 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/syscall/asm_plan9_amd64.s8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syscall/asm_plan9_amd64.s b/src/syscall/asm_plan9_amd64.s
index f22db3238d..0641513f37 100644
--- a/src/syscall/asm_plan9_amd64.s
+++ b/src/syscall/asm_plan9_amd64.s
@@ -38,7 +38,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
- CALL runtime·exitsyscall<ABIInternal>(SB)
+ CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@@ -46,7 +46,7 @@ TEXT ·Syscall(SB),NOSPLIT,$168-64
JMP copyresult3
ok3:
- CALL runtime·exitsyscall<ABIInternal>(SB)
+ CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
LEAQ ·emptystring(SB), SI
copyresult3:
@@ -83,7 +83,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
MOVQ $128, sysargs1-152(SP)
MOVQ $SYS_ERRSTR, BP
SYSCALL
- CALL runtime·exitsyscall<ABIInternal>(SB)
+ CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
MOVQ sysargs-160(SP), AX
MOVQ AX, errbuf-168(SP)
CALL runtime·gostring(SB)
@@ -91,7 +91,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$168-88
JMP copyresult4
ok4:
- CALL runtime·exitsyscall<ABIInternal>(SB)
+ CALL runtime·exitsyscall(SB) // call via ABI wrapper, ensuring ABIInternal fixed registers are set
LEAQ ·emptystring(SB), SI
copyresult4: