priv_syswrap-darwin.h revision 631b819596d389e9ad8ea0a0b5926f6107d7b1e0
1
2/*--------------------------------------------------------------------*/
3/*--- Private syscalls header for Darwin.    priv_syswrap-darwin.h ---*/
4/*--------------------------------------------------------------------*/
5
6/*
7   This file is part of Valgrind, a dynamic binary instrumentation
8   framework.
9
10   Copyright (C) 2005-2009 Apple Inc.
11      Greg Parker  gparker@apple.com
12
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.
17
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.
22
23   You should have received a copy of the GNU General Public License
24   along with this program; if not, write to the Free Software
25   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26   02111-1307, USA.
27
28   The GNU General Public License is contained in the file COPYING.
29*/
30
31#ifndef __PRIV_SYSWRAP_DARWIN_H
32#define __PRIV_SYSWRAP_DARWIN_H
33
34/* requires #include "priv_types_n_macros.h" */
35
36// syswrap-darwin.c
37Addr allocstack ( ThreadId tid );
38void find_stack_segment ( ThreadId tid, Addr sp );
39void start_thread_NORETURN ( Word arg );
40void assign_port_name(mach_port_t port, const char *name);
41void record_named_port(ThreadId tid, mach_port_t port, mach_port_right_t right, const char *name);
42
43extern const SyscallTableEntry ML_(mach_trap_table)[];
44extern const SyscallTableEntry ML_(syscall_table)[];
45extern const SyscallTableEntry ML_(mdep_trap_table)[];
46
47extern const UInt ML_(syscall_table_size);
48extern const UInt ML_(mach_trap_table_size);
49extern const UInt ML_(mdep_trap_table_size);
50
51void VG_(show_open_ports)(void);
52
53// Unix syscalls.
54// GEN = it uses the generic wrapper
55// NYI = wrapper not yet implemented in Valgrind
56// NOC = the non-"_nocancel" wrapper is used
57// old = the syscall no longer exists in Darwin
58DECL_TEMPLATE(darwin, exit);                    // 1
59// GEN fork 2
60// GEN read 3
61// GEN write 4
62// GEN open 5
63// GEN close 6
64// GEN wait4 7
65// old creat 8
66// GEN link 9
67// GEN unlink 10
68// old execv 11
69// GEN chdir 12
70// GEN fchdir 13
71// GEN mknod 14
72// GEN chmod 15
73// GEN chown 16
74// old break 17
75DECL_TEMPLATE(darwin, getfsstat);               // 18
76// old lseek 19
77// GEN getpid 20
78// old mount 21
79// old umount 22
80// GEN setuid 23
81// GEN getuid 24
82// GEN geteuid 25
83DECL_TEMPLATE(darwin, ptrace);                  // 26
84DECL_TEMPLATE(darwin, recvmsg);                 // 27
85DECL_TEMPLATE(darwin, sendmsg);                 // 28
86DECL_TEMPLATE(darwin, recvfrom);                // 29
87DECL_TEMPLATE(darwin, accept);                  // 30
88DECL_TEMPLATE(darwin, getpeername);             // 31
89DECL_TEMPLATE(darwin, getsockname);             // 32
90// GEN access 33
91DECL_TEMPLATE(darwin, chflags);                 // 34
92DECL_TEMPLATE(darwin, fchflags);                // 35
93// GEN sync 36
94// GEN kill 37
95// old stat 38
96// GEN getppid 39
97// old lstat 40
98// GEN dup 41
99DECL_TEMPLATE(darwin, pipe);                    // 42
100// GEN getegid 43
101// NYI profil
102// old ktrace
103DECL_TEMPLATE(darwin, sigaction);               // 46
104// GEN getgid 47
105DECL_TEMPLATE(darwin, sigprocmask);             // 48
106DECL_TEMPLATE(darwin, getlogin);                // 49
107// NYI setlogin 50
108// NYI acct 51
109DECL_TEMPLATE(darwin, sigpending);              // 52
110// GEN sigaltstack 53
111DECL_TEMPLATE(darwin, ioctl);                   // 54
112// NYI reboot 55
113// NYI revoke 56
114// NYI symlink 57
115// GEN readlink 58
116// GEN execve 59
117// GEN umask 60
118// GEN chroot 61
119// old fstat
120// 63 used internally, reserved
121// old getpagesize 64
122// GEN msync 65
123// GEN vfork 66
124// old vread
125// old vwrite
126// old sbrk
127// old sstk
128// old mmap
129// old vadvise
130// GEN munmap 73
131// GEN mprotect 74
132// GEN madvise 75
133// old vhangup
134// old vlimit
135// NYI mincore 78
136// GEN getgroups 79
137// NYI setgroups 80
138// GEN getpgrp 81
139// NYI setpgid 82
140// GEN setitimer 83
141// old wait
142// NYI swapon 85
143// GEN getitimer 86
144// old gethostname
145// old sethostname
146DECL_TEMPLATE(darwin, getdtablesize);           // 89
147// GEN dup2 90
148// old getdopt
149DECL_TEMPLATE(darwin, fcntl);                   // 92
150// GEN select 93
151// old setdopt
152// GEN fsync 95
153// GEN setpriority 96
154DECL_TEMPLATE(darwin, socket);                  // 97
155DECL_TEMPLATE(darwin, connect);                 // 98
156// old accept
157// GEN getpriority 100
158// old send
159// old recv
160// old sigreturn
161DECL_TEMPLATE(darwin, bind);                    // 104
162DECL_TEMPLATE(darwin, setsockopt);              // 105
163DECL_TEMPLATE(darwin, listen);                  // 106
164// old vtimes
165// old sigvec
166// old sigblock
167// old sigsetmask
168DECL_TEMPLATE(darwin, sigsuspend);              // 111
169// old sigstack
170// old recvmsg
171// old sendmsg
172// old vtrace
173// GEN gettimeofday 116
174// GEN getrusage 117
175DECL_TEMPLATE(darwin, getsockopt);              // 118
176// old resuba
177// GEN readv 120
178// GEN writev 121
179// NYI settimeofday 122
180// GEN fchown 123
181// GEN fchmod 124
182// old recvfrom
183// NYI setreuid 126
184// NYI setregid 127
185// GEN rename 128
186// old truncate
187// old ftruncate
188// GEN flock 131
189// NYI mkfifo 132
190DECL_TEMPLATE(darwin, sendto);                  // 133
191DECL_TEMPLATE(darwin, shutdown);                // 134
192DECL_TEMPLATE(darwin, socketpair);              // 135
193// GEN mkdir 136
194// GEN rmdir 137
195// GEN utimes 138
196DECL_TEMPLATE(darwin, futimes);                 // 139
197// NYI adjtime 140
198// old getpeername
199DECL_TEMPLATE(darwin, gethostuuid);             // 142
200// old sethostid
201// old getrlimit
202// old setrlimit
203// old killpg
204// GEN setsid 147
205// old setquota
206// old qquota
207// old getsockname
208// NYI getpgid 151
209// NYI setprivexec 152
210// GEN pread 153
211// GEN pwrite 154
212// NYI nfssvc 155
213// old getdirentries
214// GEN statfs 157
215// GEN fstatfs 158
216// NYI unmount 159
217// old async_daemon
218// NYI getfh 161
219// old getdomainname
220// old setdomainname
221// 164
222// NYI quotactl 165
223// old exportfs
224// NYI mount 167
225// old ustat
226DECL_TEMPLATE(darwin, csops);                   // 169
227// old table
228// old wait3
229// old rpause
230// NYI waitid 173
231// old getdents
232// old gc_control
233// NYI add_profil 176
234// 177
235// 178
236// 179
237DECL_TEMPLATE(darwin, kdebug_trace);            // 180
238// GEN setgid 181
239DECL_TEMPLATE(darwin, setegid);                 // 182
240DECL_TEMPLATE(darwin, seteuid);                 // 183
241DECL_TEMPLATE(darwin, sigreturn);               // 184
242DECL_TEMPLATE(darwin, FAKE_SIGRETURN);
243// NYI chud 185
244// 186
245// 187
246// GEN stat 188
247// GEN fstat 189
248// GEN lstat 190
249DECL_TEMPLATE(darwin, pathconf);            // 191
250DECL_TEMPLATE(darwin, fpathconf);           // 192
251// 193
252// GEN getrlimit 194
253// GEN setrlimit 195
254DECL_TEMPLATE(darwin, getdirentries);       // 196
255DECL_TEMPLATE(darwin, mmap);                // 197
256// 198  __syscall
257DECL_TEMPLATE(darwin, lseek);               // 199 (was UX64)
258// GEN truncate 200
259// GEN ftruncate 201
260DECL_TEMPLATE(darwin, __sysctl);                // 202
261// GEN mlock 203
262// GEN munlock 204
263// NYI undelete 205
264// NYI ATsocket 206
265// NYI ATgetmsg 207
266// NYI ATputmsg 208
267// NYI ATPsndreq 209
268// NYI ATPsndrsp 210
269// NYI ATPgetreq 211
270// NYI ATPgetrsp 212
271// 213  Reserved for AppleTalk
272// NYI kqueue_from_portset_np 214
273// NYI kqueue_portset_np 215
274// NYI mkcomplex 216
275// NYI statv 217
276// NYI lstatv 218
277// NYI fstatv 219
278DECL_TEMPLATE(darwin, getattrlist);             // 220
279DECL_TEMPLATE(darwin, setattrlist);             // 221
280DECL_TEMPLATE(darwin, getdirentriesattr);       // 222
281DECL_TEMPLATE(darwin, exchangedata);            // 223
282// 224 checkuseraccess
283// NYI searchfs 225
284// GEN delete 226
285// NYI copyfile 226
286// 228
287// 229
288// GEN poll 230
289DECL_TEMPLATE(darwin, watchevent);              // 231
290DECL_TEMPLATE(darwin, waitevent);               // 232
291DECL_TEMPLATE(darwin, modwatch);                // 233
292DECL_TEMPLATE(darwin, getxattr);                // 234
293DECL_TEMPLATE(darwin, fgetxattr);               // 235
294DECL_TEMPLATE(darwin, setxattr);                // 236
295DECL_TEMPLATE(darwin, fsetxattr);               // 237
296// NYI removexattr 238
297// NYI fremovexattr 239
298DECL_TEMPLATE(darwin, listxattr);               // 240
299DECL_TEMPLATE(darwin, flistxattr);              // 241
300DECL_TEMPLATE(darwin, fsctl);                   // 242
301DECL_TEMPLATE(darwin, initgroups);              // 243
302DECL_TEMPLATE(darwin, posix_spawn);             // 244
303// 245
304// 246
305// NYI nfsclnt 247
306// NYI fhopen 248
307// 249
308// NYI minherit 250
309// NYI semsys 251
310// NYI msgsys 252
311// NYI shmsys 253
312DECL_TEMPLATE(darwin, semctl);                  // 254
313DECL_TEMPLATE(darwin, semget);                  // 255
314DECL_TEMPLATE(darwin, semop);                   // 256
315// 257
316// NYI msgctl 258
317// NYI msgget 259
318// NYI msgsnd 260
319// NYI msgrcv 261
320DECL_TEMPLATE(darwin, shmat);                   // 262
321DECL_TEMPLATE(darwin, shmctl);                  // 263
322DECL_TEMPLATE(darwin, shmdt);                   // 264
323DECL_TEMPLATE(darwin, shmget);                  // 265
324DECL_TEMPLATE(darwin, shm_open);                // 266
325// NYI shm_unlink 267
326DECL_TEMPLATE(darwin, sem_open);                // 268
327DECL_TEMPLATE(darwin, sem_close);               // 269
328DECL_TEMPLATE(darwin, sem_unlink);              // 270
329DECL_TEMPLATE(darwin, sem_wait);                // 271
330DECL_TEMPLATE(darwin, sem_trywait);             // 272
331DECL_TEMPLATE(darwin, sem_post);                // 273
332// NYI sem_getvalue 274
333DECL_TEMPLATE(darwin, sem_init);                // 275
334DECL_TEMPLATE(darwin, sem_destroy);             // 276
335// NYI open_extended 277
336// NYI umask_extended 278
337DECL_TEMPLATE(darwin, stat_extended);           // 279
338DECL_TEMPLATE(darwin, lstat_extended);          // 280
339// NYI fstat_extended 281
340DECL_TEMPLATE(darwin, chmod_extended);          // 282
341DECL_TEMPLATE(darwin, fchmod_extended);         // 283
342// NYI access_extended 284
343DECL_TEMPLATE(darwin, settid);                  // 285
344// NYI gettid 286
345// NYI setsgroups 287
346// NYI getsgroups 288
347// NYI setwgroups 289
348// NYI getwgroups 290
349// NYI mkfifo_extended 291
350// NYI mkdir_extended 292
351// NYI identitysvc 293
352// NYI shared_region_check_np 294
353// NYI shared_region_map_np 295
354// old load_shared_file
355// old reset_shared_file
356// old new_system_shared_regions
357// old shared_region_map_file_np
358// old shared_region_make_private_np
359// NYI __pthread_mutex_destroy 301
360// NYI __pthread_mutex_init 302
361// NYI __pthread_mutex_lock 303
362// NYI __pthread_mutex_trylock 304
363// NYI __pthread_mutex_unlock 305
364// NYI __pthread_cond_init 306
365// NYI __pthread_cond_destroy 307
366// NYI __pthread_cond_broadcast 308
367// NYI __pthread_cond_signal 309
368// NYI getsid 310
369// NYI settid_with_pid 311
370// NYI __pthread_cond_timedwait 312
371// NYI aio_fsync 313
372// NYI aio_return 314
373// NYI aio_suspend 315
374// NYI aio_cancel 316
375// NYI aio_error 317
376// NYI aio_read 318
377// NYI aio_write 319
378// NYI lio_listio 320
379// NYI __pthread_cond_wait 321
380// NYI iopolicysys 322
381// 323
382// NYI mlockall 324
383// NYI munlockall 325
384// 326
385DECL_TEMPLATE(darwin, issetugid);               // 327
386// NYI __pthread_kill 328
387DECL_TEMPLATE(darwin, __pthread_sigmask);       // 329
388// NYI __sigwait 330
389DECL_TEMPLATE(darwin, __disable_threadsignal);  // 331
390DECL_TEMPLATE(darwin, __pthread_markcancel);    // 332
391DECL_TEMPLATE(darwin, __pthread_canceled);      // 333
392DECL_TEMPLATE(darwin, __semwait_signal);        // 334
393// old utrace
394// NYI proc_info 336
395DECL_TEMPLATE(darwin, sendfile);                // 337
396DECL_TEMPLATE(darwin, stat64);                  // 338
397DECL_TEMPLATE(darwin, fstat64);                 // 339
398DECL_TEMPLATE(darwin, lstat64);                 // 340
399DECL_TEMPLATE(darwin, stat64_extended);         // 341
400DECL_TEMPLATE(darwin, lstat64_extended);        // 342
401// NYI fstat64_extended 343
402DECL_TEMPLATE(darwin, getdirentries64);         // 344
403DECL_TEMPLATE(darwin, statfs64);                // 345
404DECL_TEMPLATE(darwin, fstatfs64);               // 346
405// NYI getfsstat64 347
406// NYI __pthread_chdir 348
407// NYI __pthread_fchdir 349
408// NYI audit 350
409DECL_TEMPLATE(darwin, auditon);                 // 351
410// 352
411// NYI getauid 353
412// NYI setauid 354
413// NYI getaudit 355
414// NYI setaudit 356
415// NYI getaudit_addr 357
416// NYI setaudit_addr 358
417// NYI auditctl 359
418DECL_TEMPLATE(darwin, bsdthread_create);        // 360
419DECL_TEMPLATE(darwin, bsdthread_terminate);     // 361
420DECL_TEMPLATE(darwin, kqueue);                  // 362
421DECL_TEMPLATE(darwin, kevent);                  // 363
422// NYI lchown 364
423// NYI stack_snapshot 365
424DECL_TEMPLATE(darwin, bsdthread_register);      // 366
425DECL_TEMPLATE(darwin, workq_open);              // 367
426DECL_TEMPLATE(darwin, workq_ops);               // 368
427// 369
428// 370
429// 371
430// 372
431// 373
432// 374
433// 375
434// 376
435// 377
436// 378
437// 379
438// NYI __mac_execve 380
439DECL_TEMPLATE(darwin, __mac_syscall);           // 381
440// NYI __mac_get_file 382
441// NYI __mac_set_file 383
442// NYI __mac_get_link 384
443// NYI __mac_set_link 385
444// NYI __mac_get_proc 386
445// NYI __mac_set_proc 387
446// NYI __mac_get_fd 388
447// NYI __mac_set_fd 389
448// NYI __mac_get_pid 390
449// NYI __mac_get_lcid 391
450// NYI __mac_get_lctx 392
451// NYI __mac_set_lctx 393
452// NYI setlcid 394
453// NYI getlcid 395
454// GEN read_nocancel 396
455// GEN write_nocancel 397
456// GEN open_nocancel 398
457// GEN close_nocancel 399
458// GEN wait4_nocancel 400
459// NOC recvmsg_nocancel 401
460// NOC sendmsg_nocancel 402
461// NOC recvfrom_nocancel 403
462// NOC accept_nocancel 404
463// GEN msync_nocancel 405
464// NOC fcntl_nocancel 406
465// GEN select_nocancel 407
466// GEN fsync_nocancel 408
467// NOC connect_nocancel 409
468// NYI sigsuspend_nocancel 410
469// GEN readv_nocancel 411
470// GEN writev_nocancel 412
471// NOC sendto_nocancel 413
472// GEN pread_nocancel 414
473// GEN pwrite_nocancel 415
474// NYI waitid_nocancel 416
475// GEN poll_nocancel 417
476// NYI msgsnd_nocancel 418
477// NYI msgrcv_nocancel 419
478// NOC sem_wait_nocancel 420
479// NYI aio_suspend_nocancel 421
480// NYI __sigwait_nocancel 422
481// NOC __semwait_signal_nocancel 423
482// NYI __mac_mount 424
483// NYI __mac_get_mount 425
484// NYI __mac_getfsstat 426
485
486// Mach message helpers
487DECL_TEMPLATE(darwin, host_info);
488DECL_TEMPLATE(darwin, host_page_size);
489DECL_TEMPLATE(darwin, host_get_io_master);
490DECL_TEMPLATE(darwin, host_get_clock_service);
491DECL_TEMPLATE(darwin, host_request_notification);
492DECL_TEMPLATE(darwin, mach_port_type);
493DECL_TEMPLATE(darwin, mach_port_extract_member);
494DECL_TEMPLATE(darwin, mach_port_allocate);
495DECL_TEMPLATE(darwin, mach_port_deallocate);
496DECL_TEMPLATE(darwin, mach_port_get_refs);
497DECL_TEMPLATE(darwin, mach_port_mod_refs);
498DECL_TEMPLATE(darwin, mach_port_get_set_status);
499DECL_TEMPLATE(darwin, mach_port_destroy);
500DECL_TEMPLATE(darwin, mach_port_request_notification);
501DECL_TEMPLATE(darwin, mach_port_insert_right);
502DECL_TEMPLATE(darwin, mach_port_get_attributes);
503DECL_TEMPLATE(darwin, mach_port_set_attributes);
504DECL_TEMPLATE(darwin, mach_port_insert_member);
505DECL_TEMPLATE(darwin, task_get_special_port);
506DECL_TEMPLATE(darwin, semaphore_create);
507DECL_TEMPLATE(darwin, semaphore_destroy);
508DECL_TEMPLATE(darwin, mach_ports_lookup);
509DECL_TEMPLATE(darwin, task_threads);
510DECL_TEMPLATE(darwin, task_suspend);
511DECL_TEMPLATE(darwin, task_resume);
512DECL_TEMPLATE(darwin, vm_allocate);
513DECL_TEMPLATE(darwin, vm_deallocate);
514DECL_TEMPLATE(darwin, vm_protect);
515DECL_TEMPLATE(darwin, vm_inherit);
516DECL_TEMPLATE(darwin, vm_read);
517DECL_TEMPLATE(darwin, mach_vm_read);
518DECL_TEMPLATE(darwin, vm_copy);
519DECL_TEMPLATE(darwin, vm_read_overwrite);
520DECL_TEMPLATE(darwin, vm_map);
521DECL_TEMPLATE(darwin, vm_remap);
522DECL_TEMPLATE(darwin, mach_make_memory_entry_64);
523DECL_TEMPLATE(darwin, vm_purgable_control);
524DECL_TEMPLATE(darwin, mach_vm_purgable_control);
525DECL_TEMPLATE(darwin, mach_vm_allocate);
526DECL_TEMPLATE(darwin, mach_vm_deallocate);
527DECL_TEMPLATE(darwin, mach_vm_protect);
528DECL_TEMPLATE(darwin, mach_vm_copy);
529DECL_TEMPLATE(darwin, mach_vm_inherit);
530DECL_TEMPLATE(darwin, mach_vm_map);
531DECL_TEMPLATE(darwin, mach_vm_region_recurse);
532DECL_TEMPLATE(darwin, thread_terminate);
533DECL_TEMPLATE(darwin, thread_create);
534DECL_TEMPLATE(darwin, thread_create_running);
535DECL_TEMPLATE(darwin, thread_suspend);
536DECL_TEMPLATE(darwin, thread_get_state);
537DECL_TEMPLATE(darwin, thread_policy);
538DECL_TEMPLATE(darwin, thread_info);
539DECL_TEMPLATE(darwin, bootstrap_register);
540DECL_TEMPLATE(darwin, bootstrap_look_up);
541DECL_TEMPLATE(darwin, mach_msg_receive);
542DECL_TEMPLATE(darwin, mach_msg_bootstrap);
543DECL_TEMPLATE(darwin, mach_msg_host);
544DECL_TEMPLATE(darwin, mach_msg_task);
545DECL_TEMPLATE(darwin, mach_msg_thread);
546
547// Mach traps
548DECL_TEMPLATE(darwin, mach_msg_unhandled);
549DECL_TEMPLATE(darwin, mach_msg);
550DECL_TEMPLATE(darwin, mach_reply_port);
551DECL_TEMPLATE(darwin, mach_thread_self);
552DECL_TEMPLATE(darwin, mach_host_self);
553DECL_TEMPLATE(darwin, mach_task_self);
554DECL_TEMPLATE(darwin, syscall_thread_switch);
555DECL_TEMPLATE(darwin, semaphore_signal);
556DECL_TEMPLATE(darwin, semaphore_signal_all);
557DECL_TEMPLATE(darwin, semaphore_signal_thread);
558DECL_TEMPLATE(darwin, semaphore_wait);
559DECL_TEMPLATE(darwin, semaphore_wait_signal);
560DECL_TEMPLATE(darwin, semaphore_timedwait);
561DECL_TEMPLATE(darwin, semaphore_timedwait_signal);
562DECL_TEMPLATE(darwin, task_for_pid);
563DECL_TEMPLATE(darwin, pid_for_task);
564DECL_TEMPLATE(darwin, mach_timebase_info);
565DECL_TEMPLATE(darwin, mach_wait_until);
566DECL_TEMPLATE(darwin, mk_timer_create);
567DECL_TEMPLATE(darwin, mk_timer_destroy);
568DECL_TEMPLATE(darwin, mk_timer_arm);
569DECL_TEMPLATE(darwin, mk_timer_cancel);
570DECL_TEMPLATE(darwin, iokit_user_client_trap);
571DECL_TEMPLATE(darwin, swtch);
572DECL_TEMPLATE(darwin, swtch_pri);
573
574// Machine-dependent traps
575DECL_TEMPLATE(darwin, thread_fast_set_cthread_self);
576
577// syswrap-<arch>-darwin.c
578#include <mach/mach.h>
579extern
580void thread_state_from_vex(thread_state_t mach_generic,
581                           thread_state_flavor_t flavor,
582                           mach_msg_type_number_t count,
583                           VexGuestArchState *vex_generic);
584extern
585void thread_state_to_vex(const thread_state_t mach_generic,
586                         thread_state_flavor_t flavor,
587                         mach_msg_type_number_t count,
588                         VexGuestArchState *vex_generic);
589extern
590ThreadState *build_thread(const thread_state_t state,
591                          thread_state_flavor_t flavor,
592                          mach_msg_type_number_t count);
593extern
594void hijack_thread_state(thread_state_t mach_generic,
595                         thread_state_flavor_t flavor,
596                         mach_msg_type_number_t count,
597                         ThreadState *tst);
598extern
599__attribute__((noreturn))
600void call_on_new_stack_0_1 ( Addr stack,
601			     Addr retaddr,
602			     void (*f)(Word),
603                             Word arg1 );
604
605extern void pthread_hijack_asm(void);
606extern void pthread_hijack(Addr self, Addr kport, Addr func, Addr func_arg,
607                           Addr stacksize, Addr flags, Addr sp);
608extern void wqthread_hijack_asm(void);
609extern void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem, Int reuse, Addr sp);
610
611extern Addr pthread_starter;
612extern Addr wqthread_starter;
613extern SizeT pthread_structsize;
614
615
616#endif
617
618/*--------------------------------------------------------------------*/
619/*--- end                                                          ---*/
620/*--------------------------------------------------------------------*/
621