runtime: check for ARM syscall failures

While we are at it, also update some comments.
    Tested on Linux/ARM builder.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5696047
This commit is contained in:
Shenghou Ma 2012-02-23 15:43:14 -05:00 committed by Russ Cox
parent 7ae6872fc0
commit 1bddfb5203
1 changed files with 20 additions and 6 deletions

View File

@ -8,10 +8,7 @@
#include "zasm_GOOS_GOARCH.h"
// OABI
//#define SYS_BASE 0x00900000
// EABI
// for EABI, as we don't support OABI
#define SYS_BASE 0x0
#define SYS_exit (SYS_BASE + 1)
@ -40,6 +37,11 @@
#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
@ -104,6 +106,9 @@ TEXT runtime·mmap(SB),7,$0
MOVW 20(FP), R5
MOVW $SYS_mmap2, R7
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
RSB.HI $0, R0
RET
TEXT runtime·munmap(SB),7,$0
@ -111,6 +116,9 @@ TEXT runtime·munmap(SB),7,$0
MOVW 4(FP), R1
MOVW $SYS_munmap, R7
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
BL.HI notok<>(SB)
RET
TEXT runtime·madvise(SB),7,$0
@ -119,6 +127,9 @@ TEXT runtime·madvise(SB),7,$0
MOVW 8(FP), R2
MOVW $SYS_madvise, R7
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
BL.HI notok<>(SB)
RET
TEXT runtime·setitimer(SB),7,$0
@ -270,6 +281,9 @@ TEXT runtime·sigaltstack(SB),7,$0
MOVW 4(FP), R1
MOVW $SYS_sigaltstack, R7
SWI $0
MOVW $0xfffff001, R6
CMP R6, R0
BL.HI notok<>(SB)
RET
TEXT runtime·sigtramp(SB),7,$24
@ -333,8 +347,8 @@ TEXT runtime·usleep(SB),7,$12
SWI $0
RET
// Use kernel version instead of native armcas in ../../arm.s.
// See ../../../sync/atomic/asm_linux_arm.s for details.
// Use kernel version instead of native armcas in asm_arm.s.
// See ../sync/atomic/asm_linux_arm.s for details.
TEXT cas<>(SB),7,$0
MOVW $0xffff0fc0, PC