Add 469782 to NEWS
[valgrind.git] / coregrind / m_syswrap / priv_syswrap-linux.h
blob1bdd9a94ec19598c253b57e068ab0b237189a969
2 /*--------------------------------------------------------------------*/
3 /*--- Linux-specific syscalls stuff. priv_syswrap-linux.h ---*/
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
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 #ifndef __PRIV_SYSWRAP_LINUX_H
30 #define __PRIV_SYSWRAP_LINUX_H
32 #include "pub_core_basics.h" // ThreadId
33 #include "priv_types_n_macros.h" // DECL_TEMPLATE
35 // Clone-related functions
36 extern Word ML_(start_thread_NORETURN) ( void* arg );
37 extern Addr ML_(allocstack) ( ThreadId tid );
38 extern void ML_(call_on_new_stack_0_1) ( Addr stack, Addr retaddr,
39 void (*f)(Word), Word arg1 );
41 // Linux-specific (but non-arch-specific) syscalls
43 DECL_TEMPLATE(linux, sys_clone)
44 DECL_TEMPLATE(linux, sys_mount);
45 DECL_TEMPLATE(linux, sys_oldumount);
46 DECL_TEMPLATE(linux, sys_umount);
47 DECL_TEMPLATE(linux, sys_perf_event_open);
48 DECL_TEMPLATE(linux, sys_preadv);
49 DECL_TEMPLATE(linux, sys_preadv2);
50 DECL_TEMPLATE(linux, sys_pwritev);
51 DECL_TEMPLATE(linux, sys_pwritev2);
52 DECL_TEMPLATE(linux, sys_sendmmsg);
53 DECL_TEMPLATE(linux, sys_recvmmsg);
54 DECL_TEMPLATE(linux, sys_dup3);
55 DECL_TEMPLATE(linux, sys_getcpu);
56 DECL_TEMPLATE(linux, sys_splice);
57 DECL_TEMPLATE(linux, sys_tee);
58 DECL_TEMPLATE(linux, sys_vmsplice);
59 DECL_TEMPLATE(linux, sys_readahead);
60 DECL_TEMPLATE(linux, sys_move_pages);
62 // clone is similar enough between linux variants to have a generic
63 // version, but which will call an extern defined in syswrap-<platform>-linux.c
64 DECL_TEMPLATE(linux, sys_clone);
66 // POSIX, but various sub-cases differ between Linux and Darwin.
67 DECL_TEMPLATE(linux, sys_fcntl);
68 DECL_TEMPLATE(linux, sys_fcntl64);
69 DECL_TEMPLATE(linux, sys_ioctl);
71 DECL_TEMPLATE(linux, sys_setfsuid16);
72 DECL_TEMPLATE(linux, sys_setfsuid);
73 DECL_TEMPLATE(linux, sys_setfsgid16);
74 DECL_TEMPLATE(linux, sys_setfsgid);
75 DECL_TEMPLATE(linux, sys_setresuid16); // man page says "non-standard";
76 DECL_TEMPLATE(linux, sys_setresuid); // man page says "non-standard"
77 DECL_TEMPLATE(linux, sys_getresuid16);
78 DECL_TEMPLATE(linux, sys_getresuid);
79 DECL_TEMPLATE(linux, sys_setresgid16); // man page says "non-standard"
80 DECL_TEMPLATE(linux, sys_setresgid); // man page says "non-standard"
81 DECL_TEMPLATE(linux, sys_getresgid16);
82 DECL_TEMPLATE(linux, sys_getresgid);
84 DECL_TEMPLATE(linux, sys_exit_group);
85 DECL_TEMPLATE(linux, sys_llseek);
86 DECL_TEMPLATE(linux, sys_adjtimex);
87 DECL_TEMPLATE(linux, sys_ioperm);
88 DECL_TEMPLATE(linux, sys_syslog);
89 DECL_TEMPLATE(linux, sys_vhangup);
90 DECL_TEMPLATE(linux, sys_sysinfo);
91 DECL_TEMPLATE(linux, sys_personality);
92 DECL_TEMPLATE(linux, sys_pivot_root);
93 DECL_TEMPLATE(linux, sys_sysctl);
94 DECL_TEMPLATE(linux, sys_prctl);
95 DECL_TEMPLATE(linux, sys_sendfile);
96 DECL_TEMPLATE(linux, sys_sendfile64);
97 DECL_TEMPLATE(linux, sys_futex);
98 DECL_TEMPLATE(linux, sys_set_robust_list);
99 DECL_TEMPLATE(linux, sys_get_robust_list);
100 DECL_TEMPLATE(linux, sys_pselect6);
101 DECL_TEMPLATE(linux, sys_ppoll);
103 DECL_TEMPLATE(linux, sys_epoll_create);
104 DECL_TEMPLATE(linux, sys_epoll_create1);
105 DECL_TEMPLATE(linux, sys_epoll_ctl);
106 DECL_TEMPLATE(linux, sys_epoll_wait);
107 DECL_TEMPLATE(linux, sys_epoll_pwait);
108 DECL_TEMPLATE(linux, sys_epoll_pwait2);
109 DECL_TEMPLATE(linux, sys_eventfd);
110 DECL_TEMPLATE(linux, sys_eventfd2);
112 DECL_TEMPLATE(linux, sys_fallocate);
114 DECL_TEMPLATE(linux, sys_prlimit64);
116 DECL_TEMPLATE(linux, sys_gettid);
117 DECL_TEMPLATE(linux, sys_set_tid_address);
118 DECL_TEMPLATE(linux, sys_tkill);
119 DECL_TEMPLATE(linux, sys_tgkill);
121 DECL_TEMPLATE(linux, sys_fadvise64);
122 DECL_TEMPLATE(linux, sys_fadvise64_64);
124 DECL_TEMPLATE(linux, sys_io_setup);
125 DECL_TEMPLATE(linux, sys_io_destroy);
126 DECL_TEMPLATE(linux, sys_io_getevents);
127 DECL_TEMPLATE(linux, sys_io_submit);
128 DECL_TEMPLATE(linux, sys_io_cancel);
130 DECL_TEMPLATE(linux, sys_ioprio_set);
131 DECL_TEMPLATE(linux, sys_ioprio_get);
133 DECL_TEMPLATE(linux, sys_mbind);
134 DECL_TEMPLATE(linux, sys_set_mempolicy);
135 DECL_TEMPLATE(linux, sys_get_mempolicy);
137 DECL_TEMPLATE(linux, sys_inotify_init);
138 DECL_TEMPLATE(linux, sys_inotify_init1);
139 DECL_TEMPLATE(linux, sys_inotify_add_watch);
140 DECL_TEMPLATE(linux, sys_inotify_rm_watch);
142 DECL_TEMPLATE(linux, sys_mq_open);
143 DECL_TEMPLATE(linux, sys_mq_unlink);
144 DECL_TEMPLATE(linux, sys_mq_timedsend);
145 DECL_TEMPLATE(linux, sys_mq_timedreceive);
146 DECL_TEMPLATE(linux, sys_mq_notify);
147 DECL_TEMPLATE(linux, sys_mq_getsetattr);
149 DECL_TEMPLATE(linux, sys_clock_settime);
150 DECL_TEMPLATE(linux, sys_clock_gettime);
151 DECL_TEMPLATE(linux, sys_clock_getres);
152 DECL_TEMPLATE(linux, sys_clock_nanosleep);
153 DECL_TEMPLATE(linux, sys_clock_adjtime);
155 DECL_TEMPLATE(linux, sys_timer_create); // Linux: varies across archs?
156 DECL_TEMPLATE(linux, sys_timer_settime);
157 DECL_TEMPLATE(linux, sys_timer_gettime);
158 DECL_TEMPLATE(linux, sys_timer_getoverrun);
159 DECL_TEMPLATE(linux, sys_timer_delete);
160 DECL_TEMPLATE(linux, sys_timerfd_create);
161 DECL_TEMPLATE(linux, sys_timerfd_gettime);
162 DECL_TEMPLATE(linux, sys_timerfd_settime);
164 DECL_TEMPLATE(linux, sys_signalfd);
165 DECL_TEMPLATE(linux, sys_signalfd4);
167 DECL_TEMPLATE(linux, sys_capget);
168 DECL_TEMPLATE(linux, sys_capset);
170 DECL_TEMPLATE(linux, sys_openat);
171 DECL_TEMPLATE(linux, sys_mkdirat);
172 DECL_TEMPLATE(linux, sys_mknodat);
173 DECL_TEMPLATE(linux, sys_fchownat);
174 DECL_TEMPLATE(linux, sys_futimesat);
175 DECL_TEMPLATE(linux, sys_newfstatat);
176 DECL_TEMPLATE(linux, sys_unlinkat);
177 DECL_TEMPLATE(linux, sys_renameat);
178 DECL_TEMPLATE(linux, sys_renameat2);
179 DECL_TEMPLATE(linux, sys_linkat);
180 DECL_TEMPLATE(linux, sys_symlinkat);
181 DECL_TEMPLATE(linux, sys_readlinkat);
182 DECL_TEMPLATE(linux, sys_fchmodat);
183 DECL_TEMPLATE(linux, sys_faccessat);
184 DECL_TEMPLATE(linux, sys_faccessat2);
185 DECL_TEMPLATE(linux, sys_utimensat);
186 DECL_TEMPLATE(linux, sys_name_to_handle_at);
187 DECL_TEMPLATE(linux, sys_open_by_handle_at);
189 DECL_TEMPLATE(linux, sys_add_key);
190 DECL_TEMPLATE(linux, sys_request_key);
191 DECL_TEMPLATE(linux, sys_keyctl);
193 // These ones have 32-bit generic equivalents, but the 16-bit versions (they
194 // use 16-bit gid_t and uid_t types) seem to be Linux-specific.
195 DECL_TEMPLATE(linux, sys_getuid16);
196 DECL_TEMPLATE(linux, sys_setuid16);
197 DECL_TEMPLATE(linux, sys_getgid16);
198 DECL_TEMPLATE(linux, sys_setgid16);
199 DECL_TEMPLATE(linux, sys_geteuid16);
200 DECL_TEMPLATE(linux, sys_getegid16);
201 DECL_TEMPLATE(linux, sys_setreuid16);
202 DECL_TEMPLATE(linux, sys_setregid16);
203 DECL_TEMPLATE(linux, sys_getgroups16);
204 DECL_TEMPLATE(linux, sys_setgroups16);
206 // Again, these 16-bit versions are Linux-specific, the 32-bit versions are
207 // generic.
208 DECL_TEMPLATE(linux, sys_chown16);
209 DECL_TEMPLATE(linux, sys_fchown16);
210 //DECL_TEMPLATE(linux, sys_lchown16); // not yet encountered
212 // Are these POSIX? In Darwin they have an extra parameter 'position',
213 // so put them here.
214 DECL_TEMPLATE(linux, sys_setxattr);
215 DECL_TEMPLATE(linux, sys_lsetxattr);
216 DECL_TEMPLATE(linux, sys_fsetxattr);
217 DECL_TEMPLATE(linux, sys_getxattr);
218 DECL_TEMPLATE(linux, sys_lgetxattr);
219 DECL_TEMPLATE(linux, sys_fgetxattr);
220 DECL_TEMPLATE(linux, sys_listxattr);
221 DECL_TEMPLATE(linux, sys_llistxattr);
222 DECL_TEMPLATE(linux, sys_flistxattr);
223 DECL_TEMPLATE(linux, sys_removexattr);
224 DECL_TEMPLATE(linux, sys_lremovexattr);
225 DECL_TEMPLATE(linux, sys_fremovexattr);
227 // These are Posix, but not necessarily syscalls. Darwin only supports
228 // sched_get_priority_{min,max} and sched_yield, but as libc functions, not
229 // syscalls.
230 DECL_TEMPLATE(linux, sys_sched_setparam);
231 DECL_TEMPLATE(linux, sys_sched_getparam);
232 DECL_TEMPLATE(linux, sys_sched_setattr);
233 DECL_TEMPLATE(linux, sys_sched_getattr);
234 DECL_TEMPLATE(linux, sys_sched_setscheduler);
235 DECL_TEMPLATE(linux, sys_sched_getscheduler);
236 DECL_TEMPLATE(linux, sys_sched_yield);
237 DECL_TEMPLATE(linux, sys_sched_get_priority_max);
238 DECL_TEMPLATE(linux, sys_sched_get_priority_min);
239 DECL_TEMPLATE(linux, sys_sched_rr_get_interval);
240 DECL_TEMPLATE(linux, sys_sched_setaffinity);
241 DECL_TEMPLATE(linux, sys_sched_getaffinity);
243 DECL_TEMPLATE(linux, sys_unshare);
244 DECL_TEMPLATE(linux, sys_setns);
246 // These ones have different parameters and/or return values on Darwin.
247 // Also, some archs on Linux do not match the generic wrapper for sys_pipe.
248 DECL_TEMPLATE(linux, sys_munlockall);
249 DECL_TEMPLATE(linux, sys_pipe);
250 DECL_TEMPLATE(linux, sys_pipe2);
251 DECL_TEMPLATE(linux, sys_quotactl);
252 DECL_TEMPLATE(linux, sys_waitid);
254 // Posix, but in Darwin utime is a libc function that calls syscall utimes.
255 DECL_TEMPLATE(linux, sys_utime);
257 // On Darwin, off_t is 64-bits even on 32-bit platforms.
258 DECL_TEMPLATE(linux, sys_lseek);
260 // Darwin (and probably other OSes) don't have the old_sigset_t type.
261 DECL_TEMPLATE(linux, sys_sigpending);
262 DECL_TEMPLATE(linux, sys_sigprocmask);
263 DECL_TEMPLATE(linux, sys_sigaction);
265 // I think these are Linux-specific?
266 DECL_TEMPLATE(linux, sys_rt_sigaction);
267 DECL_TEMPLATE(linux, sys_rt_sigprocmask);
268 DECL_TEMPLATE(linux, sys_rt_sigpending);
269 DECL_TEMPLATE(linux, sys_rt_sigtimedwait);
270 DECL_TEMPLATE(linux, sys_rt_sigqueueinfo);
271 DECL_TEMPLATE(linux, sys_rt_tgsigqueueinfo);
272 DECL_TEMPLATE(linux, sys_rt_sigsuspend);
274 // Linux-specific?
275 DECL_TEMPLATE(linux, sys_sync_file_range);
276 DECL_TEMPLATE(linux, sys_sync_file_range2);
277 DECL_TEMPLATE(linux, sys_stime); /* maybe generic? I'm not sure */
279 // Linux specific (kernel modules)
280 DECL_TEMPLATE(linux, sys_init_module);
281 DECL_TEMPLATE(linux, sys_finit_module);
282 DECL_TEMPLATE(linux, sys_delete_module);
284 // Linux-specific (oprofile-related)
285 DECL_TEMPLATE(linux, sys_lookup_dcookie); // (*/32/64) L
287 // Linux-specific (new in Linux 3.2)
288 DECL_TEMPLATE(linux, sys_process_vm_readv);
289 DECL_TEMPLATE(linux, sys_process_vm_writev);
291 // Linux-specific (new in Linux 2.6.36)
292 DECL_TEMPLATE(linux, sys_fanotify_init);
293 DECL_TEMPLATE(linux, sys_fanotify_mark);
295 // Linux-specific (new in Linux 3.17)
296 DECL_TEMPLATE(linux, sys_getrandom);
297 DECL_TEMPLATE(linux, sys_memfd_create);
299 DECL_TEMPLATE(linux, sys_syncfs);
301 DECL_TEMPLATE(linux, sys_membarrier);
303 // Linux-specific (new in Linux 3.18)
304 DECL_TEMPLATE(linux, sys_bpf);
306 // Linux-specific (new in Linux 3.19)
307 DECL_TEMPLATE(linux, sys_execveat);
309 // Linux-specific (new in Linux 4.11)
310 DECL_TEMPLATE(linux, sys_statx);
312 // Linux-specific memory protection key syscalls (since Linux 4.9)
313 DECL_TEMPLATE(linux, sys_pkey_alloc);
314 DECL_TEMPLATE(linux, sys_pkey_free);
315 DECL_TEMPLATE(linux, sys_pkey_mprotect);
317 // Linux io_uring system calls. See also commit 2b188cc1bb85 ("Add io_uring IO
318 // interface") # v5.1. See also commit edafccee56ff ("io_uring: add support
319 // for pre-mapped user IO buffers") # v5.1.
320 DECL_TEMPLATE(linux, sys_io_uring_setup);
321 DECL_TEMPLATE(linux, sys_io_uring_enter);
322 DECL_TEMPLATE(linux, sys_io_uring_register);
324 // open_tree and friends (shared linux syscalls)
325 DECL_TEMPLATE(linux, sys_open_tree);
326 DECL_TEMPLATE(linux, sys_move_mount);
327 DECL_TEMPLATE(linux, sys_fsopen);
328 DECL_TEMPLATE(linux, sys_fsconfig);
329 DECL_TEMPLATE(linux, sys_fsmount);
330 DECL_TEMPLATE(linux, sys_fspick);
332 // Linux-specific (new in Linux 5.3)
333 DECL_TEMPLATE(linux, sys_pidfd_open);
335 // Linux-specific (new in Linux 5.9)
336 DECL_TEMPLATE(linux, sys_close_range);
337 DECL_TEMPLATE(linux, sys_openat2);
339 // Linux-specific (new in Linux 5.13)
340 DECL_TEMPLATE(linux, sys_landlock_create_ruleset)
341 DECL_TEMPLATE(linux, sys_landlock_add_rule)
342 DECL_TEMPLATE(linux, sys_landlock_restrict_self)
344 // Linux-specific (new in Linux 5.14)
345 DECL_TEMPLATE(linux, sys_memfd_secret);
347 // Linux-specific (since Linux 5.6)
348 DECL_TEMPLATE(linux, sys_pidfd_getfd);
350 // Since Linux 6.6
351 DECL_TEMPLATE(linux, sys_fchmodat2);
353 /* ---------------------------------------------------------------------
354 Wrappers for sockets and ipc-ery. These are split into standalone
355 procedures because x86-linux hides them inside multiplexors
356 (sys_socketcall and sys_ipc).
357 ------------------------------------------------------------------ */
359 #define TId ThreadId
360 #define UW UWord
361 #define SR SysRes
363 extern void ML_(linux_PRE_sys_msgsnd) ( TId, UW, UW, UW, UW );
364 extern void ML_(linux_PRE_sys_msgrcv) ( TId, UW, UW, UW, UW, UW );
365 extern void ML_(linux_POST_sys_msgrcv) ( TId, UW, UW, UW, UW, UW, UW );
366 extern void ML_(linux_PRE_sys_msgctl) ( TId, UW, UW, UW );
367 extern void ML_(linux_POST_sys_msgctl) ( TId, UW, UW, UW, UW );
368 extern void ML_(linux_PRE_sys_getsockopt) ( TId, UW, UW, UW, UW, UW );
369 extern void ML_(linux_POST_sys_getsockopt) ( TId, SR, UW, UW, UW, UW, UW );
370 extern void ML_(linux_PRE_sys_setsockopt) ( TId, UW, UW, UW, UW, UW );
371 extern void ML_(linux_PRE_sys_recvmmsg) ( TId, UW, UW, UW, UW, UW );
372 extern void ML_(linux_POST_sys_recvmmsg) ( TId, UW, UW, UW, UW, UW, UW );
373 extern void ML_(linux_PRE_sys_sendmmsg) ( TId, UW, UW, UW, UW );
374 extern void ML_(linux_POST_sys_sendmmsg) ( TId, UW, UW, UW, UW, UW );
376 // Linux-specific (but non-arch-specific) ptrace wrapper helpers
377 extern void ML_(linux_PRE_getregset) ( ThreadId, long, long );
378 extern void ML_(linux_PRE_setregset) ( ThreadId, long, long );
379 extern void ML_(linux_POST_traceme) ( ThreadId );
380 extern void ML_(linux_POST_getregset)( ThreadId, long, long );
382 #undef TId
383 #undef UW
384 #undef SR
386 /* sys_ipc and sys_socketcall are multiplexors which implements several syscalls.
387 Used e.g. by x86, ppc32, ppc64, ... */
388 DECL_TEMPLATE(linux, sys_ipc);
389 DECL_TEMPLATE(linux, sys_socketcall);
391 /* Depending on the platform, the below are implemented as
392 direct syscalls or via the above sys_socketcall multiplexor. */
394 /* Direct ipc related syscalls. */
395 /* Semaphore */
396 DECL_TEMPLATE(linux, sys_semget);
397 DECL_TEMPLATE(linux, sys_semop);
398 DECL_TEMPLATE(linux, sys_semctl);
399 DECL_TEMPLATE(linux, sys_semtimedop);
400 /* Shared memory */
401 DECL_TEMPLATE(linux, sys_shmat);
402 DECL_TEMPLATE(linux, sys_shmget);
403 DECL_TEMPLATE(linux, sys_shmdt);
404 DECL_TEMPLATE(linux, sys_shmctl);
405 /* Message queue */
406 DECL_TEMPLATE(linux, sys_msgget);
407 DECL_TEMPLATE(linux, sys_msgrcv);
408 DECL_TEMPLATE(linux, sys_msgsnd);
409 DECL_TEMPLATE(linux, sys_msgctl);
411 /* Direct socket related syscalls. */
412 DECL_TEMPLATE(linux, sys_socket);
413 DECL_TEMPLATE(linux, sys_setsockopt);
414 DECL_TEMPLATE(linux, sys_getsockopt);
415 DECL_TEMPLATE(linux, sys_connect);
416 DECL_TEMPLATE(linux, sys_accept);
417 DECL_TEMPLATE(linux, sys_accept4);
418 DECL_TEMPLATE(linux, sys_send);
419 DECL_TEMPLATE(linux, sys_sendto);
420 DECL_TEMPLATE(linux, sys_recv);
421 DECL_TEMPLATE(linux, sys_recvfrom);
422 DECL_TEMPLATE(linux, sys_sendmsg);
423 DECL_TEMPLATE(linux, sys_recvmsg);
424 DECL_TEMPLATE(linux, sys_shutdown);
425 DECL_TEMPLATE(linux, sys_bind);
426 DECL_TEMPLATE(linux, sys_listen);
427 DECL_TEMPLATE(linux, sys_getsockname);
428 DECL_TEMPLATE(linux, sys_getpeername);
429 DECL_TEMPLATE(linux, sys_socketpair);
430 DECL_TEMPLATE(linux, sys_kcmp);
431 DECL_TEMPLATE(linux, sys_copy_file_range);
433 /* 64bit time_t syscalls for 32bit arches. */
434 DECL_TEMPLATE(linux, sys_clock_gettime64)
435 DECL_TEMPLATE(linux, sys_clock_settime64)
436 // clock_adjtime64
437 DECL_TEMPLATE(linux, sys_clock_getres_time64)
438 DECL_TEMPLATE(linux, sys_clock_nanosleep_time64);
439 DECL_TEMPLATE(linux, sys_timer_gettime64);
440 DECL_TEMPLATE(linux, sys_timer_settime64);
441 DECL_TEMPLATE(linux, sys_timerfd_gettime64);
442 DECL_TEMPLATE(linux, sys_timerfd_settime64);
443 DECL_TEMPLATE(linux, sys_utimensat_time64);
444 DECL_TEMPLATE(linux, sys_pselect6_time64);
445 DECL_TEMPLATE(linux, sys_ppoll_time64);
446 // io_pgetevents_time64
447 DECL_TEMPLATE(linux, sys_recvmmsg_time64);
448 DECL_TEMPLATE(linux, sys_mq_timedsend_time64);
449 DECL_TEMPLATE(linux, sys_mq_timedreceive_time64);
450 DECL_TEMPLATE(linux, sys_semtimedop_time64);
451 DECL_TEMPLATE(linux, sys_rt_sigtimedwait_time64);
452 DECL_TEMPLATE(linux, sys_futex_time64);
453 DECL_TEMPLATE(linux, sys_sched_rr_get_interval_time64);
455 // Some arch specific functions called from syswrap-linux.c
456 extern Int do_syscall_clone_x86_linux ( Word (*fn)(void *),
457 void* stack,
458 Int flags,
459 void* arg,
460 Int* child_tid,
461 Int* parent_tid,
462 void* tls_ptr);
463 extern SysRes ML_(x86_sys_set_thread_area) ( ThreadId tid,
464 vki_modify_ldt_t* info );
465 extern void ML_(x86_setup_LDT_GDT) ( /*OUT*/ ThreadArchState *child,
466 /*IN*/ ThreadArchState *parent );
468 extern Long do_syscall_clone_amd64_linux ( Word (*fn)(void *),
469 void* stack,
470 Long flags,
471 void* arg,
472 Int* child_tid,
473 Int* parent_tid,
474 void* tls_ptr);
475 extern ULong do_syscall_clone_ppc32_linux ( Word (*fn)(void *),
476 void* stack,
477 Int flags,
478 void* arg,
479 Int* child_tid,
480 Int* parent_tid,
481 void* tls_ptr);
482 extern ULong do_syscall_clone_ppc64_linux ( Word (*fn)(void *),
483 void* stack,
484 Int flags,
485 void* arg,
486 Int* child_tid,
487 Int* parent_tid,
488 void* tls_ptr );
489 extern ULong do_syscall_clone_s390x_linux ( void *stack,
490 ULong flags,
491 Int *parent_tid,
492 Int *child_tid,
493 void* tls_ptr,
494 Word (*fn)(void *),
495 void *arg);
496 extern Long do_syscall_clone_arm64_linux ( Word (*fn)(void *),
497 void* stack,
498 Long flags,
499 void* arg,
500 Int* child_tid,
501 Int* parent_tid,
502 void* tls_ptr );
503 extern ULong do_syscall_clone_arm_linux ( Word (*fn)(void *),
504 void* stack,
505 Int flags,
506 void* arg,
507 Int* child_tid,
508 Int* parent_tid,
509 void* tls_ptr );
510 extern ULong do_syscall_clone_mips64_linux ( Word (*fn) (void *), /* a0 - 4 */
511 void* stack, /* a1 - 5 */
512 Int flags, /* a2 - 6 */
513 void* arg, /* a3 - 7 */
514 Int* parent_tid, /* a4 - 8 */
515 void* tls_ptr, /* a5 - 9 */
516 Int* child_tid ); /* a6 - 10 */
517 extern UInt do_syscall_clone_mips_linux ( Word (*fn) (void *), //a0 0 32
518 void* stack, //a1 4 36
519 Int flags, //a2 8 40
520 void* arg, //a3 12 44
521 Int* child_tid, //stack 16 48
522 Int* parent_tid, //stack 20 52
523 void* tls_ptr); //stack 24 56
524 extern UInt do_syscall_clone_nanomips_linux ( Word (*fn) (void *), /* a0 - 4 */
525 void* stack, /* a1 - 5 */
526 Int flags, /* a2 - 6 */
527 void* arg, /* a3 - 7 */
528 Int* child_tid, /* a4 - 8 */
529 Int* parent_tid, /* a5 - 9 */
530 void* tls_ptr); /* a6 - 10 */
531 #endif // __PRIV_SYSWRAP_LINUX_H
533 /*--------------------------------------------------------------------*/
534 /*--- end ---*/
535 /*--------------------------------------------------------------------*/