]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct arguments to pipe2 syscall in pipe on netbsd/arm64
authorTobias Klauser <tklauser@distanz.ch>
Tue, 29 Sep 2020 13:13:17 +0000 (15:13 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 29 Sep 2020 19:01:28 +0000 (19:01 +0000)
Follow the implementation of pipe2 to pass arguments and handle return
values.

With this fix the runtime tests pass on netbsd/arm64 (tested using
gomote on the netbsd-arm64-bsiegert builder).

Update #30824

Change-Id: I346db68fc9dde8dc7f11351af05c1ad3105f4a32
Reviewed-on: https://go-review.googlesource.com/c/go/+/258000
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/runtime/sys_netbsd_arm64.s

index f19a8b78f6a21aeb4e822b9ac219c5ed88515d1a..4d9b05478fabdc0e7914fbd13e95892baebfd6c0 100644 (file)
@@ -152,19 +152,13 @@ ok:
 
 // func pipe() (r, w int32, errno int32)
 TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVW    $0, R0
+       ADD     $8, RSP, R0
+       MOVW    $0, R1
        SVC     $SYS_pipe2
        BCC     pipeok
-       MOVW    $-1,R1
-       MOVW    R1, r+0(FP)
-       MOVW    R1, w+4(FP)
        NEG     R0, R0
-       MOVW    R0, errno+8(FP)
-       RET
 pipeok:
-       MOVW    R0, r+0(FP)
-       MOVW    R1, w+4(FP)
-       MOVW    ZR, errno+8(FP)
+       MOVW    R0, errno+8(FP)
        RET
 
 // func pipe2(flags int32) (r, w int32, errno int32)