Skip to content

Commit 567ef8b

Browse files
committed
runtime: correct arguments to pipe2 syscall in pipe on netbsd/arm64
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 <[email protected]> Trust: Benny Siegert <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> Reviewed-by: Benny Siegert <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 66770f4 commit 567ef8b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/runtime/sys_netbsd_arm64.s

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,13 @@ ok:
152152

153153
// func pipe() (r, w int32, errno int32)
154154
TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
155-
MOVW $0, R0
155+
ADD $8, RSP, R0
156+
MOVW $0, R1
156157
SVC $SYS_pipe2
157158
BCC pipeok
158-
MOVW $-1,R1
159-
MOVW R1, r+0(FP)
160-
MOVW R1, w+4(FP)
161159
NEG R0, R0
162-
MOVW R0, errno+8(FP)
163-
RET
164160
pipeok:
165-
MOVW R0, r+0(FP)
166-
MOVW R1, w+4(FP)
167-
MOVW ZR, errno+8(FP)
161+
MOVW R0, errno+8(FP)
168162
RET
169163

170164
// func pipe2(flags int32) (r, w int32, errno int32)

0 commit comments

Comments
 (0)