diff options
Diffstat (limited to 'linuxthreads/sysdeps/s390/s390-64/pt-machine.h')
-rw-r--r-- | linuxthreads/sysdeps/s390/s390-64/pt-machine.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linuxthreads/sysdeps/s390/s390-64/pt-machine.h b/linuxthreads/sysdeps/s390/s390-64/pt-machine.h index 92ebe1ecc4..c0f30789c2 100644 --- a/linuxthreads/sysdeps/s390/s390-64/pt-machine.h +++ b/linuxthreads/sysdeps/s390/s390-64/pt-machine.h @@ -58,6 +58,13 @@ testandset (int *spinlock) #define CURRENT_STACK_FRAME stack_pointer register char * stack_pointer __asm__ ("15"); +#ifdef USE_TLS +/* Return the thread descriptor for the current thread. */ +# define THREAD_SELF ((pthread_descr) __builtin_thread_pointer ()) + +/* Initialize the thread-unique value. */ +#define INIT_THREAD_SELF(descr, nr) __builtin_set_thread_pointer (descr) +#else /* Return the thread descriptor for the current thread. 64 bit S/390 uses access register 0 and 1 as "thread register". */ #define THREAD_SELF ({ \ @@ -76,6 +83,7 @@ register char * stack_pointer __asm__ ("15"); " sar %%a0,0\n" \ : : "d" (descr) : "0" ); \ }) +#endif /* Access to data in the thread descriptor is easy. */ #define THREAD_GETMEM(descr, member) THREAD_SELF->member |