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