syscall, runtime/internal/syscall: always zero the higher bits of return value on linux/loong64

All loong64 syscalls return values only via R4/A0, and R5/A1 may contain unrelated
content. Always zero the second return value.

Change-Id: I62af59369bece5bd8028b937c74f4694150f7a55
Reviewed-on: https://go-review.googlesource.com/c/go/+/411615
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Guoqi Chen 2022-06-10 19:08:14 +08:00 committed by Gopher Robot
parent 937fa5000a
commit 97bfc77f38
2 changed files with 2 additions and 2 deletions

View file

@ -24,6 +24,6 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-80
RET RET
ok: ok:
MOVV R4, r1+56(FP) MOVV R4, r1+56(FP)
MOVV R5, r2+64(FP) MOVV R0, r2+64(FP) // r2 is not used. Always set to 0.
MOVV R0, errno+72(FP) MOVV R0, errno+72(FP)
RET RET

View file

@ -40,5 +40,5 @@ TEXT ·rawSyscallNoError(SB),NOSPLIT,$0-48
MOVV trap+0(FP), R11 // syscall entry MOVV trap+0(FP), R11 // syscall entry
SYSCALL SYSCALL
MOVV R4, r1+32(FP) MOVV R4, r1+32(FP)
MOVV R5, r2+40(FP) MOVV R0, r2+40(FP) // r2 is not used. Always set to 0.
RET RET