Commit 3a56aa0d authored by Keith Randall's avatar Keith Randall

runtime: check error codes for arm64 system calls

Unlike linux arm32, linux arm64 does not set the condition codes to indicate
whether a system call failed or not.  We must check if the return value
is in the error code range (the same as amd64 does).

Fixes runtime.TestBadOpen test.

Change-Id: I97a8b0a17b5f002a3215c535efa91d199cee3309
Reviewed-on: https://go-review.googlesource.com/9220Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent a76099f0
......@@ -72,6 +72,7 @@ TEXT runtime·closefd(SB),NOSPLIT,$-8-12
MOVW fd+0(FP), R0
MOVD $SYS_close, R8
SVC
CMN $4095, R0
BCC done
MOVW $-1, R0
done:
......@@ -84,6 +85,7 @@ TEXT runtime·write(SB),NOSPLIT,$-8-28
MOVW n+16(FP), R2
MOVD $SYS_write, R8
SVC
CMN $4095, R0
BCC done
MOVW $-1, R0
done:
......@@ -96,6 +98,7 @@ TEXT runtime·read(SB),NOSPLIT,$-8-28
MOVW n+16(FP), R2
MOVD $SYS_read, R8
SVC
CMN $4095, R0
BCC done
MOVW $-1, R0
done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment