From 87103a1ab75036530bf0757397a212ee1a9822f5 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Wed, 9 Mar 2016 15:53:03 +0000 Subject: [PATCH] syscall: add NO_LOCAL_POINTERS to syscall.exit in plan9_arm This prevents a fatal "missing stackmap" error if garbage collection occurs during exit. Also annotate argument sizes for "go vet". Change-Id: I2473e0ef6aef8f26d0bbeaee9bd8f8a52eaaf941 Reviewed-on: https://go-review.googlesource.com/20476 Reviewed-by: Brad Fitzpatrick --- src/syscall/asm_plan9_arm.s | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/syscall/asm_plan9_arm.s b/src/syscall/asm_plan9_arm.s index dd0584446d..aad515f12f 100644 --- a/src/syscall/asm_plan9_arm.s +++ b/src/syscall/asm_plan9_arm.s @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. #include "textflag.h" +#include "funcdata.h" #define SYS_SEEK 39 /* from zsysnum_plan9.go */ @@ -22,7 +23,7 @@ ok: RET //func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err ErrorString) -TEXT ·Syscall(SB),NOSPLIT,$0 +TEXT ·Syscall(SB),NOSPLIT,$0-32 BL runtime·entersyscall(SB) MOVW trap+0(FP), R0 // syscall num MOVM.IA.W (R13),[R1-R2] // pop LR and caller's LR @@ -37,7 +38,7 @@ TEXT ·Syscall(SB),NOSPLIT,$0 //func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err ErrorString) // Actually Syscall5 but the rest of the code expects it to be named Syscall6. -TEXT ·Syscall6(SB),NOSPLIT,$0 +TEXT ·Syscall6(SB),NOSPLIT,$0-44 BL runtime·entersyscall(SB) MOVW trap+0(FP), R0 // syscall num MOVM.IA.W (R13),[R1-R2] // pop LR and caller's LR @@ -51,7 +52,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$0 RET //func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) -TEXT ·RawSyscall(SB),NOSPLIT,$0 +TEXT ·RawSyscall(SB),NOSPLIT,$0-28 MOVW trap+0(FP), R0 // syscall num MOVM.IA.W (R13),[R1] // pop caller's LR SWI 0 @@ -63,7 +64,7 @@ TEXT ·RawSyscall(SB),NOSPLIT,$0 //func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) // Actually RawSyscall5 but the rest of the code expects it to be named RawSyscall6. -TEXT ·RawSyscall6(SB),NOSPLIT,$0 +TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 MOVW trap+0(FP), R0 // syscall num MOVM.IA.W (R13),[R1] // pop caller's LR SWI 0 @@ -74,7 +75,7 @@ TEXT ·RawSyscall6(SB),NOSPLIT,$0 RET //func seek(placeholder uintptr, fd int, offset int64, whence int) (newoffset int64, err string) -TEXT ·seek(SB),NOSPLIT,$0 +TEXT ·seek(SB),NOSPLIT,$0-36 MOVW $newoffset_lo+20(FP), R5 MOVW R5, placeholder+0(FP) //placeholder = dest for return value MOVW $SYS_SEEK, R0 // syscall num @@ -90,7 +91,8 @@ TEXT ·seek(SB),NOSPLIT,$0 //func exit(code int) // Import runtime·exit for cleanly exiting. -TEXT ·exit(SB),NOSPLIT,$4 +TEXT ·exit(SB),NOSPLIT,$4-4 + NO_LOCAL_POINTERS MOVW code+0(FP), R0 MOVW R0, e-4(SP) BL runtime·exit(SB) -- 2.48.1