Commit b2259dce authored by Hyang-Ah Hana Kim's avatar Hyang-Ah Hana Kim

runtime: add syscalls needed for android/386 logging

Update golang/go#9327.

Change-Id: I27ef973190d9ae652411caf3739414b5d46ca7d2
Reviewed-on: https://go-review.googlesource.com/16679Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
parent 05c4c6e2
......@@ -518,3 +518,34 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
MOVL $1, DX // FD_CLOEXEC
INVOKE_SYSINFO
RET
// int access(const char *name, int mode)
TEXT runtime·access(SB),NOSPLIT,$0
MOVL $33, AX // syscall - access
MOVL name+0(FP), BX
MOVL mode+4(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+8(FP)
RET
// int connect(int fd, const struct sockaddr *addr, socklen_t addrlen)
TEXT runtime·connect(SB),NOSPLIT,$0-16
// connect is implemented as socketcall(NR_socket, 3, *(rest of args))
// stack already should have fd, addr, addrlen.
MOVL $102, AX // syscall - socketcall
MOVL $3, BX // connect
LEAL fd+0(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+12(FP)
RET
// int socket(int domain, int type, int protocol)
TEXT runtime·socket(SB),NOSPLIT,$0-16
// socket is implemented as socketcall(NR_socket, 1, *(rest of args))
// stack already should have domain, type, protocol.
MOVL $102, AX // syscall - socketcall
MOVL $1, BX // socket
LEAL domain+0(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+12(FP)
RET
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment