finish unifying thread register handling in preparation for porting
[musl] / src / internal / pthread_impl.h
index b789210..e481ab5 100644 (file)
 #define pthread __pthread
 
 struct pthread {
-       struct pthread *self, *join;
-       int errno_val;
+       struct pthread *self;
+       unsigned long tlsdesc[4];
        pid_t tid, pid;
+       int tsd_used, errno_val, *errno_ptr;
        volatile int canceldisable, cancelasync, cancelpoint, cancel;
        unsigned char *map_base;
        size_t map_size;
@@ -32,27 +33,18 @@ struct pthread {
        jmp_buf exit_jmp_buf;
        int detached;
        int exitlock;
-       unsigned long tlsdesc[4];
        struct __ptcb *cancelbuf;
        void **tsd;
-       int tsd_used;
        pthread_attr_t attr;
-       int *errno_ptr;
 };
 
-static inline struct pthread *__pthread_self()
-{
-       struct pthread *self;
-       __asm__ ("movl %%gs:0,%0" : "=r" (self) );
-       return self;
-}
+#include "pthread_arch.h"
 
 #define SIGCANCEL 32
 #define SIGSYSCALL 33
 #define SIGTIMER  32 /* ?? */
 
-int __set_thread_area(unsigned long *);
-int __set_pthread_self(void *);
+int __set_thread_area(void *);
 int __libc_sigaction(int, const struct sigaction *, struct sigaction *);
 int __libc_sigprocmask(int, const sigset_t *, sigset_t *);
 void __lock(volatile int *);