1
0
mirror of https://github.com/golang/go synced 2024-11-23 19:00:04 -07:00

runtime: correctly negate errno value for *BSD ARM

Fixes #35037

Change-Id: I0b9bcd001556cd409994d83dabcdd6e32b001d28
Reviewed-on: https://go-review.googlesource.com/c/go/+/202441
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Ian Lance Taylor 2019-10-21 09:55:23 -07:00
parent 16f0f9c8e1
commit 4f364be08d
3 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 count
MOVW $SYS_read, R7
SWI $0
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET
@ -153,7 +153,7 @@ TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 count
MOVW $SYS_write, R7
SWI $0
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET

View File

@ -92,7 +92,7 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
MOVW p+4(FP), R1
MOVW n+8(FP), R2
SWI $SYS_read
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET
@ -125,7 +125,7 @@ TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0
MOVW p+4(FP), R1 // arg 2 - buf
MOVW n+8(FP), R2 // arg 3 - nbyte
SWI $SYS_write
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET

View File

@ -55,7 +55,7 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 - nbyte
MOVW $3, R12 // sys_read
SWI $0
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET
@ -82,7 +82,7 @@ TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0
MOVW n+8(FP), R2 // arg 3 - nbyte
MOVW $4, R12 // sys_write
SWI $0
SUB.CS $0, R0, R0 // caller expects negative errno
RSB.CS $0, R0 // caller expects negative errno
MOVW R0, ret+12(FP)
RET