From b8caea2cb90092ba8ecd3274898f227bbe2d305d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 14 May 2012 12:56:56 -0700 Subject: Add x32 pthread types --- .../unix/sysv/linux/x86_64/bits/pthreadtypes.h | 41 ++++++++++++++-------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'nptl/sysdeps/unix') diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h index e05b8f5c36..e22947f344 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h @@ -20,16 +20,28 @@ #include -#if __WORDSIZE == 64 -# define __SIZEOF_PTHREAD_ATTR_T 56 -# define __SIZEOF_PTHREAD_MUTEX_T 40 -# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 -# define __SIZEOF_PTHREAD_COND_T 48 -# define __SIZEOF_PTHREAD_CONDATTR_T 4 -# define __SIZEOF_PTHREAD_RWLOCK_T 56 -# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -# define __SIZEOF_PTHREAD_BARRIER_T 32 -# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +#ifdef __x86_64__ +# if __WORDSIZE == 64 +# define __SIZEOF_PTHREAD_ATTR_T 56 +# define __SIZEOF_PTHREAD_MUTEX_T 40 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 56 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 32 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +# else +# define __SIZEOF_PTHREAD_ATTR_T 32 +# define __SIZEOF_PTHREAD_MUTEX_T 32 +# define __SIZEOF_PTHREAD_MUTEXATTR_T 4 +# define __SIZEOF_PTHREAD_COND_T 48 +# define __SIZEOF_PTHREAD_CONDATTR_T 4 +# define __SIZEOF_PTHREAD_RWLOCK_T 44 +# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 +# define __SIZEOF_PTHREAD_BARRIER_T 20 +# define __SIZEOF_PTHREAD_BARRIERATTR_T 4 +# endif #else # define __SIZEOF_PTHREAD_ATTR_T 36 # define __SIZEOF_PTHREAD_MUTEX_T 24 @@ -59,7 +71,7 @@ typedef union pthread_attr_t pthread_attr_t; #endif -#if __WORDSIZE == 64 +#ifdef __x86_64__ typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; @@ -82,13 +94,13 @@ typedef union int __lock; unsigned int __count; int __owner; -#if __WORDSIZE == 64 +#ifdef __x86_64__ unsigned int __nusers; #endif /* KIND must stay at this position in the structure to maintain binary compatibility. */ int __kind; -#if __WORDSIZE == 64 +#ifdef __x86_64__ int __spins; __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 @@ -151,7 +163,7 @@ typedef int pthread_once_t; structure of the attribute type is not exposed on purpose. */ typedef union { -# if __WORDSIZE == 64 +# ifdef __x86_64__ struct { int __lock; @@ -167,6 +179,7 @@ typedef union /* FLAGS must stay at this position in the structure to maintain binary compatibility. */ unsigned int __flags; +# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 } __data; # else struct -- cgit 1.4.1