]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/mach/hurd/htl/pt-sysdep.h
1 /* Internal definitions for pthreads library.
2 Copyright (C) 2000-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
20 #define _PT_SYSDEP_H 1
25 #define _POSIX_THREAD_THREADS_MAX 64
27 /* The default stack size. */
28 #define PTHREAD_STACK_DEFAULT (8 * 1024 * 1024)
30 #define PTHREAD_SYSDEP_MEMBERS \
31 thread_t kernel_thread; \
32 mach_msg_header_t wakeupmsg;
34 extern __thread
struct __pthread
*___pthread_self
;
36 #define _pthread_self() \
38 struct __pthread *thread; \
40 assert (__pthread_threads); \
41 thread = ___pthread_self; \
44 assert (({ mach_port_t ktid = __mach_thread_self (); \
45 int ok = thread->kernel_thread == ktid; \
46 __mach_port_deallocate (__mach_task_self (), ktid);\
51 #define _pthread_self() ___pthread_self
55 __attribute__ ((__always_inline__
))
56 __pthread_stack_dealloc (void *stackaddr
, size_t stacksize
)
58 __vm_deallocate (__mach_task_self (), (vm_offset_t
) stackaddr
, stacksize
);
61 /* Change thread THREAD's program counter to PC if SET_PC is true,
62 its stack pointer to SP if SET_IP is true, and its thread pointer
63 to TP if SET_TP is true. */
64 extern int __thread_set_pcsptp (thread_t thread
,
66 int set_sp
, void *sp
, int set_tp
, void *tp
);
69 #endif /* pt-sysdep.h */