FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / coregrind / m_syswrap / syswrap-ppc32-linux.c
blob74ba68564cd83676d24db72758359c3b254f1a53
2 /*--------------------------------------------------------------------*/
3 /*--- Platform-specific syscalls stuff. syswrap-ppc32-linux.c ---*/
4 /*--------------------------------------------------------------------*/
6 /*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
10 Copyright (C) 2005-2017 Nicholas Nethercote <njn@valgrind.org>
11 Copyright (C) 2005-2017 Cerion Armour-Brown <cerion@open-works.co.uk>
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
29 #if defined(VGP_ppc32_linux)
31 #include "pub_core_basics.h"
32 #include "pub_core_vki.h"
33 #include "pub_core_vkiscnums.h"
34 #include "pub_core_threadstate.h"
35 #include "pub_core_aspacemgr.h"
36 #include "pub_core_debuglog.h"
37 #include "pub_core_libcbase.h"
38 #include "pub_core_libcassert.h"
39 #include "pub_core_libcprint.h"
40 #include "pub_core_libcproc.h"
41 #include "pub_core_libcsignal.h"
42 #include "pub_core_options.h"
43 #include "pub_core_scheduler.h"
44 #include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
45 #include "pub_core_signals.h"
46 #include "pub_core_syscall.h"
47 #include "pub_core_syswrap.h"
48 #include "pub_core_tooliface.h"
50 #include "priv_types_n_macros.h"
51 #include "priv_syswrap-generic.h" /* for decls of generic wrappers */
52 #include "priv_syswrap-linux.h" /* for decls of linux-ish wrappers */
53 #include "priv_syswrap-main.h"
56 /* ---------------------------------------------------------------------
57 clone() handling
58 ------------------------------------------------------------------ */
60 /* Call f(arg1), but first switch stacks, using 'stack' as the new
61 stack, and use 'retaddr' as f's return-to address. Also, clear all
62 the integer registers before entering f.*/
63 __attribute__((noreturn))
64 void ML_(call_on_new_stack_0_1) ( Addr stack,
65 Addr retaddr,
66 void (*f)(Word),
67 Word arg1 );
68 // r3 = stack
69 // r4 = retaddr
70 // r5 = f
71 // r6 = arg1
72 asm(
73 ".text\n"
74 ".globl vgModuleLocal_call_on_new_stack_0_1\n"
75 "vgModuleLocal_call_on_new_stack_0_1:\n"
76 " mr %r1,%r3\n\t" // stack to %sp
77 " mtlr %r4\n\t" // retaddr to %lr
78 " mtctr %r5\n\t" // f to count reg
79 " mr %r3,%r6\n\t" // arg1 to %r3
80 " li 0,0\n\t" // zero all GP regs
81 " li 4,0\n\t"
82 " li 5,0\n\t"
83 " li 6,0\n\t"
84 " li 7,0\n\t"
85 " li 8,0\n\t"
86 " li 9,0\n\t"
87 " li 10,0\n\t"
88 " li 11,0\n\t"
89 " li 12,0\n\t"
90 " li 13,0\n\t"
91 " li 14,0\n\t"
92 " li 15,0\n\t"
93 " li 16,0\n\t"
94 " li 17,0\n\t"
95 " li 18,0\n\t"
96 " li 19,0\n\t"
97 " li 20,0\n\t"
98 " li 21,0\n\t"
99 " li 22,0\n\t"
100 " li 23,0\n\t"
101 " li 24,0\n\t"
102 " li 25,0\n\t"
103 " li 26,0\n\t"
104 " li 27,0\n\t"
105 " li 28,0\n\t"
106 " li 29,0\n\t"
107 " li 30,0\n\t"
108 " li 31,0\n\t"
109 " mtxer 0\n\t" // CAB: Need this?
110 " mtcr 0\n\t" // CAB: Need this?
111 " bctr\n\t" // jump to dst
112 " trap\n" // should never get here
113 ".previous\n"
118 Perform a clone system call. clone is strange because it has
119 fork()-like return-twice semantics, so it needs special
120 handling here.
122 Upon entry, we have:
124 int (fn)(void*) in r3
125 void* child_stack in r4
126 int flags in r5
127 void* arg in r6
128 pid_t* child_tid in r7
129 pid_t* parent_tid in r8
130 void* ??? in r9
132 System call requires:
134 int $__NR_clone in r0 (sc number)
135 int flags in r3 (sc arg1)
136 void* child_stack in r4 (sc arg2)
137 pid_t* parent_tid in r5 (sc arg3)
138 ?? child_tls in r6 (sc arg4)
139 pid_t* child_tid in r7 (sc arg5)
140 void* ??? in r8 (sc arg6)
142 Returns an Int encoded in the linux-ppc32 way, not a SysRes.
144 #define __NR_CLONE VG_STRINGIFY(__NR_clone)
145 #define __NR_EXIT VG_STRINGIFY(__NR_exit)
147 // See priv_syswrap-linux.h for arg profile.
148 asm(
149 ".text\n"
150 ".globl do_syscall_clone_ppc32_linux\n"
151 "do_syscall_clone_ppc32_linux:\n"
152 " stwu 1,-32(1)\n"
153 " stw 29,20(1)\n"
154 " stw 30,24(1)\n"
155 " stw 31,28(1)\n"
156 " mr 30,3\n" // preserve fn
157 " mr 31,6\n" // preserve arg
159 // setup child stack
160 " rlwinm 4,4,0,~0xf\n" // trim sp to multiple of 16 bytes
161 " li 0,0\n"
162 " stwu 0,-16(4)\n" // make initial stack frame
163 " mr 29,4\n" // preserve sp
165 // setup syscall
166 " li 0,"__NR_CLONE"\n" // syscall number
167 " mr 3,5\n" // syscall arg1: flags
168 // r4 already setup // syscall arg2: child_stack
169 " mr 5,8\n" // syscall arg3: parent_tid
170 " mr 6,2\n" // syscall arg4: REAL THREAD tls
171 " mr 7,7\n" // syscall arg5: child_tid
172 " mr 8,8\n" // syscall arg6: ????
173 " mr 9,9\n" // syscall arg7: ????
175 " sc\n" // clone()
177 " mfcr 4\n" // return CR in r4 (low word of ULong)
178 " cmpwi 3,0\n" // child if retval == 0
179 " bne 1f\n" // jump if !child
181 /* CHILD - call thread function */
182 /* Note: 2.4 kernel doesn't set the child stack pointer,
183 so we do it here.
184 That does leave a small window for a signal to be delivered
185 on the wrong stack, unfortunately. */
186 " mr 1,29\n"
187 " mtctr 30\n" // ctr reg = fn
188 " mr 3,31\n" // r3 = arg
189 " bctrl\n" // call fn()
191 // exit with result
192 " li 0,"__NR_EXIT"\n"
193 " sc\n"
195 // Exit returned?!
196 " .long 0\n"
198 // PARENT or ERROR - return
199 "1: lwz 29,20(1)\n"
200 " lwz 30,24(1)\n"
201 " lwz 31,28(1)\n"
202 " addi 1,1,32\n"
203 " blr\n"
204 ".previous\n"
207 #undef __NR_CLONE
208 #undef __NR_EXIT
211 /* ---------------------------------------------------------------------
212 More thread stuff
213 ------------------------------------------------------------------ */
215 void VG_(cleanup_thread) ( ThreadArchState* arch )
219 /* ---------------------------------------------------------------------
220 PRE/POST wrappers for ppc32/Linux-specific syscalls
221 ------------------------------------------------------------------ */
223 #define PRE(name) DEFN_PRE_TEMPLATE(ppc32_linux, name)
224 #define POST(name) DEFN_POST_TEMPLATE(ppc32_linux, name)
226 /* Add prototypes for the wrappers declared here, so that gcc doesn't
227 harass us for not having prototypes. Really this is a kludge --
228 the right thing to do is to make these wrappers 'static' since they
229 aren't visible outside this file, but that requires even more macro
230 magic. */
232 DECL_TEMPLATE(ppc32_linux, sys_mmap);
233 DECL_TEMPLATE(ppc32_linux, sys_mmap2);
234 DECL_TEMPLATE(ppc32_linux, sys_stat64);
235 DECL_TEMPLATE(ppc32_linux, sys_lstat64);
236 DECL_TEMPLATE(ppc32_linux, sys_fstatat64);
237 DECL_TEMPLATE(ppc32_linux, sys_fstat64);
238 DECL_TEMPLATE(ppc32_linux, sys_sigreturn);
239 DECL_TEMPLATE(ppc32_linux, sys_rt_sigreturn);
240 DECL_TEMPLATE(ppc32_linux, sys_sigsuspend);
241 DECL_TEMPLATE(ppc32_linux, sys_spu_create);
242 DECL_TEMPLATE(ppc32_linux, sys_spu_run);
244 PRE(sys_mmap)
246 SysRes r;
248 PRINT("sys_mmap ( %#lx, %lu, %lu, %lu, %lu, %lu )",
249 ARG1, ARG2, ARG3, ARG4, ARG5, ARG6 );
250 PRE_REG_READ6(long, "mmap",
251 unsigned long, start, unsigned long, length,
252 unsigned long, prot, unsigned long, flags,
253 unsigned long, fd, unsigned long, offset);
255 r = ML_(generic_PRE_sys_mmap)( tid, ARG1, ARG2, ARG3, ARG4, ARG5,
256 (Off64T)ARG6 );
257 SET_STATUS_from_SysRes(r);
260 PRE(sys_mmap2)
262 SysRes r;
264 // Exactly like old_mmap() except:
265 // - the file offset is specified in 4K units rather than bytes,
266 // so that it can be used for files bigger than 2^32 bytes.
267 PRINT("sys_mmap2 ( %#lx, %lu, %lu, %lu, %lu, %lu )",
268 ARG1, ARG2, ARG3, ARG4, ARG5, ARG6 );
269 PRE_REG_READ6(long, "mmap2",
270 unsigned long, start, unsigned long, length,
271 unsigned long, prot, unsigned long, flags,
272 unsigned long, fd, unsigned long, offset);
274 r = ML_(generic_PRE_sys_mmap)( tid, ARG1, ARG2, ARG3, ARG4, ARG5,
275 4096 * (Off64T)ARG6 );
276 SET_STATUS_from_SysRes(r);
279 // XXX: lstat64/fstat64/stat64 are generic, but not necessarily
280 // applicable to every architecture -- I think only to 32-bit archs.
281 // We're going to need something like linux/core_os32.h for such
282 // things, eventually, I think. --njn
283 PRE(sys_stat64)
285 PRINT("sys_stat64 ( %#lx, %#lx )",ARG1,ARG2);
286 PRE_REG_READ2(long, "stat64", char *, file_name, struct stat64 *, buf);
287 PRE_MEM_RASCIIZ( "stat64(file_name)", ARG1 );
288 PRE_MEM_WRITE( "stat64(buf)", ARG2, sizeof(struct vki_stat64) );
291 POST(sys_stat64)
293 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
296 PRE(sys_lstat64)
298 PRINT("sys_lstat64 ( %#lx(%s), %#lx )", ARG1, (HChar*)ARG1, ARG2);
299 PRE_REG_READ2(long, "lstat64", char *, file_name, struct stat64 *, buf);
300 PRE_MEM_RASCIIZ( "lstat64(file_name)", ARG1 );
301 PRE_MEM_WRITE( "lstat64(buf)", ARG2, sizeof(struct vki_stat64) );
304 POST(sys_lstat64)
306 vg_assert(SUCCESS);
307 if (RES == 0) {
308 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
312 PRE(sys_fstatat64)
314 PRINT("sys_fstatat64 ( %ld, %#lx(%s), %#lx )", SARG1, ARG2, (HChar*)ARG2,
315 ARG3);
316 PRE_REG_READ3(long, "fstatat64",
317 int, dfd, char *, file_name, struct stat64 *, buf);
318 PRE_MEM_RASCIIZ( "fstatat64(file_name)", ARG2 );
319 PRE_MEM_WRITE( "fstatat64(buf)", ARG3, sizeof(struct vki_stat64) );
322 POST(sys_fstatat64)
324 POST_MEM_WRITE( ARG3, sizeof(struct vki_stat64) );
327 PRE(sys_fstat64)
329 PRINT("sys_fstat64 ( %lu, %#lx )", ARG1, ARG2);
330 PRE_REG_READ2(long, "fstat64", unsigned long, fd, struct stat64 *, buf);
331 PRE_MEM_WRITE( "fstat64(buf)", ARG2, sizeof(struct vki_stat64) );
334 POST(sys_fstat64)
336 POST_MEM_WRITE( ARG2, sizeof(struct vki_stat64) );
341 //.. PRE(old_select, MayBlock)
342 //.. {
343 //.. /* struct sel_arg_struct {
344 //.. unsigned long n;
345 //.. fd_set *inp, *outp, *exp;
346 //.. struct timeval *tvp;
347 //.. };
348 //.. */
349 //.. PRE_REG_READ1(long, "old_select", struct sel_arg_struct *, args);
350 //.. PRE_MEM_READ( "old_select(args)", ARG1, 5*sizeof(UWord) );
351 //..
352 //.. {
353 //.. UInt* arg_struct = (UInt*)ARG1;
354 //.. UInt a1, a2, a3, a4, a5;
355 //..
356 //.. a1 = arg_struct[0];
357 //.. a2 = arg_struct[1];
358 //.. a3 = arg_struct[2];
359 //.. a4 = arg_struct[3];
360 //.. a5 = arg_struct[4];
361 //..
362 //.. PRINT("old_select ( %d, %p, %p, %p, %p )", a1,a2,a3,a4,a5);
363 //.. if (a2 != (Addr)NULL)
364 //.. PRE_MEM_READ( "old_select(readfds)", a2, a1/8 /* __FD_SETSIZE/8 */ );
365 //.. if (a3 != (Addr)NULL)
366 //.. PRE_MEM_READ( "old_select(writefds)", a3, a1/8 /* __FD_SETSIZE/8 */ );
367 //.. if (a4 != (Addr)NULL)
368 //.. PRE_MEM_READ( "old_select(exceptfds)", a4, a1/8 /* __FD_SETSIZE/8 */ );
369 //.. if (a5 != (Addr)NULL)
370 //.. PRE_MEM_READ( "old_select(timeout)", a5, sizeof(struct vki_timeval) );
371 //.. }
372 //.. }
374 PRE(sys_sigreturn)
376 /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
377 an explanation of what follows. */
379 //ThreadState* tst;
380 PRINT("sys_sigreturn ( )");
382 vg_assert(VG_(is_valid_tid)(tid));
383 vg_assert(tid >= 1 && tid < VG_N_THREADS);
384 vg_assert(VG_(is_running_thread)(tid));
386 ///* Adjust esp to point to start of frame; skip back up over
387 // sigreturn sequence's "popl %eax" and handler ret addr */
388 //tst = VG_(get_ThreadState)(tid);
389 //tst->arch.vex.guest_ESP -= sizeof(Addr)+sizeof(Word);
390 // Should we do something equivalent on ppc32? Who knows.
392 ///* This is only so that the EIP is (might be) useful to report if
393 // something goes wrong in the sigreturn */
394 //ML_(fixup_guest_state_to_restart_syscall)(&tst->arch);
395 // Should we do something equivalent on ppc32? Who knows.
397 /* Restore register state from frame and remove it */
398 VG_(sigframe_destroy)(tid, False);
400 /* Tell the driver not to update the guest state with the "result",
401 and set a bogus result to keep it happy. */
402 *flags |= SfNoWriteResult;
403 SET_STATUS_Success(0);
405 /* Check to see if any signals arose as a result of this. */
406 *flags |= SfPollAfter;
409 PRE(sys_rt_sigreturn)
411 /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
412 an explanation of what follows. */
414 //ThreadState* tst;
415 PRINT("rt_sigreturn ( )");
417 vg_assert(VG_(is_valid_tid)(tid));
418 vg_assert(tid >= 1 && tid < VG_N_THREADS);
419 vg_assert(VG_(is_running_thread)(tid));
421 ///* Adjust esp to point to start of frame; skip back up over handler
422 // ret addr */
423 //tst = VG_(get_ThreadState)(tid);
424 //tst->arch.vex.guest_ESP -= sizeof(Addr);
425 // Should we do something equivalent on ppc32? Who knows.
427 ///* This is only so that the EIP is (might be) useful to report if
428 // something goes wrong in the sigreturn */
429 //ML_(fixup_guest_state_to_restart_syscall)(&tst->arch);
430 // Should we do something equivalent on ppc32? Who knows.
432 /* Restore register state from frame and remove it */
433 VG_(sigframe_destroy)(tid, True);
435 /* Tell the driver not to update the guest state with the "result",
436 and set a bogus result to keep it happy. */
437 *flags |= SfNoWriteResult;
438 SET_STATUS_Success(0);
440 /* Check to see if any signals arose as a result of this. */
441 *flags |= SfPollAfter;
445 //.. PRE(sys_modify_ldt, Special)
446 //.. {
447 //.. PRINT("sys_modify_ldt ( %d, %p, %d )", ARG1,ARG2,ARG3);
448 //.. PRE_REG_READ3(int, "modify_ldt", int, func, void *, ptr,
449 //.. unsigned long, bytecount);
450 //..
451 //.. if (ARG1 == 0) {
452 //.. /* read the LDT into ptr */
453 //.. PRE_MEM_WRITE( "modify_ldt(ptr)", ARG2, ARG3 );
454 //.. }
455 //.. if (ARG1 == 1 || ARG1 == 0x11) {
456 //.. /* write the LDT with the entry pointed at by ptr */
457 //.. PRE_MEM_READ( "modify_ldt(ptr)", ARG2, sizeof(vki_modify_ldt_t) );
458 //.. }
459 //.. /* "do" the syscall ourselves; the kernel never sees it */
460 //.. SET_RESULT( VG_(sys_modify_ldt)( tid, ARG1, (void*)ARG2, ARG3 ) );
461 //..
462 //.. if (ARG1 == 0 && !VG_(is_kerror)(RES) && RES > 0) {
463 //.. POST_MEM_WRITE( ARG2, RES );
464 //.. }
465 //.. }
467 //.. PRE(sys_set_thread_area, Special)
468 //.. {
469 //.. PRINT("sys_set_thread_area ( %p )", ARG1);
470 //.. PRE_REG_READ1(int, "set_thread_area", struct user_desc *, u_info)
471 //.. PRE_MEM_READ( "set_thread_area(u_info)", ARG1, sizeof(vki_modify_ldt_t) );
472 //..
473 //.. /* "do" the syscall ourselves; the kernel never sees it */
474 //.. SET_RESULT( VG_(sys_set_thread_area)( tid, (void *)ARG1 ) );
475 //.. }
477 //.. PRE(sys_get_thread_area, Special)
478 //.. {
479 //.. PRINT("sys_get_thread_area ( %p )", ARG1);
480 //.. PRE_REG_READ1(int, "get_thread_area", struct user_desc *, u_info)
481 //.. PRE_MEM_WRITE( "get_thread_area(u_info)", ARG1, sizeof(vki_modify_ldt_t) );
482 //..
483 //.. /* "do" the syscall ourselves; the kernel never sees it */
484 //.. SET_RESULT( VG_(sys_get_thread_area)( tid, (void *)ARG1 ) );
485 //..
486 //.. if (!VG_(is_kerror)(RES)) {
487 //.. POST_MEM_WRITE( ARG1, sizeof(vki_modify_ldt_t) );
488 //.. }
489 //.. }
491 //.. // Parts of this are ppc32-specific, but the *PEEK* cases are generic.
492 //.. // XXX: Why is the memory pointed to by ARG3 never checked?
493 //.. PRE(sys_ptrace, 0)
494 //.. {
495 //.. PRINT("sys_ptrace ( %d, %d, %p, %p )", ARG1,ARG2,ARG3,ARG4);
496 //.. PRE_REG_READ4(int, "ptrace",
497 //.. long, request, long, pid, long, addr, long, data);
498 //.. switch (ARG1) {
499 //.. case VKI_PTRACE_PEEKTEXT:
500 //.. case VKI_PTRACE_PEEKDATA:
501 //.. case VKI_PTRACE_PEEKUSR:
502 //.. PRE_MEM_WRITE( "ptrace(peek)", ARG4,
503 //.. sizeof (long));
504 //.. break;
505 //.. case VKI_PTRACE_GETREGS:
506 //.. PRE_MEM_WRITE( "ptrace(getregs)", ARG4,
507 //.. sizeof (struct vki_user_regs_struct));
508 //.. break;
509 //.. case VKI_PTRACE_GETFPREGS:
510 //.. PRE_MEM_WRITE( "ptrace(getfpregs)", ARG4,
511 //.. sizeof (struct vki_user_i387_struct));
512 //.. break;
513 //.. case VKI_PTRACE_GETFPXREGS:
514 //.. PRE_MEM_WRITE( "ptrace(getfpxregs)", ARG4,
515 //.. sizeof(struct vki_user_fxsr_struct) );
516 //.. break;
517 //.. case VKI_PTRACE_SETREGS:
518 //.. PRE_MEM_READ( "ptrace(setregs)", ARG4,
519 //.. sizeof (struct vki_user_regs_struct));
520 //.. break;
521 //.. case VKI_PTRACE_SETFPREGS:
522 //.. PRE_MEM_READ( "ptrace(setfpregs)", ARG4,
523 //.. sizeof (struct vki_user_i387_struct));
524 //.. break;
525 //.. case VKI_PTRACE_SETFPXREGS:
526 //.. PRE_MEM_READ( "ptrace(setfpxregs)", ARG4,
527 //.. sizeof(struct vki_user_fxsr_struct) );
528 //.. break;
529 //.. default:
530 //.. break;
531 //.. }
532 //.. }
534 //.. POST(sys_ptrace)
535 //.. {
536 //.. switch (ARG1) {
537 //.. case VKI_PTRACE_PEEKTEXT:
538 //.. case VKI_PTRACE_PEEKDATA:
539 //.. case VKI_PTRACE_PEEKUSR:
540 //.. POST_MEM_WRITE( ARG4, sizeof (long));
541 //.. break;
542 //.. case VKI_PTRACE_GETREGS:
543 //.. POST_MEM_WRITE( ARG4, sizeof (struct vki_user_regs_struct));
544 //.. break;
545 //.. case VKI_PTRACE_GETFPREGS:
546 //.. POST_MEM_WRITE( ARG4, sizeof (struct vki_user_i387_struct));
547 //.. break;
548 //.. case VKI_PTRACE_GETFPXREGS:
549 //.. POST_MEM_WRITE( ARG4, sizeof(struct vki_user_fxsr_struct) );
550 //.. break;
551 //.. default:
552 //.. break;
553 //.. }
554 //.. }
556 /* NB: This is an almost identical clone of versions for x86-linux and
557 arm-linux, which are themselves literally identical. */
558 PRE(sys_sigsuspend)
560 /* The C library interface to sigsuspend just takes a pointer to
561 a signal mask but this system call only takes the first word of
562 the signal mask as an argument so only 32 signals are supported.
564 In fact glibc normally uses rt_sigsuspend if it is available as
565 that takes a pointer to the signal mask so supports more signals.
567 *flags |= SfMayBlock;
568 PRINT("sys_sigsuspend ( %lu )", ARG1 );
569 PRE_REG_READ1(int, "sigsuspend", vki_old_sigset_t, mask);
572 PRE(sys_spu_create)
574 PRE_MEM_RASCIIZ("stat64(filename)", ARG1);
576 POST(sys_spu_create)
578 vg_assert(SUCCESS);
581 PRE(sys_spu_run)
583 *flags |= SfMayBlock;
584 if (ARG2 != 0)
585 PRE_MEM_WRITE("npc", ARG2, sizeof(unsigned int));
586 PRE_MEM_READ("event", ARG3, sizeof(unsigned int));
588 POST(sys_spu_run)
590 if (ARG2 != 0)
591 POST_MEM_WRITE(ARG2, sizeof(unsigned int));
594 #undef PRE
595 #undef POST
597 /* ---------------------------------------------------------------------
598 The ppc32/Linux syscall table
599 ------------------------------------------------------------------ */
601 /* Add an ppc32-linux specific wrapper to a syscall table. */
602 #define PLAX_(sysno, name) WRAPPER_ENTRY_X_(ppc32_linux, sysno, name)
603 #define PLAXY(sysno, name) WRAPPER_ENTRY_XY(ppc32_linux, sysno, name)
605 // This table maps from __NR_xxx syscall numbers (from
606 // linux/include/asm-ppc/unistd.h) to the appropriate PRE/POST sys_foo()
607 // wrappers on ppc32 (as per sys_call_table in linux/arch/ppc/kernel/entry.S).
609 // For those syscalls not handled by Valgrind, the annotation indicate its
610 // arch/OS combination, eg. */* (generic), */Linux (Linux only), ?/?
611 // (unknown).
613 static SyscallTableEntry syscall_table[] = {
614 //.. (restart_syscall) // 0
615 GENX_(__NR_exit, sys_exit), // 1
616 GENX_(__NR_fork, sys_fork), // 2
617 GENXY(__NR_read, sys_read), // 3
618 GENX_(__NR_write, sys_write), // 4
620 GENXY(__NR_open, sys_open), // 5
621 GENX_(__NR_close, sys_close), // 6
622 GENXY(__NR_waitpid, sys_waitpid), // 7
623 GENXY(__NR_creat, sys_creat), // 8
624 GENX_(__NR_link, sys_link), // 9
626 GENX_(__NR_unlink, sys_unlink), // 10
627 GENX_(__NR_execve, sys_execve), // 11
628 GENX_(__NR_chdir, sys_chdir), // 12
629 GENXY(__NR_time, sys_time), // 13
630 GENX_(__NR_mknod, sys_mknod), // 14
631 //..
632 GENX_(__NR_chmod, sys_chmod), // 15
633 GENX_(__NR_lchown, sys_lchown), // 16 ## P
634 //.. GENX_(__NR_break, sys_ni_syscall), // 17
635 //.. // (__NR_oldstat, sys_stat), // 18 (obsolete)
636 LINX_(__NR_lseek, sys_lseek), // 19
637 //..
638 GENX_(__NR_getpid, sys_getpid), // 20
639 LINX_(__NR_mount, sys_mount), // 21
640 LINX_(__NR_umount, sys_oldumount), // 22
641 GENX_(__NR_setuid, sys_setuid), // 23 ## P
642 GENX_(__NR_getuid, sys_getuid), // 24 ## P
643 //..
644 //.. // (__NR_stime, sys_stime), // 25 * (SVr4,SVID,X/OPEN)
645 //.. PLAXY(__NR_ptrace, sys_ptrace), // 26
646 GENX_(__NR_alarm, sys_alarm), // 27
647 //.. // (__NR_oldfstat, sys_fstat), // 28 * L -- obsolete
648 GENX_(__NR_pause, sys_pause), // 29
649 //..
650 LINX_(__NR_utime, sys_utime), // 30
651 //.. GENX_(__NR_stty, sys_ni_syscall), // 31
652 //.. GENX_(__NR_gtty, sys_ni_syscall), // 32
653 GENX_(__NR_access, sys_access), // 33
654 //.. GENX_(__NR_nice, sys_nice), // 34
655 //..
656 //.. GENX_(__NR_ftime, sys_ni_syscall), // 35
657 GENX_(__NR_sync, sys_sync), // 36
658 GENX_(__NR_kill, sys_kill), // 37
659 GENX_(__NR_rename, sys_rename), // 38
660 GENX_(__NR_mkdir, sys_mkdir), // 39
662 GENX_(__NR_rmdir, sys_rmdir), // 40
663 GENXY(__NR_dup, sys_dup), // 41
664 LINXY(__NR_pipe, sys_pipe), // 42
665 GENXY(__NR_times, sys_times), // 43
666 //.. GENX_(__NR_prof, sys_ni_syscall), // 44
667 //..
668 GENX_(__NR_brk, sys_brk), // 45
669 GENX_(__NR_setgid, sys_setgid), // 46
670 GENX_(__NR_getgid, sys_getgid), // 47
671 //.. // (__NR_signal, sys_signal), // 48 */* (ANSI C)
672 GENX_(__NR_geteuid, sys_geteuid), // 49
674 GENX_(__NR_getegid, sys_getegid), // 50
675 GENX_(__NR_acct, sys_acct), // 51
676 LINX_(__NR_umount2, sys_umount), // 52
677 //.. GENX_(__NR_lock, sys_ni_syscall), // 53
678 LINXY(__NR_ioctl, sys_ioctl), // 54
679 //..
680 LINXY(__NR_fcntl, sys_fcntl), // 55
681 //.. GENX_(__NR_mpx, sys_ni_syscall), // 56
682 GENX_(__NR_setpgid, sys_setpgid), // 57
683 //.. GENX_(__NR_ulimit, sys_ni_syscall), // 58
684 //.. // (__NR_oldolduname, sys_olduname), // 59 Linux -- obsolete
686 GENX_(__NR_umask, sys_umask), // 60
687 GENX_(__NR_chroot, sys_chroot), // 61
688 //.. // (__NR_ustat, sys_ustat) // 62 SVr4 -- deprecated
689 GENXY(__NR_dup2, sys_dup2), // 63
690 GENX_(__NR_getppid, sys_getppid), // 64
692 GENX_(__NR_getpgrp, sys_getpgrp), // 65
693 GENX_(__NR_setsid, sys_setsid), // 66
694 LINXY(__NR_sigaction, sys_sigaction), // 67
695 //.. // (__NR_sgetmask, sys_sgetmask), // 68 */* (ANSI C)
696 //.. // (__NR_ssetmask, sys_ssetmask), // 69 */* (ANSI C)
697 //..
698 GENX_(__NR_setreuid, sys_setreuid), // 70
699 GENX_(__NR_setregid, sys_setregid), // 71
700 PLAX_(__NR_sigsuspend, sys_sigsuspend), // 72
701 LINXY(__NR_sigpending, sys_sigpending), // 73
702 //.. // (__NR_sethostname, sys_sethostname), // 74 */*
703 //..
704 GENX_(__NR_setrlimit, sys_setrlimit), // 75
705 //.. GENXY(__NR_getrlimit, sys_old_getrlimit), // 76
706 GENXY(__NR_getrusage, sys_getrusage), // 77
707 GENXY(__NR_gettimeofday, sys_gettimeofday), // 78
708 //.. GENX_(__NR_settimeofday, sys_settimeofday), // 79
709 //..
710 GENXY(__NR_getgroups, sys_getgroups), // 80
711 GENX_(__NR_setgroups, sys_setgroups), // 81
712 //.. PLAX_(__NR_select, old_select), // 82
713 GENX_(__NR_symlink, sys_symlink), // 83
714 //.. // (__NR_oldlstat, sys_lstat), // 84 -- obsolete
715 //..
716 GENX_(__NR_readlink, sys_readlink), // 85
717 //.. // (__NR_uselib, sys_uselib), // 86 */Linux
718 //.. // (__NR_swapon, sys_swapon), // 87 */Linux
719 //.. // (__NR_reboot, sys_reboot), // 88 */Linux
720 //.. // (__NR_readdir, old_readdir), // 89 -- superseded
722 PLAX_(__NR_mmap, sys_mmap), // 90
723 GENXY(__NR_munmap, sys_munmap), // 91
724 GENX_(__NR_truncate, sys_truncate), // 92
725 GENX_(__NR_ftruncate, sys_ftruncate), // 93
726 GENX_(__NR_fchmod, sys_fchmod), // 94
728 GENX_(__NR_fchown, sys_fchown), // 95
729 GENX_(__NR_getpriority, sys_getpriority), // 96
730 GENX_(__NR_setpriority, sys_setpriority), // 97
731 //.. GENX_(__NR_profil, sys_ni_syscall), // 98
732 GENXY(__NR_statfs, sys_statfs), // 99
733 //..
734 GENXY(__NR_fstatfs, sys_fstatfs), // 100
735 //.. LINX_(__NR_ioperm, sys_ioperm), // 101
736 LINXY(__NR_socketcall, sys_socketcall), // 102
737 LINXY(__NR_syslog, sys_syslog), // 103
738 GENXY(__NR_setitimer, sys_setitimer), // 104
740 GENXY(__NR_getitimer, sys_getitimer), // 105
741 GENXY(__NR_stat, sys_newstat), // 106
742 GENXY(__NR_lstat, sys_newlstat), // 107
743 GENXY(__NR_fstat, sys_newfstat), // 108
744 //.. // (__NR_olduname, sys_uname), // 109 -- obsolete
745 //..
746 //.. GENX_(__NR_iopl, sys_iopl), // 110
747 LINX_(__NR_vhangup, sys_vhangup), // 111
748 //.. GENX_(__NR_idle, sys_ni_syscall), // 112
749 //.. // (__NR_vm86old, sys_vm86old), // 113 x86/Linux-only
750 GENXY(__NR_wait4, sys_wait4), // 114
751 //..
752 //.. // (__NR_swapoff, sys_swapoff), // 115 */Linux
753 LINXY(__NR_sysinfo, sys_sysinfo), // 116
754 LINXY(__NR_ipc, sys_ipc), // 117
755 GENX_(__NR_fsync, sys_fsync), // 118
756 PLAX_(__NR_sigreturn, sys_sigreturn), // 119 ?/Linux
757 //..
758 LINX_(__NR_clone, sys_clone), // 120
759 //.. // (__NR_setdomainname, sys_setdomainname), // 121 */*(?)
760 GENXY(__NR_uname, sys_newuname), // 122
761 //.. PLAX_(__NR_modify_ldt, sys_modify_ldt), // 123
762 LINXY(__NR_adjtimex, sys_adjtimex), // 124
764 GENXY(__NR_mprotect, sys_mprotect), // 125
765 LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
766 GENX_(__NR_create_module, sys_ni_syscall), // 127
767 LINX_(__NR_init_module, sys_init_module), // 128
768 LINX_(__NR_delete_module, sys_delete_module), // 129
769 //..
770 //.. // Nb: get_kernel_syms() was removed 2.4-->2.6
771 //.. GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130
772 //.. LINX_(__NR_quotactl, sys_quotactl), // 131
773 GENX_(__NR_getpgid, sys_getpgid), // 132
774 GENX_(__NR_fchdir, sys_fchdir), // 133
775 //.. // (__NR_bdflush, sys_bdflush), // 134 */Linux
776 //..
777 //.. // (__NR_sysfs, sys_sysfs), // 135 SVr4
778 LINX_(__NR_personality, sys_personality), // 136
779 //.. GENX_(__NR_afs_syscall, sys_ni_syscall), // 137
780 LINX_(__NR_setfsuid, sys_setfsuid), // 138
781 LINX_(__NR_setfsgid, sys_setfsgid), // 139
783 LINXY(__NR__llseek, sys_llseek), // 140
784 GENXY(__NR_getdents, sys_getdents), // 141
785 GENX_(__NR__newselect, sys_select), // 142
786 GENX_(__NR_flock, sys_flock), // 143
787 GENX_(__NR_msync, sys_msync), // 144
788 //..
789 GENXY(__NR_readv, sys_readv), // 145
790 GENX_(__NR_writev, sys_writev), // 146
791 GENX_(__NR_getsid, sys_getsid), // 147
792 GENX_(__NR_fdatasync, sys_fdatasync), // 148
793 LINXY(__NR__sysctl, sys_sysctl), // 149
794 //..
795 GENX_(__NR_mlock, sys_mlock), // 150
796 GENX_(__NR_munlock, sys_munlock), // 151
797 GENX_(__NR_mlockall, sys_mlockall), // 152
798 LINX_(__NR_munlockall, sys_munlockall), // 153
799 LINXY(__NR_sched_setparam, sys_sched_setparam), // 154
800 //..
801 LINXY(__NR_sched_getparam, sys_sched_getparam), // 155
802 LINX_(__NR_sched_setscheduler, sys_sched_setscheduler), // 156
803 LINX_(__NR_sched_getscheduler, sys_sched_getscheduler), // 157
804 LINX_(__NR_sched_yield, sys_sched_yield), // 158
805 LINX_(__NR_sched_get_priority_max, sys_sched_get_priority_max),// 159
807 LINX_(__NR_sched_get_priority_min, sys_sched_get_priority_min),// 160
808 LINXY(__NR_sched_rr_get_interval, sys_sched_rr_get_interval), // 161
809 GENXY(__NR_nanosleep, sys_nanosleep), // 162
810 GENX_(__NR_mremap, sys_mremap), // 163
811 LINX_(__NR_setresuid, sys_setresuid), // 164
813 LINXY(__NR_getresuid, sys_getresuid), // 165
815 //.. GENX_(__NR_query_module, sys_ni_syscall), // 166
816 GENXY(__NR_poll, sys_poll), // 167
817 //.. // (__NR_nfsservctl, sys_nfsservctl), // 168 */Linux
818 //..
819 LINX_(__NR_setresgid, sys_setresgid), // 169
820 LINXY(__NR_getresgid, sys_getresgid), // 170
821 LINXY(__NR_prctl, sys_prctl), // 171
822 PLAX_(__NR_rt_sigreturn, sys_rt_sigreturn), // 172
823 LINXY(__NR_rt_sigaction, sys_rt_sigaction), // 173
825 LINXY(__NR_rt_sigprocmask, sys_rt_sigprocmask), // 174
826 LINXY(__NR_rt_sigpending, sys_rt_sigpending), // 175
827 LINXY(__NR_rt_sigtimedwait, sys_rt_sigtimedwait), // 176
828 LINXY(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo), // 177
829 LINX_(__NR_rt_sigsuspend, sys_rt_sigsuspend), // 178
831 GENXY(__NR_pread64, sys_pread64), // 179
832 GENX_(__NR_pwrite64, sys_pwrite64), // 180
833 GENX_(__NR_chown, sys_chown), // 181
834 GENXY(__NR_getcwd, sys_getcwd), // 182
835 LINXY(__NR_capget, sys_capget), // 183
836 LINX_(__NR_capset, sys_capset), // 184
837 GENXY(__NR_sigaltstack, sys_sigaltstack), // 185
838 LINXY(__NR_sendfile, sys_sendfile), // 186
839 //.. GENXY(__NR_getpmsg, sys_getpmsg), // 187
840 //.. GENX_(__NR_putpmsg, sys_putpmsg), // 188
842 // Nb: we treat vfork as fork
843 GENX_(__NR_vfork, sys_fork), // 189
844 GENXY(__NR_ugetrlimit, sys_getrlimit), // 190
845 LINX_(__NR_readahead, sys_readahead), // 191 */Linux
846 PLAX_(__NR_mmap2, sys_mmap2), // 192
847 GENX_(__NR_truncate64, sys_truncate64), // 193
848 GENX_(__NR_ftruncate64, sys_ftruncate64), // 194
849 //..
851 PLAXY(__NR_stat64, sys_stat64), // 195
852 PLAXY(__NR_lstat64, sys_lstat64), // 196
853 PLAXY(__NR_fstat64, sys_fstat64), // 197
855 // __NR_pciconfig_read // 198
856 // __NR_pciconfig_write // 199
857 // __NR_pciconfig_iobase // 200
858 // __NR_multiplexer // 201
860 GENXY(__NR_getdents64, sys_getdents64), // 202
861 LINX_(__NR_pivot_root, sys_pivot_root), // 203
862 LINXY(__NR_fcntl64, sys_fcntl64), // 204
863 GENX_(__NR_madvise, sys_madvise), // 205
864 GENXY(__NR_mincore, sys_mincore), // 206
865 LINX_(__NR_gettid, sys_gettid), // 207
866 //.. LINX_(__NR_tkill, sys_tkill), // 208 */Linux
867 LINX_(__NR_setxattr, sys_setxattr), // 209
868 LINX_(__NR_lsetxattr, sys_lsetxattr), // 210
869 LINX_(__NR_fsetxattr, sys_fsetxattr), // 211
870 LINXY(__NR_getxattr, sys_getxattr), // 212
871 LINXY(__NR_lgetxattr, sys_lgetxattr), // 213
872 LINXY(__NR_fgetxattr, sys_fgetxattr), // 214
873 LINXY(__NR_listxattr, sys_listxattr), // 215
874 LINXY(__NR_llistxattr, sys_llistxattr), // 216
875 LINXY(__NR_flistxattr, sys_flistxattr), // 217
876 LINX_(__NR_removexattr, sys_removexattr), // 218
877 LINX_(__NR_lremovexattr, sys_lremovexattr), // 219
878 LINX_(__NR_fremovexattr, sys_fremovexattr), // 220
880 LINXY(__NR_futex, sys_futex), // 221
881 LINX_(__NR_sched_setaffinity, sys_sched_setaffinity), // 222
882 LINXY(__NR_sched_getaffinity, sys_sched_getaffinity), // 223
883 /* 224 currently unused */
885 // __NR_tuxcall // 225
887 LINXY(__NR_sendfile64, sys_sendfile64), // 226
888 //..
889 LINX_(__NR_io_setup, sys_io_setup), // 227
890 LINX_(__NR_io_destroy, sys_io_destroy), // 228
891 LINXY(__NR_io_getevents, sys_io_getevents), // 229
892 LINX_(__NR_io_submit, sys_io_submit), // 230
893 LINXY(__NR_io_cancel, sys_io_cancel), // 231
894 //..
895 LINX_(__NR_set_tid_address, sys_set_tid_address), // 232
897 LINX_(__NR_fadvise64, sys_fadvise64), // 233 */(Linux?)
898 LINX_(__NR_exit_group, sys_exit_group), // 234
899 //.. GENXY(__NR_lookup_dcookie, sys_lookup_dcookie), // 235
900 LINXY(__NR_epoll_create, sys_epoll_create), // 236
901 LINX_(__NR_epoll_ctl, sys_epoll_ctl), // 237
902 LINXY(__NR_epoll_wait, sys_epoll_wait), // 238
904 //.. // (__NR_remap_file_pages, sys_remap_file_pages), // 239 */Linux
905 LINXY(__NR_timer_create, sys_timer_create), // 240
906 LINXY(__NR_timer_settime, sys_timer_settime), // 241
907 LINXY(__NR_timer_gettime, sys_timer_gettime), // 242
908 LINX_(__NR_timer_getoverrun, sys_timer_getoverrun), // 243
909 LINX_(__NR_timer_delete, sys_timer_delete), // 244
910 LINX_(__NR_clock_settime, sys_clock_settime), // 245
911 LINXY(__NR_clock_gettime, sys_clock_gettime), // 246
912 LINXY(__NR_clock_getres, sys_clock_getres), // 247
913 LINXY(__NR_clock_nanosleep, sys_clock_nanosleep), // 248
915 // __NR_swapcontext // 249
917 LINXY(__NR_tgkill, sys_tgkill), // 250 */Linux
918 //.. GENX_(__NR_utimes, sys_utimes), // 251
919 GENXY(__NR_statfs64, sys_statfs64), // 252
920 GENXY(__NR_fstatfs64, sys_fstatfs64), // 253
921 LINX_(__NR_fadvise64_64, sys_fadvise64_64), // 254 */(Linux?)
923 // __NR_rtas // 255
925 /* Number 256 is reserved for sys_debug_setcontext */
926 /* Number 257 is reserved for vserver */
927 /* Number 258 is reserved for new sys_remap_file_pages */
928 LINX_(__NR_mbind, sys_mbind), // 259
929 LINXY(__NR_get_mempolicy, sys_get_mempolicy), // 260
930 LINX_(__NR_set_mempolicy, sys_set_mempolicy), // 261
932 LINXY(__NR_mq_open, sys_mq_open), // 262
933 LINX_(__NR_mq_unlink, sys_mq_unlink), // 263
934 LINX_(__NR_mq_timedsend, sys_mq_timedsend), // 264
935 LINXY(__NR_mq_timedreceive, sys_mq_timedreceive), // 265
936 LINX_(__NR_mq_notify, sys_mq_notify), // 266
937 LINXY(__NR_mq_getsetattr, sys_mq_getsetattr), // 267
938 // __NR_kexec_load // 268
940 /* Number 269 is reserved for sys_add_key */
941 /* Number 270 is reserved for sys_request_key */
942 /* Number 271 is reserved for sys_keyctl */
943 /* Number 272 is reserved for sys_waitid */
944 LINX_(__NR_ioprio_set, sys_ioprio_set), // 273
945 LINX_(__NR_ioprio_get, sys_ioprio_get), // 274
947 LINXY(__NR_inotify_init, sys_inotify_init), // 275
948 LINX_(__NR_inotify_add_watch, sys_inotify_add_watch), // 276
949 LINX_(__NR_inotify_rm_watch, sys_inotify_rm_watch), // 277
950 PLAXY(__NR_spu_run, sys_spu_run), // 278
951 PLAX_(__NR_spu_create, sys_spu_create), // 279
953 LINXY(__NR_pselect6, sys_pselect6), // 280
954 LINXY(__NR_ppoll, sys_ppoll), // 281
956 LINXY(__NR_openat, sys_openat), // 286
957 LINX_(__NR_mkdirat, sys_mkdirat), // 287
958 LINX_(__NR_mknodat, sys_mknodat), // 288
959 LINX_(__NR_fchownat, sys_fchownat), // 289
960 LINX_(__NR_futimesat, sys_futimesat), // 290
961 PLAXY(__NR_fstatat64, sys_fstatat64), // 291
962 LINX_(__NR_unlinkat, sys_unlinkat), // 292
963 LINX_(__NR_renameat, sys_renameat), // 293
964 LINX_(__NR_linkat, sys_linkat), // 294
965 LINX_(__NR_symlinkat, sys_symlinkat), // 295
966 LINX_(__NR_readlinkat, sys_readlinkat), // 296
967 LINX_(__NR_fchmodat, sys_fchmodat), // 297
968 LINX_(__NR_faccessat, sys_faccessat), // 298
969 LINX_(__NR_set_robust_list, sys_set_robust_list), // 299
970 LINXY(__NR_get_robust_list, sys_get_robust_list), // 300
971 LINXY(__NR_move_pages, sys_move_pages), // 301
972 LINXY(__NR_getcpu, sys_getcpu), // 302
973 LINXY(__NR_epoll_pwait, sys_epoll_pwait), // 303
974 LINX_(__NR_utimensat, sys_utimensat), // 304
975 LINXY(__NR_signalfd, sys_signalfd), // 305
976 LINXY(__NR_timerfd_create, sys_timerfd_create), // 306
977 LINXY(__NR_eventfd, sys_eventfd), // 307
978 LINX_(__NR_sync_file_range2, sys_sync_file_range2), // 308
979 LINX_(__NR_fallocate, sys_fallocate), // 309
980 // LINXY(__NR_subpage_prot, sys_ni_syscall), // 310
981 LINXY(__NR_timerfd_settime, sys_timerfd_settime), // 311
982 LINXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 312
983 LINXY(__NR_signalfd4, sys_signalfd4), // 313
984 LINXY(__NR_eventfd2, sys_eventfd2), // 314
985 LINXY(__NR_epoll_create1, sys_epoll_create1), // 315
986 LINXY(__NR_dup3, sys_dup3), // 316
987 LINXY(__NR_pipe2, sys_pipe2), // 317
988 LINXY(__NR_inotify_init1, sys_inotify_init1), // 318
989 LINXY(__NR_perf_event_open, sys_perf_event_open), // 319
990 LINXY(__NR_preadv, sys_preadv), // 320
991 LINX_(__NR_pwritev, sys_pwritev), // 321
992 LINXY(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo),// 322
994 LINXY(__NR_socket, sys_socket), // 326
995 LINX_(__NR_bind, sys_bind), // 327
996 LINX_(__NR_connect, sys_connect), // 328
997 LINX_(__NR_listen, sys_listen), // 329
998 LINXY(__NR_accept, sys_accept), // 330
999 LINXY(__NR_getsockname, sys_getsockname), // 331
1000 LINXY(__NR_getpeername, sys_getpeername), // 332
1002 LINX_(__NR_send, sys_send), // 334
1003 LINX_(__NR_sendto, sys_sendto), // 335
1004 LINXY(__NR_recv, sys_recv), // 336
1005 LINXY(__NR_recvfrom, sys_recvfrom), // 337
1006 LINX_(__NR_shutdown, sys_shutdown), // 338
1007 LINX_(__NR_setsockopt, sys_setsockopt), // 339
1009 LINXY(__NR_recvmmsg, sys_recvmmsg), // 343
1010 LINXY(__NR_accept4, sys_accept4), // 344
1012 LINX_(__NR_clock_adjtime, sys_clock_adjtime), // 347
1013 LINX_(__NR_syncfs, sys_syncfs), // 348
1014 LINXY(__NR_sendmmsg, sys_sendmmsg), // 349
1016 LINXY(__NR_process_vm_readv, sys_process_vm_readv), // 351
1017 LINX_(__NR_process_vm_writev, sys_process_vm_writev),// 352
1019 LINX_(__NR_sched_setattr, sys_sched_setattr), // 355
1020 LINXY(__NR_sched_getattr, sys_sched_getattr), // 356
1021 LINX_(__NR_renameat2, sys_renameat2), // 357
1023 LINXY(__NR_getrandom, sys_getrandom), // 359
1024 LINXY(__NR_memfd_create, sys_memfd_create), // 360
1026 LINX_ (__NR_execveat, sys_execveat), // 362
1028 GENX_(__NR_mlock2, sys_mlock2), // 378
1029 LINX_(__NR_copy_file_range, sys_copy_file_range), // 379
1030 LINX_(__NR_preadv2, sys_preadv2), // 380
1031 LINX_(__NR_pwritev2, sys_pwritev2), // 381
1033 LINXY(__NR_statx, sys_statx), // 383
1035 GENX_(__NR_rseq, sys_ni_syscall), // 387
1037 LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403
1038 LINX_(__NR_clock_settime64, sys_clock_settime64), // 404
1040 LINXY(__NR_clock_getres_time64, sys_clock_getres_time64), // 406
1041 LINXY(__NR_clock_nanosleep_time64, sys_clock_nanosleep_time64), // 407
1042 LINXY(__NR_timer_gettime64, sys_timer_gettime64), // 408
1043 LINXY(__NR_timer_settime64, sys_timer_settime64), // 409
1044 LINXY(__NR_timerfd_gettime64, sys_timerfd_gettime64),// 410
1045 LINXY(__NR_timerfd_settime64, sys_timerfd_settime64),// 411
1046 LINX_(__NR_utimensat_time64, sys_utimensat_time64), // 412
1047 LINXY(__NR_pselect6_time64, sys_pselect6_time64), // 413
1048 LINXY(__NR_ppoll_time64, sys_ppoll_time64), // 414
1050 LINXY(__NR_recvmmsg_time64, sys_recvmmsg_time64), // 417
1051 LINX_(__NR_mq_timedsend_time64, sys_mq_timedsend_time64), // 418
1052 LINXY(__NR_mq_timedreceive_time64, sys_mq_timedreceive_time64), // 419
1053 LINX_(__NR_semtimedop_time64, sys_semtimedop_time64),// 420
1054 LINXY(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait_time64), // 421
1055 LINXY(__NR_futex_time64, sys_futex_time64), // 422
1056 LINXY(__NR_sched_rr_get_interval_time64,
1057 sys_sched_rr_get_interval_time64), // 423
1059 LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425
1060 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426
1061 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427
1063 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434
1064 GENX_(__NR_clone3, sys_ni_syscall), // 435
1065 LINXY(__NR_close_range, sys_close_range), // 436
1066 LINXY(__NR_openat2, sys_openat2), // 437
1067 LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), // 438
1068 LINX_(__NR_faccessat2, sys_faccessat2), // 439
1070 LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441
1072 LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452
1075 SyscallTableEntry* ML_(get_linux_syscall_entry) ( UInt sysno )
1077 const UInt syscall_table_size
1078 = sizeof(syscall_table) / sizeof(syscall_table[0]);
1080 /* Is it in the contiguous initial section of the table? */
1081 if (sysno < syscall_table_size) {
1082 SyscallTableEntry* sys = &syscall_table[sysno];
1083 if (sys->before == NULL)
1084 return NULL; /* no entry */
1085 else
1086 return sys;
1089 /* Can't find a wrapper */
1090 return NULL;
1093 #endif // defined(VGP_ppc32_linux)
1095 /*--------------------------------------------------------------------*/
1096 /*--- end ---*/
1097 /*--------------------------------------------------------------------*/