aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_mips64x.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-04-03 16:31:13 -0700
committerIan Lance Taylor <iant@golang.org>2019-10-20 21:15:55 +0000
commit3b0aa546d289390027ee1bf1a5e41f37f6131fa7 (patch)
tree631fafe6c7e524f3c27b5c58581bad68b0334390 /src/runtime/sys_linux_mips64x.s
parent504fce98ba3052135ec1f9564e06819f42cdbc86 (diff)
downloadgo-3b0aa546d289390027ee1bf1a5e41f37f6131fa7.tar.xz
runtime: define nonblockingPipe
This requires defining pipe, pipe2, and setNonblock for various platforms. The new function is currently only used on AIX. It will be used by later CLs in this series. Updates #27707 Change-Id: Id2f987b66b4c66a3ef40c22484ff1d14f58e9b31 Reviewed-on: https://go-review.googlesource.com/c/go/+/171822 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_mips64x.s')
-rw-r--r--src/runtime/sys_linux_mips64x.s34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s
index 26b619e238..37e4842f08 100644
--- a/src/runtime/sys_linux_mips64x.s
+++ b/src/runtime/sys_linux_mips64x.s
@@ -19,6 +19,7 @@
#define SYS_read 5000
#define SYS_write 5001
#define SYS_close 5003
+#define SYS_pipe 5021
#define SYS_getpid 5038
#define SYS_kill 5060
#define SYS_fcntl 5080
@@ -46,6 +47,7 @@
#define SYS_clock_gettime 5222
#define SYS_epoll_create1 5285
#define SYS_brk 5012
+#define SYS_pipe2 5287
TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0-4
MOVW code+0(FP), R4
@@ -110,6 +112,23 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
MOVW R2, ret+24(FP)
RET
+// func pipe() (r, w int32, errno int32)
+TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
+ MOVV $r+0(FP), R4
+ MOVV $SYS_pipe, R2
+ SYSCALL
+ MOVW R2, errno+8(FP)
+ RET
+
+// func pipe2(flags int32) (r, w int32, errno int32)
+TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
+ MOVV $r+8(FP), R4
+ MOVW flags+0(FP), R5
+ MOVV $SYS_pipe2, R2
+ SYSCALL
+ MOVW R2, errno+16(FP)
+ RET
+
TEXT runtime·usleep(SB),NOSPLIT,$16-4
MOVWU usec+0(FP), R3
MOVV R3, R5
@@ -454,6 +473,21 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
SYSCALL
RET
+// func runtime·setNonblock(int32 fd)
+TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
+ MOVW fd+0(FP), R4 // fd
+ MOVV $3, R5 // F_GETFL
+ MOVV $0, R6
+ MOVV $SYS_fcntl, R2
+ SYSCALL
+ MOVW $0x80, R6 // O_NONBLOCK
+ OR R2, R6
+ MOVW fd+0(FP), R4 // fd
+ MOVV $4, R5 // F_SETFL
+ MOVV $SYS_fcntl, R2
+ SYSCALL
+ RET
+
// func sbrk0() uintptr
TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
// Implemented as brk(NULL).