aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_mipsx.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-10-21 02:04:14 -0700
committerTobias Klauser <tobias.klauser@gmail.com>2019-10-21 11:41:11 +0000
commite01e9176870d74a564cb69a70303c1c5e55c965f (patch)
tree855b0688557b348ebc3190cc8ec231c63f0cb9b9 /src/runtime/sys_linux_mipsx.s
parentd960de0b6f61a486576dbd5a49151bc6125c7010 (diff)
downloadgo-e01e9176870d74a564cb69a70303c1c5e55c965f.tar.gz
go-e01e9176870d74a564cb69a70303c1c5e55c965f.zip
runtime: use correct pipe call for mips/mips64 GNU/Linux
On MIPS, pipe returns two values rather than taking a pointer. On MIPS64, call pipe2 rather than pipe. Also, use the correct system call number for fcntl on mips64. Change-Id: Ie72acdefeb593f44cb98735fc40eac99cf73509e Reviewed-on: https://go-review.googlesource.com/c/go/+/202417 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_mipsx.s')
-rw-r--r--src/runtime/sys_linux_mipsx.s10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/runtime/sys_linux_mipsx.s b/src/runtime/sys_linux_mipsx.s
index b1cfafb4c9..77f932f50a 100644
--- a/src/runtime/sys_linux_mipsx.s
+++ b/src/runtime/sys_linux_mipsx.s
@@ -112,11 +112,19 @@ TEXT runtime·read(SB),NOSPLIT,$0-16
// func pipe() (r, w int32, errno int32)
TEXT runtime·pipe(SB),NOSPLIT,$0-12
- MOVW $r+0(FP), R4
MOVW $SYS_pipe, R2
SYSCALL
+ BEQ R7, pipeok
+ MOVW $-1, R1
+ MOVW R1, r+0(FP)
+ MOVW R1, w+4(FP)
MOVW R2, errno+8(FP)
RET
+pipeok:
+ MOVW R2, r+0(FP)
+ MOVW R3, w+4(FP)
+ MOVW R0, errno+8(FP)
+ RET
// func pipe2(flags int32) (r, w int32, errno int32)
TEXT runtime·pipe2(SB),NOSPLIT,$0-16