FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / coregrind / m_syswrap / syswrap-arm-linux.c
blob7b536e52cb2e621b94522cf4091cd3aeec16ad80
2 /*--------------------------------------------------------------------*/
3 /*--- Platform-specific syscalls stuff. syswrap-arm-linux.c -----*/
4 /*--------------------------------------------------------------------*/
6 /*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
10 Copyright (C) 2000-2017 Nicholas Nethercote
11 njn@valgrind.org
12 Copyright (C) 2008-2017 Evan Geller
13 gaze@bea.ms
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License as
17 published by the Free Software Foundation; either version 2 of the
18 License, or (at your option) any later version.
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, see <http://www.gnu.org/licenses/>.
28 The GNU General Public License is contained in the file COPYING.
31 #if defined(VGP_arm_linux)
33 #include "pub_core_basics.h"
34 #include "pub_core_vki.h"
35 #include "pub_core_vkiscnums.h"
36 #include "pub_core_threadstate.h"
37 #include "pub_core_aspacemgr.h"
38 #include "pub_core_debuglog.h"
39 #include "pub_core_libcbase.h"
40 #include "pub_core_libcassert.h"
41 #include "pub_core_libcprint.h"
42 #include "pub_core_libcproc.h"
43 #include "pub_core_libcsignal.h"
44 #include "pub_core_options.h"
45 #include "pub_core_scheduler.h"
46 #include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
47 #include "pub_core_signals.h"
48 #include "pub_core_syscall.h"
49 #include "pub_core_syswrap.h"
50 #include "pub_core_tooliface.h"
51 #include "pub_core_transtab.h" // VG_(discard_translations)
53 #include "priv_types_n_macros.h"
54 #include "priv_syswrap-generic.h" /* for decls of generic wrappers */
55 #include "priv_syswrap-linux.h" /* for decls of linux-ish wrappers */
56 #include "priv_syswrap-main.h"
59 /* ---------------------------------------------------------------------
60 clone() handling
61 ------------------------------------------------------------------ */
63 /* Call f(arg1), but first switch stacks, using 'stack' as the new
64 stack, and use 'retaddr' as f's return-to address. Also, clear all
65 the integer registers before entering f.*/
66 __attribute__((noreturn))
67 void ML_(call_on_new_stack_0_1) ( Addr stack,
68 Addr retaddr,
69 void (*f)(Word),
70 Word arg1 );
71 // r0 = stack
72 // r1 = retaddr
73 // r2 = f
74 // r3 = arg1
75 asm(
76 ".text\n"
77 ".globl vgModuleLocal_call_on_new_stack_0_1\n"
78 "vgModuleLocal_call_on_new_stack_0_1:\n"
79 " mov sp,r0\n\t" /* Stack pointer */
80 " mov lr,r1\n\t" /* Return address */
81 " mov r0,r3\n\t" /* First argument */
82 " push {r2}\n\t" /* So we can ret to the new dest */
83 " mov r1, #0\n\t" /* Clear our GPRs */
84 " mov r2, #0\n\t"
85 " mov r3, #0\n\t"
86 " mov r4, #0\n\t"
87 " mov r5, #0\n\t"
88 " mov r6, #0\n\t"
89 " mov r7, #0\n\t"
90 " mov r8, #0\n\t"
91 " mov r9, #0\n\t"
92 " mov r10, #0\n\t"
93 " mov r11, #0\n\t"
94 " mov r12, #0\n\t"
95 " pop {pc}\n\t" /* Herrre we go! */
96 ".previous\n"
100 #define __NR_CLONE VG_STRINGIFY(__NR_clone)
101 #define __NR_EXIT VG_STRINGIFY(__NR_exit)
103 // See priv_syswrap-linux.h for arg profile.
104 asm(
105 ".text\n"
106 ".globl do_syscall_clone_arm_linux\n"
107 "do_syscall_clone_arm_linux:\n"
109 /*Setup child stack */
110 " str r0, [r1, #-4]!\n"
111 " str r3, [r1, #-4]!\n"
112 " push {r4,r7}\n"
113 " mov r0, r2\n" /* arg1: flags */
114 /* r1 (arg2) is already our child's stack */
115 " ldr r2, [sp, #12]\n" // parent tid
116 " ldr r3, [sp, #16]\n" // tls
117 " ldr r4, [sp, #8]\n" // Child tid
118 " mov r7, #"__NR_CLONE"\n"
119 " svc 0x00000000\n"
120 " cmp r0, #0\n"
121 " beq 1f\n"
123 /* Parent */
124 " pop {r4,r7}\n"
125 " bx lr\n"
127 "1:\n" /*child*/
128 " mov lr, pc\n"
129 " pop {r0,pc}\n"
130 /* Retval from child is already in r0 */
131 " mov r7, #"__NR_EXIT"\n"
132 " svc 0x00000000\n"
133 /* Urh.. why did exit return? */
134 " .long 0\n"
135 " .previous\n"
138 #undef __NR_CLONE
139 #undef __NR_EXIT
141 // forward declarations
142 static SysRes sys_set_tls ( ThreadId tid, Addr tlsptr );
144 /* ---------------------------------------------------------------------
145 More thread stuff
146 ------------------------------------------------------------------ */
148 // ARM doesn't have any architecture specific thread stuff that
149 // needs to be cleaned up
150 void VG_(cleanup_thread) ( ThreadArchState* arch )
154 /* Assigns tlsptr to the guest TPIDRURO.
155 If needed for the specific hardware, really executes
156 the set_tls syscall.
158 static SysRes sys_set_tls ( ThreadId tid, Addr tlsptr )
160 VG_(threads)[tid].arch.vex.guest_TPIDRURO = tlsptr;
162 if (KernelVariantiS(KernelVariant_android_no_hw_tls,
163 VG_(clo_kernel_variant))) {
164 /* Android emulator does not provide an hw tls register.
165 So, the tls register is emulated by the kernel.
166 This emulated value is set by the __NR_ARM_set_tls syscall.
167 The emulated value must be read by the kernel helper function
168 located at 0xffff0fe0.
170 The emulated tlsptr is located at 0xffff0ff0
171 (so slightly after the kernel helper function).
172 Note that applications are not supposed to read this directly.
174 For compatibility : if there is a hw tls register, the kernel
175 will put at 0xffff0fe0 the instructions to read it, so
176 as to have old applications calling the kernel helper
177 working properly.
179 For having emulated guest TLS working correctly with
180 Valgrind, it is needed to execute the syscall to set
181 the emulated TLS value in addition to the assignment
182 of TPIDRURO.
184 Note: the below means that if we need thread local storage
185 for Valgrind host, then there will be a conflict between
186 the need of the guest tls and of the host tls.
187 If all the guest code would cleanly call 0xffff0fe0,
188 then we might maybe intercept this. However, at least
189 __libc_preinit reads directly 0xffff0ff0.
191 /* ??? might call the below if auxv->u.a_val & VKI_HWCAP_TLS ???
192 Unclear if real hardware having tls hw register sets
193 VKI_HWCAP_TLS. */
194 return VG_(do_syscall1) (__NR_ARM_set_tls, tlsptr);
195 } else {
196 return VG_(mk_SysRes_Success)( 0 );
200 /* ---------------------------------------------------------------------
201 PRE/POST wrappers for arm/Linux-specific syscalls
202 ------------------------------------------------------------------ */
204 #define PRE(name) DEFN_PRE_TEMPLATE(arm_linux, name)
205 #define POST(name) DEFN_POST_TEMPLATE(arm_linux, name)
207 /* Add prototypes for the wrappers declared here, so that gcc doesn't
208 harass us for not having prototypes. Really this is a kludge --
209 the right thing to do is to make these wrappers 'static' since they
210 aren't visible outside this file, but that requires even more macro
211 magic. */
213 DECL_TEMPLATE(arm_linux, sys_mmap2);
214 DECL_TEMPLATE(arm_linux, sys_stat64);
215 DECL_TEMPLATE(arm_linux, sys_lstat64);
216 DECL_TEMPLATE(arm_linux, sys_fstatat64);
217 DECL_TEMPLATE(arm_linux, sys_fstat64);
218 DECL_TEMPLATE(arm_linux, sys_sigreturn);
219 DECL_TEMPLATE(arm_linux, sys_rt_sigreturn);
220 DECL_TEMPLATE(arm_linux, sys_sigsuspend);
221 DECL_TEMPLATE(arm_linux, sys_set_tls);
222 DECL_TEMPLATE(arm_linux, sys_cacheflush);
223 DECL_TEMPLATE(arm_linux, sys_ptrace);
225 PRE(sys_mmap2)
227 SysRes r;
229 // Exactly like old_mmap() except:
230 // - all 6 args are passed in regs, rather than in a memory-block.
231 // - the file offset is specified in pagesize units rather than bytes,
232 // so that it can be used for files bigger than 2^32 bytes.
233 // pagesize or 4K-size units in offset? For ppc32/64-linux, this is
234 // 4K-sized. Assert that the page size is 4K here for safety.
235 vg_assert(VKI_PAGE_SIZE == 4096);
236 PRINT("sys_mmap2 ( %#lx, %lu, %lu, %lu, %lu, %lu )",
237 ARG1, ARG2, ARG3, ARG4, ARG5, ARG6 );
238 PRE_REG_READ6(long, "mmap2",
239 unsigned long, start, unsigned long, length,
240 unsigned long, prot, unsigned long, flags,
241 unsigned long, fd, unsigned long, offset);
243 r = ML_(generic_PRE_sys_mmap)( tid, ARG1, ARG2, ARG3, ARG4, ARG5,
244 4096 * (Off64T)ARG6 );
245 SET_STATUS_from_SysRes(r);
248 // XXX: lstat64/fstat64/stat64 are generic, but not necessarily
249 // applicable to every architecture -- I think only to 32-bit archs.
250 // We're going to need something like linux/core_os32.h for such
251 // things, eventually, I think. --njn
252 PRE(sys_lstat64)
254 PRINT("sys_lstat64 ( %#lx(%s), %#lx )", ARG1, (HChar*)ARG1, ARG2);
255 PRE_REG_READ2(long, "lstat64", char *, file_name, struct stat64 *, buf);
256 PRE_MEM_RASCIIZ( "lstat64(file_name)", ARG1 );
257 PRE_MEM_WRITE( "lstat64(buf)", ARG2, sizeof(struct vki_stat64) );
260 POST(sys_lstat64)
262 vg_assert(SUCCESS);
263 if (RES == 0) {
264 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
268 PRE(sys_stat64)
270 PRINT("sys_stat64 ( %#lx(%s), %#lx )", ARG1, (HChar*)ARG1, ARG2);
271 PRE_REG_READ2(long, "stat64", char *, file_name, struct stat64 *, buf);
272 PRE_MEM_RASCIIZ( "stat64(file_name)", ARG1 );
273 PRE_MEM_WRITE( "stat64(buf)", ARG2, sizeof(struct vki_stat64) );
276 POST(sys_stat64)
278 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
281 PRE(sys_fstatat64)
283 PRINT("sys_fstatat64 ( %ld, %#lx(%s), %#lx )",
284 SARG1, ARG2, (HChar*)ARG2, ARG3);
285 PRE_REG_READ3(long, "fstatat64",
286 int, dfd, char *, file_name, struct stat64 *, buf);
287 PRE_MEM_RASCIIZ( "fstatat64(file_name)", ARG2 );
288 PRE_MEM_WRITE( "fstatat64(buf)", ARG3, sizeof(struct vki_stat64) );
291 POST(sys_fstatat64)
293 POST_MEM_WRITE( ARG3, sizeof(struct vki_stat64) );
296 PRE(sys_fstat64)
298 PRINT("sys_fstat64 ( %lu, %#lx )", ARG1, ARG2);
299 PRE_REG_READ2(long, "fstat64", unsigned long, fd, struct stat64 *, buf);
300 PRE_MEM_WRITE( "fstat64(buf)", ARG2, sizeof(struct vki_stat64) );
303 POST(sys_fstat64)
305 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
308 PRE(sys_sigreturn)
310 /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
311 an explanation of what follows. */
313 PRINT("sys_sigreturn ( )");
315 vg_assert(VG_(is_valid_tid)(tid));
316 vg_assert(tid >= 1 && tid < VG_N_THREADS);
317 vg_assert(VG_(is_running_thread)(tid));
319 /* Restore register state from frame and remove it */
320 VG_(sigframe_destroy)(tid, False);
322 /* Tell the driver not to update the guest state with the "result",
323 and set a bogus result to keep it happy. */
324 *flags |= SfNoWriteResult;
325 SET_STATUS_Success(0);
327 /* Check to see if any signals arose as a result of this. */
328 *flags |= SfPollAfter;
331 PRE(sys_rt_sigreturn)
333 /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
334 an explanation of what follows. */
336 PRINT("rt_sigreturn ( )");
338 vg_assert(VG_(is_valid_tid)(tid));
339 vg_assert(tid >= 1 && tid < VG_N_THREADS);
340 vg_assert(VG_(is_running_thread)(tid));
342 /* Restore register state from frame and remove it */
343 VG_(sigframe_destroy)(tid, True);
345 /* Tell the driver not to update the guest state with the "result",
346 and set a bogus result to keep it happy. */
347 *flags |= SfNoWriteResult;
348 SET_STATUS_Success(0);
350 /* Check to see if any signals arose as a result of this. */
351 *flags |= SfPollAfter;
354 /* NB: clone of x86-linux version, and ppc32-linux has an almost
355 identical one. */
356 PRE(sys_sigsuspend)
358 /* The C library interface to sigsuspend just takes a pointer to
359 a signal mask but this system call has three arguments - the first
360 two don't appear to be used by the kernel and are always passed as
361 zero by glibc and the third is the first word of the signal mask
362 so only 32 signals are supported.
364 In fact glibc normally uses rt_sigsuspend if it is available as
365 that takes a pointer to the signal mask so supports more signals.
367 *flags |= SfMayBlock;
368 PRINT("sys_sigsuspend ( %ld, %ld, %#lx )", SARG1, SARG2, ARG3 );
369 PRE_REG_READ3(int, "sigsuspend",
370 int, history0, int, history1,
371 vki_old_sigset_t, mask);
374 /* Very much ARM specific */
376 PRE(sys_set_tls)
378 PRINT("set_tls (%lx)",ARG1);
379 PRE_REG_READ1(long, "set_tls", unsigned long, addr);
381 SET_STATUS_from_SysRes( sys_set_tls( tid, ARG1 ) );
384 PRE(sys_cacheflush)
386 PRINT("cacheflush (%lx, %#lx, %#lx)",ARG1,ARG2,ARG3);
387 PRE_REG_READ3(long, "cacheflush", void*, addrlow,void*, addrhigh,int, flags);
388 VG_(discard_translations)( (Addr)ARG1,
389 ((ULong)ARG2) - ((ULong)ARG1) + 1ULL/*paranoia*/,
390 "PRE(sys_cacheflush)" );
391 SET_STATUS_Success(0);
394 // ARG3 is only used for pointers into the traced process's address
395 // space and for offsets into the traced process's struct
396 // user_regs_struct. It is never a pointer into this process's memory
397 // space, and we should therefore not check anything it points to.
398 PRE(sys_ptrace)
400 PRINT("sys_ptrace ( %ld, %ld, %#lx, %#lx )", SARG1, SARG2, ARG3, ARG4);
401 PRE_REG_READ4(int, "ptrace",
402 long, request, long, pid, long, addr, long, data);
403 switch (ARG1) {
404 case VKI_PTRACE_PEEKTEXT:
405 case VKI_PTRACE_PEEKDATA:
406 case VKI_PTRACE_PEEKUSR:
407 PRE_MEM_WRITE( "ptrace(peek)", ARG4,
408 sizeof (long));
409 break;
410 case VKI_PTRACE_GETREGS:
411 PRE_MEM_WRITE( "ptrace(getregs)", ARG4,
412 sizeof (struct vki_user_regs_struct));
413 break;
414 case VKI_PTRACE_GETFPREGS:
415 PRE_MEM_WRITE( "ptrace(getfpregs)", ARG4,
416 sizeof (struct vki_user_fp));
417 break;
418 case VKI_PTRACE_GETWMMXREGS:
419 PRE_MEM_WRITE( "ptrace(getwmmxregs)", ARG4,
420 VKI_IWMMXT_SIZE);
421 break;
422 case VKI_PTRACE_GETCRUNCHREGS:
423 PRE_MEM_WRITE( "ptrace(getcrunchregs)", ARG4,
424 VKI_CRUNCH_SIZE);
425 break;
426 case VKI_PTRACE_GETVFPREGS:
427 PRE_MEM_WRITE( "ptrace(getvfpregs)", ARG4,
428 sizeof (struct vki_user_vfp) );
429 break;
430 case VKI_PTRACE_GETHBPREGS:
431 PRE_MEM_WRITE( "ptrace(gethbpregs)", ARG4,
432 sizeof (unsigned long) );
433 break;
434 case VKI_PTRACE_SETREGS:
435 PRE_MEM_READ( "ptrace(setregs)", ARG4,
436 sizeof (struct vki_user_regs_struct));
437 break;
438 case VKI_PTRACE_SETFPREGS:
439 PRE_MEM_READ( "ptrace(setfpregs)", ARG4,
440 sizeof (struct vki_user_fp));
441 break;
442 case VKI_PTRACE_SETWMMXREGS:
443 PRE_MEM_READ( "ptrace(setwmmxregs)", ARG4,
444 VKI_IWMMXT_SIZE);
445 break;
446 case VKI_PTRACE_SETCRUNCHREGS:
447 PRE_MEM_READ( "ptrace(setcrunchregs)", ARG4,
448 VKI_CRUNCH_SIZE);
449 break;
450 case VKI_PTRACE_SETVFPREGS:
451 PRE_MEM_READ( "ptrace(setvfpregs)", ARG4,
452 sizeof (struct vki_user_vfp));
453 break;
454 case VKI_PTRACE_SETHBPREGS:
455 PRE_MEM_READ( "ptrace(sethbpregs)", ARG4, sizeof(unsigned long));
456 break;
457 case VKI_PTRACE_GET_THREAD_AREA:
458 PRE_MEM_WRITE( "ptrace(get_thread_area)", ARG4, sizeof(unsigned long));
459 break;
460 case VKI_PTRACE_GETEVENTMSG:
461 PRE_MEM_WRITE( "ptrace(geteventmsg)", ARG4, sizeof(unsigned long));
462 break;
463 case VKI_PTRACE_GETSIGINFO:
464 PRE_MEM_WRITE( "ptrace(getsiginfo)", ARG4, sizeof(vki_siginfo_t));
465 break;
466 case VKI_PTRACE_SETSIGINFO:
467 PRE_MEM_READ( "ptrace(setsiginfo)", ARG4, sizeof(vki_siginfo_t));
468 break;
469 case VKI_PTRACE_GETREGSET:
470 ML_(linux_PRE_getregset)(tid, ARG3, ARG4);
471 break;
472 case VKI_PTRACE_SETREGSET:
473 ML_(linux_PRE_setregset)(tid, ARG3, ARG4);
474 break;
475 default:
476 break;
480 POST(sys_ptrace)
482 switch (ARG1) {
483 case VKI_PTRACE_TRACEME:
484 ML_(linux_POST_traceme)(tid);
485 break;
486 case VKI_PTRACE_PEEKTEXT:
487 case VKI_PTRACE_PEEKDATA:
488 case VKI_PTRACE_PEEKUSR:
489 POST_MEM_WRITE( ARG4, sizeof (long));
490 break;
491 case VKI_PTRACE_GETREGS:
492 POST_MEM_WRITE( ARG4, sizeof (struct vki_user_regs_struct));
493 break;
494 case VKI_PTRACE_GETFPREGS:
495 POST_MEM_WRITE( ARG4, sizeof (struct vki_user_fp));
496 break;
497 case VKI_PTRACE_GETWMMXREGS:
498 POST_MEM_WRITE( ARG4, VKI_IWMMXT_SIZE);
499 break;
500 case VKI_PTRACE_GETCRUNCHREGS:
501 POST_MEM_WRITE( ARG4, VKI_CRUNCH_SIZE);
502 break;
503 case VKI_PTRACE_GETVFPREGS:
504 POST_MEM_WRITE( ARG4, sizeof(struct vki_user_vfp));
505 break;
506 case VKI_PTRACE_GET_THREAD_AREA:
507 case VKI_PTRACE_GETHBPREGS:
508 case VKI_PTRACE_GETEVENTMSG:
509 POST_MEM_WRITE( ARG4, sizeof(unsigned long));
510 break;
511 case VKI_PTRACE_GETSIGINFO:
512 /* XXX: This is a simplification. Different parts of the
513 * siginfo_t are valid depending on the type of signal.
515 POST_MEM_WRITE( ARG4, sizeof(vki_siginfo_t));
516 break;
517 case VKI_PTRACE_GETREGSET:
518 ML_(linux_POST_getregset)(tid, ARG3, ARG4);
519 break;
520 default:
521 break;
525 #undef PRE
526 #undef POST
528 /* ---------------------------------------------------------------------
529 The arm/Linux syscall table
530 ------------------------------------------------------------------ */
532 #if 0
533 #define __NR_OABI_SYSCALL_BASE 0x900000
534 #else
535 #define __NR_OABI_SYSCALL_BASE 0x0
536 #endif
538 #define PLAX_(sysno, name) WRAPPER_ENTRY_X_(arm_linux, sysno, name)
539 #define PLAXY(sysno, name) WRAPPER_ENTRY_XY(arm_linux, sysno, name)
541 // This table maps from __NR_xxx syscall numbers (from
542 // linux/include/asm-arm/unistd.h) to the appropriate PRE/POST sys_foo()
543 // wrappers on arm (as per sys_call_table in linux/arch/arm/kernel/entry.S).
545 // For those syscalls not handled by Valgrind, the annotation indicate its
546 // arch/OS combination, eg. */* (generic), */Linux (Linux only), ?/?
547 // (unknown).
549 static SyscallTableEntry syscall_main_table[] = {
550 //zz // (restart_syscall) // 0
551 GENX_(__NR_exit, sys_exit), // 1
552 GENX_(__NR_fork, sys_fork), // 2
553 GENXY(__NR_read, sys_read), // 3
554 GENX_(__NR_write, sys_write), // 4
556 GENXY(__NR_open, sys_open), // 5
557 GENX_(__NR_close, sys_close), // 6
558 // GENXY(__NR_waitpid, sys_waitpid), // 7
559 GENXY(__NR_creat, sys_creat), // 8
560 GENX_(__NR_link, sys_link), // 9
562 GENX_(__NR_unlink, sys_unlink), // 10
563 GENX_(__NR_execve, sys_execve), // 11
564 GENX_(__NR_chdir, sys_chdir), // 12
565 GENXY(__NR_time, sys_time), // 13
566 GENX_(__NR_mknod, sys_mknod), // 14
568 GENX_(__NR_chmod, sys_chmod), // 15
569 //zz LINX_(__NR_lchown, sys_lchown16), // 16
570 // GENX_(__NR_break, sys_ni_syscall), // 17
571 //zz // (__NR_oldstat, sys_stat), // 18 (obsolete)
572 LINX_(__NR_lseek, sys_lseek), // 19
574 GENX_(__NR_getpid, sys_getpid), // 20
575 LINX_(__NR_mount, sys_mount), // 21
576 LINX_(__NR_umount, sys_oldumount), // 22
577 LINX_(__NR_setuid, sys_setuid16), // 23 ## P
578 LINX_(__NR_getuid, sys_getuid16), // 24 ## P
579 //zz
580 //zz // (__NR_stime, sys_stime), // 25 * (SVr4,SVID,X/OPEN)
581 PLAXY(__NR_ptrace, sys_ptrace), // 26
582 GENX_(__NR_alarm, sys_alarm), // 27
583 //zz // (__NR_oldfstat, sys_fstat), // 28 * L -- obsolete
584 GENX_(__NR_pause, sys_pause), // 29
586 LINX_(__NR_utime, sys_utime), // 30
587 // GENX_(__NR_stty, sys_ni_syscall), // 31
588 // GENX_(__NR_gtty, sys_ni_syscall), // 32
589 GENX_(__NR_access, sys_access), // 33
590 GENX_(__NR_nice, sys_nice), // 34
592 // GENX_(__NR_ftime, sys_ni_syscall), // 35
593 GENX_(__NR_sync, sys_sync), // 36
594 GENX_(__NR_kill, sys_kill), // 37
595 GENX_(__NR_rename, sys_rename), // 38
596 GENX_(__NR_mkdir, sys_mkdir), // 39
598 GENX_(__NR_rmdir, sys_rmdir), // 40
599 GENXY(__NR_dup, sys_dup), // 41
600 LINXY(__NR_pipe, sys_pipe), // 42
601 GENXY(__NR_times, sys_times), // 43
602 // GENX_(__NR_prof, sys_ni_syscall), // 44
603 //zz
604 GENX_(__NR_brk, sys_brk), // 45
605 LINX_(__NR_setgid, sys_setgid16), // 46
606 LINX_(__NR_getgid, sys_getgid16), // 47
607 //zz // (__NR_signal, sys_signal), // 48 */* (ANSI C)
608 LINX_(__NR_geteuid, sys_geteuid16), // 49
610 LINX_(__NR_getegid, sys_getegid16), // 50
611 GENX_(__NR_acct, sys_acct), // 51
612 LINX_(__NR_umount2, sys_umount), // 52
613 // GENX_(__NR_lock, sys_ni_syscall), // 53
614 LINXY(__NR_ioctl, sys_ioctl), // 54
616 LINXY(__NR_fcntl, sys_fcntl), // 55
617 // GENX_(__NR_mpx, sys_ni_syscall), // 56
618 GENX_(__NR_setpgid, sys_setpgid), // 57
619 // GENX_(__NR_ulimit, sys_ni_syscall), // 58
620 //zz // (__NR_oldolduname, sys_olduname), // 59 Linux -- obsolete
621 //zz
622 GENX_(__NR_umask, sys_umask), // 60
623 GENX_(__NR_chroot, sys_chroot), // 61
624 //zz // (__NR_ustat, sys_ustat) // 62 SVr4 -- deprecated
625 GENXY(__NR_dup2, sys_dup2), // 63
626 GENX_(__NR_getppid, sys_getppid), // 64
628 GENX_(__NR_getpgrp, sys_getpgrp), // 65
629 GENX_(__NR_setsid, sys_setsid), // 66
630 LINXY(__NR_sigaction, sys_sigaction), // 67
631 //zz // (__NR_sgetmask, sys_sgetmask), // 68 */* (ANSI C)
632 //zz // (__NR_ssetmask, sys_ssetmask), // 69 */* (ANSI C)
633 //zz
634 LINX_(__NR_setreuid, sys_setreuid16), // 70
635 LINX_(__NR_setregid, sys_setregid16), // 71
636 PLAX_(__NR_sigsuspend, sys_sigsuspend), // 72
637 LINXY(__NR_sigpending, sys_sigpending), // 73
638 //zz // (__NR_sethostname, sys_sethostname), // 74 */*
639 //zz
640 GENX_(__NR_setrlimit, sys_setrlimit), // 75
641 GENXY(__NR_getrlimit, sys_old_getrlimit), // 76
642 GENXY(__NR_getrusage, sys_getrusage), // 77
643 GENXY(__NR_gettimeofday, sys_gettimeofday), // 78
644 GENX_(__NR_settimeofday, sys_settimeofday), // 79
646 LINXY(__NR_getgroups, sys_getgroups16), // 80
647 LINX_(__NR_setgroups, sys_setgroups16), // 81
648 // PLAX_(__NR_select, old_select), // 82
649 GENX_(__NR_symlink, sys_symlink), // 83
650 //zz // (__NR_oldlstat, sys_lstat), // 84 -- obsolete
651 //zz
652 GENX_(__NR_readlink, sys_readlink), // 85
653 //zz // (__NR_uselib, sys_uselib), // 86 */Linux
654 //zz // (__NR_swapon, sys_swapon), // 87 */Linux
655 //zz // (__NR_reboot, sys_reboot), // 88 */Linux
656 //zz // (__NR_readdir, old_readdir), // 89 -- superseded
657 //zz
658 // _____(__NR_mmap, old_mmap), // 90
659 GENXY(__NR_munmap, sys_munmap), // 91
660 GENX_(__NR_truncate, sys_truncate), // 92
661 GENX_(__NR_ftruncate, sys_ftruncate), // 93
662 GENX_(__NR_fchmod, sys_fchmod), // 94
664 LINX_(__NR_fchown, sys_fchown16), // 95
665 GENX_(__NR_getpriority, sys_getpriority), // 96
666 GENX_(__NR_setpriority, sys_setpriority), // 97
667 // GENX_(__NR_profil, sys_ni_syscall), // 98
668 GENXY(__NR_statfs, sys_statfs), // 99
670 GENXY(__NR_fstatfs, sys_fstatfs), // 100
671 // LINX_(__NR_ioperm, sys_ioperm), // 101
672 LINXY(__NR_socketcall, sys_socketcall), // 102
673 LINXY(__NR_syslog, sys_syslog), // 103
674 GENXY(__NR_setitimer, sys_setitimer), // 104
676 GENXY(__NR_getitimer, sys_getitimer), // 105
677 GENXY(__NR_stat, sys_newstat), // 106
678 GENXY(__NR_lstat, sys_newlstat), // 107
679 GENXY(__NR_fstat, sys_newfstat), // 108
680 //zz // (__NR_olduname, sys_uname), // 109 -- obsolete
681 //zz
682 // GENX_(__NR_iopl, sys_iopl), // 110
683 LINX_(__NR_vhangup, sys_vhangup), // 111
684 // GENX_(__NR_idle, sys_ni_syscall), // 112
685 // PLAXY(__NR_vm86old, sys_vm86old), // 113 __NR_syscall... weird
686 GENXY(__NR_wait4, sys_wait4), // 114
687 //zz
688 //zz // (__NR_swapoff, sys_swapoff), // 115 */Linux
689 LINXY(__NR_sysinfo, sys_sysinfo), // 116
690 // _____(__NR_ipc, sys_ipc), // 117
691 GENX_(__NR_fsync, sys_fsync), // 118
692 PLAX_(__NR_sigreturn, sys_sigreturn), // 119 ?/Linux
694 LINX_(__NR_clone, sys_clone), // 120
695 //zz // (__NR_setdomainname, sys_setdomainname), // 121 */*(?)
696 GENXY(__NR_uname, sys_newuname), // 122
697 // PLAX_(__NR_modify_ldt, sys_modify_ldt), // 123
698 LINXY(__NR_adjtimex, sys_adjtimex), // 124
699 //zz
700 GENXY(__NR_mprotect, sys_mprotect), // 125
701 LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
702 //zz // Nb: create_module() was removed 2.4-->2.6
703 // GENX_(__NR_create_module, sys_ni_syscall), // 127
704 LINX_(__NR_init_module, sys_init_module), // 128
705 LINX_(__NR_delete_module, sys_delete_module), // 129
706 //zz
707 //zz // Nb: get_kernel_syms() was removed 2.4-->2.6
708 // GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130
709 LINX_(__NR_quotactl, sys_quotactl), // 131
710 GENX_(__NR_getpgid, sys_getpgid), // 132
711 GENX_(__NR_fchdir, sys_fchdir), // 133
712 //zz // (__NR_bdflush, sys_bdflush), // 134 */Linux
713 //zz
714 //zz // (__NR_sysfs, sys_sysfs), // 135 SVr4
715 LINX_(__NR_personality, sys_personality), // 136
716 // GENX_(__NR_afs_syscall, sys_ni_syscall), // 137
717 LINX_(__NR_setfsuid, sys_setfsuid16), // 138
718 LINX_(__NR_setfsgid, sys_setfsgid16), // 139
720 LINXY(__NR__llseek, sys_llseek), // 140
721 GENXY(__NR_getdents, sys_getdents), // 141
722 GENX_(__NR__newselect, sys_select), // 142
723 GENX_(__NR_flock, sys_flock), // 143
724 GENX_(__NR_msync, sys_msync), // 144
726 GENXY(__NR_readv, sys_readv), // 145
727 GENX_(__NR_writev, sys_writev), // 146
728 GENX_(__NR_getsid, sys_getsid), // 147
729 GENX_(__NR_fdatasync, sys_fdatasync), // 148
730 LINXY(__NR__sysctl, sys_sysctl), // 149
732 GENX_(__NR_mlock, sys_mlock), // 150
733 GENX_(__NR_munlock, sys_munlock), // 151
734 GENX_(__NR_mlockall, sys_mlockall), // 152
735 LINX_(__NR_munlockall, sys_munlockall), // 153
736 LINXY(__NR_sched_setparam, sys_sched_setparam), // 154
738 LINXY(__NR_sched_getparam, sys_sched_getparam), // 155
739 LINX_(__NR_sched_setscheduler, sys_sched_setscheduler), // 156
740 LINX_(__NR_sched_getscheduler, sys_sched_getscheduler), // 157
741 LINX_(__NR_sched_yield, sys_sched_yield), // 158
742 LINX_(__NR_sched_get_priority_max, sys_sched_get_priority_max),// 159
744 LINX_(__NR_sched_get_priority_min, sys_sched_get_priority_min),// 160
745 LINXY(__NR_sched_rr_get_interval, sys_sched_rr_get_interval), // 161
746 GENXY(__NR_nanosleep, sys_nanosleep), // 162
747 GENX_(__NR_mremap, sys_mremap), // 163
748 LINX_(__NR_setresuid, sys_setresuid16), // 164
750 LINXY(__NR_getresuid, sys_getresuid16), // 165
751 // PLAXY(__NR_vm86, sys_vm86), // 166 x86/Linux-only
752 // GENX_(__NR_query_module, sys_ni_syscall), // 167
753 GENXY(__NR_poll, sys_poll), // 168
754 //zz // (__NR_nfsservctl, sys_nfsservctl), // 169 */Linux
755 //zz
756 LINX_(__NR_setresgid, sys_setresgid16), // 170
757 LINXY(__NR_getresgid, sys_getresgid16), // 171
758 LINXY(__NR_prctl, sys_prctl), // 172
759 PLAX_(__NR_rt_sigreturn, sys_rt_sigreturn), // 173
760 LINXY(__NR_rt_sigaction, sys_rt_sigaction), // 174
762 LINXY(__NR_rt_sigprocmask, sys_rt_sigprocmask), // 175
763 LINXY(__NR_rt_sigpending, sys_rt_sigpending), // 176
764 LINXY(__NR_rt_sigtimedwait, sys_rt_sigtimedwait),// 177
765 LINXY(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo),// 178
766 LINX_(__NR_rt_sigsuspend, sys_rt_sigsuspend), // 179
768 GENXY(__NR_pread64, sys_pread64), // 180
769 GENX_(__NR_pwrite64, sys_pwrite64), // 181
770 LINX_(__NR_chown, sys_chown16), // 182
771 GENXY(__NR_getcwd, sys_getcwd), // 183
772 LINXY(__NR_capget, sys_capget), // 184
774 LINX_(__NR_capset, sys_capset), // 185
775 GENXY(__NR_sigaltstack, sys_sigaltstack), // 186
776 LINXY(__NR_sendfile, sys_sendfile), // 187
777 // GENXY(__NR_getpmsg, sys_getpmsg), // 188
778 // GENX_(__NR_putpmsg, sys_putpmsg), // 189
780 // Nb: we treat vfork as fork
781 GENX_(__NR_vfork, sys_fork), // 190
782 GENXY(__NR_ugetrlimit, sys_getrlimit), // 191
783 PLAX_(__NR_mmap2, sys_mmap2), // 192
784 GENX_(__NR_truncate64, sys_truncate64), // 193
785 GENX_(__NR_ftruncate64, sys_ftruncate64), // 194
787 PLAXY(__NR_stat64, sys_stat64), // 195
788 PLAXY(__NR_lstat64, sys_lstat64), // 196
789 PLAXY(__NR_fstat64, sys_fstat64), // 197
790 GENX_(__NR_lchown32, sys_lchown), // 198
791 GENX_(__NR_getuid32, sys_getuid), // 199
793 GENX_(__NR_getgid32, sys_getgid), // 200
794 GENX_(__NR_geteuid32, sys_geteuid), // 201
795 GENX_(__NR_getegid32, sys_getegid), // 202
796 GENX_(__NR_setreuid32, sys_setreuid), // 203
797 GENX_(__NR_setregid32, sys_setregid), // 204
799 GENXY(__NR_getgroups32, sys_getgroups), // 205
800 GENX_(__NR_setgroups32, sys_setgroups), // 206
801 GENX_(__NR_fchown32, sys_fchown), // 207
802 LINX_(__NR_setresuid32, sys_setresuid), // 208
803 LINXY(__NR_getresuid32, sys_getresuid), // 209
805 LINX_(__NR_setresgid32, sys_setresgid), // 210
806 LINXY(__NR_getresgid32, sys_getresgid), // 211
807 GENX_(__NR_chown32, sys_chown), // 212
808 GENX_(__NR_setuid32, sys_setuid), // 213
809 GENX_(__NR_setgid32, sys_setgid), // 214
811 LINX_(__NR_setfsuid32, sys_setfsuid), // 215
812 LINX_(__NR_setfsgid32, sys_setfsgid), // 216
813 LINX_(__NR_pivot_root, sys_pivot_root), // 217
814 GENXY(__NR_mincore, sys_mincore), // 218
815 GENX_(__NR_madvise, sys_madvise), // 219
817 GENXY(__NR_getdents64, sys_getdents64), // 220
818 LINXY(__NR_fcntl64, sys_fcntl64), // 221
819 // GENX_(222, sys_ni_syscall), // 222
820 // PLAXY(223, sys_syscall223), // 223 // sys_bproc?
821 LINX_(__NR_gettid, sys_gettid), // 224
823 LINX_(__NR_readahead, sys_readahead), // 225 */Linux
824 LINX_(__NR_setxattr, sys_setxattr), // 226
825 LINX_(__NR_lsetxattr, sys_lsetxattr), // 227
826 LINX_(__NR_fsetxattr, sys_fsetxattr), // 228
827 LINXY(__NR_getxattr, sys_getxattr), // 229
829 LINXY(__NR_lgetxattr, sys_lgetxattr), // 230
830 LINXY(__NR_fgetxattr, sys_fgetxattr), // 231
831 LINXY(__NR_listxattr, sys_listxattr), // 232
832 LINXY(__NR_llistxattr, sys_llistxattr), // 233
833 LINXY(__NR_flistxattr, sys_flistxattr), // 234
835 LINX_(__NR_removexattr, sys_removexattr), // 235
836 LINX_(__NR_lremovexattr, sys_lremovexattr), // 236
837 LINX_(__NR_fremovexattr, sys_fremovexattr), // 237
838 LINXY(__NR_tkill, sys_tkill), // 238 */Linux
839 LINXY(__NR_sendfile64, sys_sendfile64), // 239
841 LINXY(__NR_futex, sys_futex), // 240
842 LINX_(__NR_sched_setaffinity, sys_sched_setaffinity), // 241
843 LINXY(__NR_sched_getaffinity, sys_sched_getaffinity), // 242
844 // PLAX_(__NR_set_thread_area, sys_set_thread_area), // 243
845 // PLAX_(__NR_get_thread_area, sys_get_thread_area), // 244
847 LINXY(__NR_io_setup, sys_io_setup), // 245
848 LINX_(__NR_io_destroy, sys_io_destroy), // 246
849 LINXY(__NR_io_getevents, sys_io_getevents), // 247
850 LINX_(__NR_io_submit, sys_io_submit), // 248
851 LINXY(__NR_io_cancel, sys_io_cancel), // 249
853 // LINX_(__NR_fadvise64, sys_fadvise64), // 250 */(Linux?)
854 GENX_(251, sys_ni_syscall), // 251
855 LINX_(__NR_exit_group, sys_exit_group), // 252
856 // GENXY(__NR_lookup_dcookie, sys_lookup_dcookie), // 253
857 LINXY(__NR_epoll_create, sys_epoll_create), // 254
859 LINX_(__NR_epoll_ctl, sys_epoll_ctl), // 255
860 LINXY(__NR_epoll_wait, sys_epoll_wait), // 256
861 //zz // (__NR_remap_file_pages, sys_remap_file_pages), // 257 */Linux
862 LINX_(__NR_set_tid_address, sys_set_tid_address), // 258
863 LINXY(__NR_timer_create, sys_timer_create), // 259
865 LINXY(__NR_timer_settime, sys_timer_settime), // (timer_create+1)
866 LINXY(__NR_timer_gettime, sys_timer_gettime), // (timer_create+2)
867 LINX_(__NR_timer_getoverrun, sys_timer_getoverrun),//(timer_create+3)
868 LINX_(__NR_timer_delete, sys_timer_delete), // (timer_create+4)
869 LINX_(__NR_clock_settime, sys_clock_settime), // (timer_create+5)
871 LINXY(__NR_clock_gettime, sys_clock_gettime), // (timer_create+6)
872 LINXY(__NR_clock_getres, sys_clock_getres), // (timer_create+7)
873 LINXY(__NR_clock_nanosleep, sys_clock_nanosleep),// (timer_create+8) */*
874 GENXY(__NR_statfs64, sys_statfs64), // 268
875 GENXY(__NR_fstatfs64, sys_fstatfs64), // 269
877 LINX_(__NR_tgkill, sys_tgkill), // 270 */Linux
878 GENX_(__NR_utimes, sys_utimes), // 271
879 GENX_(__NR_vserver, sys_ni_syscall), // 273
880 LINX_(__NR_mbind, sys_mbind), // 274 ?/?
882 LINXY(__NR_get_mempolicy, sys_get_mempolicy), // 275 ?/?
883 LINX_(__NR_set_mempolicy, sys_set_mempolicy), // 276 ?/?
884 LINXY(__NR_mq_open, sys_mq_open), // 277
885 LINX_(__NR_mq_unlink, sys_mq_unlink), // (mq_open+1)
886 LINX_(__NR_mq_timedsend, sys_mq_timedsend), // (mq_open+2)
888 LINXY(__NR_mq_timedreceive, sys_mq_timedreceive),// (mq_open+3)
889 LINX_(__NR_mq_notify, sys_mq_notify), // (mq_open+4)
890 LINXY(__NR_mq_getsetattr, sys_mq_getsetattr), // (mq_open+5)
891 LINXY(__NR_waitid, sys_waitid), // 280
893 LINXY(__NR_socket, sys_socket), // 281
894 LINX_(__NR_bind, sys_bind), // 282
895 LINX_(__NR_connect, sys_connect), // 283
896 LINX_(__NR_listen, sys_listen), // 284
897 LINXY(__NR_accept, sys_accept), // 285
898 LINXY(__NR_getsockname, sys_getsockname), // 286
899 LINXY(__NR_getpeername, sys_getpeername), // 287
900 LINXY(__NR_socketpair, sys_socketpair), // 288
901 LINX_(__NR_send, sys_send),
902 LINX_(__NR_sendto, sys_sendto), // 290
903 LINXY(__NR_recv, sys_recv),
904 LINXY(__NR_recvfrom, sys_recvfrom), // 292
905 LINX_(__NR_shutdown, sys_shutdown), // 293
906 LINX_(__NR_setsockopt, sys_setsockopt), // 294
907 LINXY(__NR_getsockopt, sys_getsockopt), // 295
908 LINX_(__NR_sendmsg, sys_sendmsg), // 296
909 LINXY(__NR_recvmsg, sys_recvmsg), // 297
910 LINX_(__NR_semop, sys_semop), // 298
911 LINX_(__NR_semget, sys_semget), // 299
912 LINXY(__NR_semctl, sys_semctl), // 300
913 LINX_(__NR_msgget, sys_msgget),
914 LINX_(__NR_msgsnd, sys_msgsnd),
915 LINXY(__NR_msgrcv, sys_msgrcv),
916 LINXY(__NR_msgctl, sys_msgctl), // 304
917 LINX_(__NR_semtimedop, sys_semtimedop), // 312
919 LINX_(__NR_add_key, sys_add_key), // 286
920 LINX_(__NR_request_key, sys_request_key), // 287
921 LINXY(__NR_keyctl, sys_keyctl), // not 288...
922 // LINX_(__NR_ioprio_set, sys_ioprio_set), // 289
924 // LINX_(__NR_ioprio_get, sys_ioprio_get), // 290
925 LINXY(__NR_inotify_init, sys_inotify_init), // 291
926 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 292
927 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 293
928 // LINX_(__NR_migrate_pages, sys_migrate_pages), // 294
930 LINXY(__NR_openat, sys_openat), // 295
931 LINX_(__NR_mkdirat, sys_mkdirat), // 296
932 LINX_(__NR_mknodat, sys_mknodat), // 297
933 LINX_(__NR_fchownat, sys_fchownat), // 298
934 LINX_(__NR_futimesat, sys_futimesat), // 326 on arm
936 PLAXY(__NR_fstatat64, sys_fstatat64), // 300
937 LINX_(__NR_unlinkat, sys_unlinkat), // 301
938 LINX_(__NR_renameat, sys_renameat), // 302
939 LINX_(__NR_linkat, sys_linkat), // 303
940 LINX_(__NR_symlinkat, sys_symlinkat), // 304
942 LINX_(__NR_readlinkat, sys_readlinkat), //
943 LINX_(__NR_fchmodat, sys_fchmodat), //
944 LINX_(__NR_faccessat, sys_faccessat), //
945 LINXY(__NR_shmat, sys_shmat), //305
946 LINXY(__NR_shmdt, sys_shmdt), //306
947 LINX_(__NR_shmget, sys_shmget), //307
948 LINXY(__NR_shmctl, sys_shmctl), // 308
949 // LINX_(__NR_pselect6, sys_pselect6), //
951 LINX_(__NR_unshare, sys_unshare), // 310
952 LINX_(__NR_set_robust_list, sys_set_robust_list), // 311
953 LINXY(__NR_get_robust_list, sys_get_robust_list), // 312
954 // LINX_(__NR_splice, sys_ni_syscall), // 313
955 // LINX_(__NR_sync_file_range, sys_sync_file_range), // 314
957 // LINX_(__NR_tee, sys_ni_syscall), // 315
958 // LINX_(__NR_vmsplice, sys_ni_syscall), // 316
959 LINXY(__NR_move_pages, sys_move_pages), // 317
961 LINX_(__NR_utimensat, sys_utimensat), // 320
962 LINXY(__NR_signalfd, sys_signalfd), // 321
963 LINXY(__NR_timerfd_create, sys_timerfd_create), // 322
964 LINXY(__NR_eventfd, sys_eventfd), // 323
966 LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 325
967 LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 326
969 ///////////////
971 // JRS 2010-Jan-03: I believe that all the numbers listed
972 // in comments in the table prior to this point (eg "// 326",
973 // etc) are bogus since it looks to me like they are copied
974 // verbatim from syswrap-x86-linux.c and they certainly do not
975 // correspond to what's in include/vki/vki-scnums-arm-linux.h.
976 // From here onwards, please ensure the numbers are correct.
978 LINX_(__NR_arm_fadvise64_64, sys_fadvise64_64), // 270 */(Linux?)
980 LINXY(__NR_pselect6, sys_pselect6), // 335
981 LINXY(__NR_ppoll, sys_ppoll), // 336
983 LINXY(__NR_getcpu, sys_getcpu), // 345
984 LINXY(__NR_epoll_pwait, sys_epoll_pwait), // 346
986 LINX_(__NR_fallocate, sys_fallocate), // 352
988 LINXY(__NR_signalfd4, sys_signalfd4), // 355
989 LINXY(__NR_eventfd2, sys_eventfd2), // 356
990 LINXY(__NR_epoll_create1, sys_epoll_create1), // 357
991 LINXY(__NR_dup3, sys_dup3), // 358
992 LINXY(__NR_pipe2, sys_pipe2), // 359
993 LINXY(__NR_inotify_init1, sys_inotify_init1), // 360
994 LINXY(__NR_preadv, sys_preadv), // 361
995 LINX_(__NR_pwritev, sys_pwritev), // 362
996 LINXY(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo),// 363
997 LINXY(__NR_perf_event_open, sys_perf_event_open), // 364
998 LINXY(__NR_recvmmsg, sys_recvmmsg), // 365
999 LINXY(__NR_accept4, sys_accept4), // 366
1000 LINXY(__NR_fanotify_init, sys_fanotify_init), // 367
1001 LINX_(__NR_fanotify_mark, sys_fanotify_mark), // 368
1002 LINXY(__NR_prlimit64, sys_prlimit64), // 369
1003 LINXY(__NR_name_to_handle_at, sys_name_to_handle_at),// 370
1004 LINXY(__NR_open_by_handle_at, sys_open_by_handle_at),// 371
1005 LINXY(__NR_clock_adjtime, sys_clock_adjtime), // 372
1006 LINX_(__NR_syncfs, sys_syncfs), // 373
1007 LINXY(__NR_sendmmsg, sys_sendmmsg), // 374
1008 LINX_(__NR_setns, sys_setns), // 375
1009 LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 376
1010 LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 377
1012 LINX_(__NR_sched_setattr, sys_sched_setattr), // 380
1013 LINXY(__NR_sched_getattr, sys_sched_getattr), // 381
1014 LINX_(__NR_renameat2, sys_renameat2), // 382
1016 LINXY(__NR_getrandom, sys_getrandom), // 384
1017 LINXY(__NR_memfd_create, sys_memfd_create), // 385
1019 LINX_(__NR_execveat, sys_execveat), // 387
1021 LINX_(__NR_membarrier, sys_membarrier), // 389
1022 GENX_(__NR_mlock2, sys_mlock2), // 390
1023 LINX_(__NR_copy_file_range, sys_copy_file_range), // 391
1024 LINXY(__NR_preadv2, sys_preadv2), // 392
1025 LINX_(__NR_pwritev2, sys_pwritev2), // 393
1027 LINXY(__NR_statx, sys_statx), // 397
1028 GENX_(__NR_rseq, sys_ni_syscall), // 398
1030 LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403
1031 LINX_(__NR_clock_settime64, sys_clock_settime64), // 404
1033 LINXY(__NR_clock_getres_time64, sys_clock_getres_time64), // 406
1034 LINXY(__NR_clock_nanosleep_time64, sys_clock_nanosleep_time64), // 407
1035 LINXY(__NR_timer_gettime64, sys_timer_gettime64), // 408
1036 LINXY(__NR_timer_settime64, sys_timer_settime64), // 409
1037 LINXY(__NR_timerfd_gettime64, sys_timerfd_gettime64),// 410
1038 LINXY(__NR_timerfd_settime64, sys_timerfd_settime64),// 411
1039 LINX_(__NR_utimensat_time64, sys_utimensat_time64), // 412
1040 LINXY(__NR_pselect6_time64, sys_pselect6_time64), // 413
1041 LINXY(__NR_ppoll_time64, sys_ppoll_time64), // 414
1043 LINXY(__NR_recvmmsg_time64, sys_recvmmsg_time64), // 417
1044 LINX_(__NR_mq_timedsend_time64, sys_mq_timedsend_time64), // 418
1045 LINXY(__NR_mq_timedreceive_time64, sys_mq_timedreceive_time64), // 419
1046 LINX_(__NR_semtimedop_time64, sys_semtimedop_time64),// 420
1047 LINXY(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait_time64), // 421
1048 LINXY(__NR_futex_time64, sys_futex_time64), // 422
1049 LINXY(__NR_sched_rr_get_interval_time64,
1050 sys_sched_rr_get_interval_time64), // 423
1052 LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
1053 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
1054 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
1056 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
1057 GENX_(__NR_clone3, sys_ni_syscall), // 435
1058 LINXY(__NR_close_range, sys_close_range), // 436
1059 LINXY(__NR_openat2, sys_openat2), // 437
1060 LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), // 438
1061 LINX_(__NR_faccessat2, sys_faccessat2), // 439
1063 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441
1065 LINX_(__NR_fchmodat2, sys_fchmodat2), // 452
1069 /* These are not in the main table because there indexes are not small
1070 integers, but rather values close to one million. So their
1071 inclusion would force the main table to be huge (about 8 MB). */
1073 static SyscallTableEntry ste___ARM_set_tls
1074 = { WRAPPER_PRE_NAME(arm_linux,sys_set_tls), NULL };
1076 static SyscallTableEntry ste___ARM_cacheflush
1077 = { WRAPPER_PRE_NAME(arm_linux,sys_cacheflush), NULL };
1079 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
1081 const UInt syscall_main_table_size
1082 = sizeof(syscall_main_table) / sizeof(syscall_main_table[0]);
1084 /* Is it in the contiguous initial section of the table? */
1085 if (sysno < syscall_main_table_size) {
1086 SyscallTableEntry* sys = &syscall_main_table[sysno];
1087 if (sys->before == NULL)
1088 return NULL; /* no entry */
1089 else
1090 return sys;
1093 /* Check if it's one of the out-of-line entries. */
1094 switch (sysno) {
1095 case __NR_ARM_set_tls: return &ste___ARM_set_tls;
1096 case __NR_ARM_cacheflush: return &ste___ARM_cacheflush;
1097 default: break;
1100 /* Can't find a wrapper */
1101 return NULL;
1104 #endif // defined(VGP_arm_linux)
1106 /*--------------------------------------------------------------------*/
1107 /*--- end syswrap-arm-linux.c ---*/
1108 /*--------------------------------------------------------------------*/