X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Finternal%2Fpthread_impl.h;h=9424a5b7039619d2031f99e2ee815e5055dd9bf0;hp=98d9b22d6f061bab335af1dbeaa65b9339def6ad;hb=efd4d87aa472523b07889af69874259db43b3c3c;hpb=5a2e18093725c3965486641f0ad0b61a44f7ed68 diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h index 98d9b22d..9424a5b7 100644 --- a/src/internal/pthread_impl.h +++ b/src/internal/pthread_impl.h @@ -2,17 +2,9 @@ #define _PTHREAD_IMPL_H #include -#include #include -#include -#include #include #include -#include -#include -#include -#include -#include #include "libc.h" #include "syscall.h" #include "atomic.h" @@ -22,17 +14,18 @@ struct pthread { struct pthread *self; + void **dtv, *unused1, *unused2; + uintptr_t sysinfo; + uintptr_t canary; pid_t tid, pid; int tsd_used, errno_val, *errno_ptr; - volatile uintptr_t cp_sp, cp_ip; volatile int cancel, canceldisable, cancelasync; + int detached; unsigned char *map_base; size_t map_size; void *start_arg; void *(*start)(void *); void *result; - int detached; - int exitlock; struct __ptcb *cancelbuf; void **tsd; pthread_attr_t attr; @@ -45,7 +38,8 @@ struct pthread { int unblock_cancel; int delete_timer; locale_t locale; - int killlock; + int killlock[2]; + int exitlock[2]; }; struct __timer { @@ -57,7 +51,8 @@ struct __timer { #define _a_stacksize __u.__s[0] #define _a_guardsize __u.__s[1] -#define _a_detach __u.__i[2*__SU+0] +#define _a_stackaddr __u.__s[2] +#define _a_detach __u.__i[3*__SU+0] #define _m_type __u.__i[0] #define _m_lock __u.__i[1] #define _m_waiters __u.__i[2] @@ -79,7 +74,7 @@ struct __timer { #define _b_limit __u.__i[2] #define _b_count __u.__i[3] #define _b_waiters2 __u.__i[4] -#define _b_inst __u.__p[4] +#define _b_inst __u.__p[3] #include "pthread_arch.h" @@ -87,9 +82,12 @@ struct __timer { #define SIGCANCEL 33 #define SIGSYNCCALL 34 -#define SIGPT_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \ +#define SIGALL_SET ((sigset_t *)(const unsigned long long [2]){ -1,-1 }) +#define SIGPT_SET \ + ((sigset_t *)(const unsigned long [__SYSCALL_SSLEN/sizeof(long)]){ \ [sizeof(long)==4] = 3UL<<(32*(sizeof(long)>4)) }) -#define SIGTIMER_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \ +#define SIGTIMER_SET \ + ((sigset_t *)(const unsigned long [__SYSCALL_SSLEN/sizeof(long)]){ \ 0x80000000 }) pthread_t __pthread_self_init(void); @@ -105,10 +103,11 @@ int __timedwait(volatile int *, int, clockid_t, const struct timespec *, void (* void __wait(volatile int *, volatile int *, int, int); void __wake(volatile int *, int, int); -void __synccall_lock(); -void __synccall_unlock(); +void __acquire_ptc(); +void __release_ptc(); +void __inhibit_ptc(); -#define DEFAULT_STACK_SIZE (16384-PAGE_SIZE) +#define DEFAULT_STACK_SIZE 81920 #define DEFAULT_GUARD_SIZE PAGE_SIZE #endif