1 /** Linux system call interface for the ARM processor.
2 * Written by Shaun Jackman <sjackman@gmail.com>.
3 * Copyright 2006 Pathway Connectivity
5 * Permission to use, copy, modify, and distribute this software
6 * is freely granted, provided that this notice is preserved.
11 #include "linux-syscall.h"
14 # define FUNC(name) .type name, %function; .thumb_func; name:
15 # define SET .thumb_set
17 # define FUNC(name) .type name, %function; name:
21 #define GLOBAL(name) .global name; FUNC(name)
22 #define SIZE(name) .size name, .-name
24 # define SYSCALL4(name) \
30 # define SYSCALL6(name) \
40 #define SYSCALL0(name) SYSCALL3(name)
41 #define SYSCALL3(name) SYSCALL4(name)
42 #define SYSCALL1(name) SYSCALL3(name)
43 #define SYSCALL2(name) SYSCALL3(name)
44 #define SYSCALL5(name) SYSCALL6(name)
68 SYSCALL2(gettimeofday)
107 #define ALIAS(name) .GLOBAL name; SET name, _ ## name
151 #if defined (__thumb__) && !defined (__thumb2__)
152 # define SOCKETCALL(name, NAME) \
155 movs r0, #SYS_ ## NAME; \
156 b _socketcall_tail; \
159 # define SOCKETCALL(name, NAME) \
162 mov r0, #SYS_ ## NAME; \
163 b _socketcall_tail; \
167 FUNC(_socketcall_tail)
173 #if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_3__) \
174 || defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__)
179 SIZE(_socketcall_tail)
181 #define SOCKETCALL2(name, NAME) SOCKETCALL(name, NAME)
182 #define SOCKETCALL3(name, NAME) SOCKETCALL(name, NAME)
183 #define SOCKETCALL4(name, NAME) SOCKETCALL(name, NAME)
184 #define SOCKETCALL5(name, NAME) SOCKETCALL(name, NAME)
185 #define SOCKETCALL6(name, NAME) SOCKETCALL(name, NAME)
187 SOCKETCALL3(accept, ACCEPT)
188 SOCKETCALL3(bind, BIND)
189 SOCKETCALL3(connect, CONNECT)
190 SOCKETCALL3(getpeername, GETPEERNAME)
191 SOCKETCALL3(getsockname, GETSOCKNAME)
192 SOCKETCALL5(getsockopt, GETSOCKOPT)
193 SOCKETCALL2(listen, LISTEN)
194 SOCKETCALL4(recv, RECV)
195 SOCKETCALL6(recvfrom, RECVFROM)
196 SOCKETCALL3(recvmsg, RECVMSG)
197 SOCKETCALL4(send, SEND)
198 SOCKETCALL3(sendmsg, SENDMSG)
199 SOCKETCALL6(sendto, SENDTO)
200 SOCKETCALL5(setsockopt, SETSOCKOPT)
201 SOCKETCALL2(shutdown, SHUTDOWN)
202 SOCKETCALL3(socket, SOCKET)
203 SOCKETCALL4(socketpair, SOCKETPAIR)