aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/sys_linux_arm.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-03-08 14:03:56 -0500
committerRuss Cox <rsc@golang.org>2012-03-08 14:03:56 -0500
commit36aa7d4d14c1dbca2405e265b8bbf1260e9d825c (patch)
tree5cac6a56c810a4d0bec4b969664e2e04c11ce74c /src/pkg/runtime/sys_linux_arm.s
parentc978a5a3a94fbd03cfe012fbf1ac556728d7fb41 (diff)
downloadgo-36aa7d4d14c1dbca2405e265b8bbf1260e9d825c.tar.xz
runtime: inline calls to notok
When a very low-level system call that should never fail does fail, we call notok, which crashes the program. Often, we are then left with only the program counter as information about the crash, and it is in notok. Instead, inline calls to notok (it is just one instruction on most systems) so that the program counter will tell us which system call is unhappy. R=golang-dev, gri, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/5792048
Diffstat (limited to 'src/pkg/runtime/sys_linux_arm.s')
-rw-r--r--src/pkg/runtime/sys_linux_arm.s14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pkg/runtime/sys_linux_arm.s b/src/pkg/runtime/sys_linux_arm.s
index 439df3afa8..03e173d266 100644
--- a/src/pkg/runtime/sys_linux_arm.s
+++ b/src/pkg/runtime/sys_linux_arm.s
@@ -38,11 +38,6 @@
#define ARM_BASE (SYS_BASE + 0x0f0000)
#define SYS_ARM_cacheflush (ARM_BASE + 2)
-TEXT notok<>(SB),7,$0
- MOVW $0, R9
- MOVW R9, (R9)
- B 0(PC)
-
TEXT runtime·open(SB),7,$0
MOVW 0(FP), R0
MOVW 4(FP), R1
@@ -126,7 +121,8 @@ TEXT runtime·munmap(SB),7,$0
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
- BL.HI notok<>(SB)
+ MOVW.HI $0, R9 // crash on syscall failure
+ MOVW.HI R9, (R9)
RET
TEXT runtime·madvise(SB),7,$0
@@ -137,7 +133,8 @@ TEXT runtime·madvise(SB),7,$0
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
- BL.HI notok<>(SB)
+ MOVW.HI $0, R9 // crash on syscall failure
+ MOVW.HI R9, (R9)
RET
TEXT runtime·setitimer(SB),7,$0
@@ -291,7 +288,8 @@ TEXT runtime·sigaltstack(SB),7,$0
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
- BL.HI notok<>(SB)
+ MOVW.HI $0, R9 // crash on syscall failure
+ MOVW.HI R9, (R9)
RET
TEXT runtime·sigtramp(SB),7,$24