Syscalls return `-1' on error and the representation is always
32-bits. The `$-1' literal in 64-bit assembly is always the
64-bit representation. So this change makes sure that we
always do a 32-bit comparison when checking for error.
Also makes sure that in the error case, we return a 64-bit
`-1' from runtime.seek.
Fixes the arithmetic for handling the error-string in
runtime.Syscall6.
R=golang-dev, rminnich, rsc, ality, minux.ma
CC=golang-dev
https://golang.org/cl/
7399052
SYSCALL
MOVQ AX, r1+40(SP)
MOVQ $0, r2+48(SP)
- CMPQ AX, $-1
+ CMPL AX, $-1
JNE ok3
SUBQ $16, SP
SYSCALL
MOVQ AX, r1+64(SP)
MOVQ $0, r2+72(SP)
- CMPQ AX, $-1
+ CMPL AX, $-1
JNE ok4
SUBQ $16, SP
LEAQ err+80(SP), DI
CLD
- MOVSL
- MOVSL
+ MOVSQ
+ MOVSQ
CALL runtime·exitsyscall(SB)
RET
MOVQ $SYS_SEEK, BP // syscall entry
SYSCALL
- CMPQ AX, $-1
+ CMPL AX, $-1
JNE ok6
- MOVQ AX, 40(SP) // newoffset
+ MOVQ $-1, newoffset+40(SP)
SUBQ $16, SP
CALL syscall·errstr(SB)