mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-29 08:11:08 +00:00
7ddac7f265
This patch adds a default pthread-offsets.h based on default thread definitions from struct_mutex.h and struct_rwlock.h. The idea is to simplify new ports inclusion. Checked with a build on affected abis. Change-Id: I7785a9581e651feb80d1413b9e03b5ac0452668a
27 lines
812 B
C
27 lines
812 B
C
#include <bits/wordsize.h>
|
|
|
|
/* These values are based on internal generic types from
|
|
mutex-internal.h and rwlock-internal.h. */
|
|
|
|
#if __WORDSIZE == 64
|
|
# define __PTHREAD_MUTEX_NUSERS_OFFSET 12
|
|
# define __PTHREAD_MUTEX_KIND_OFFSET 16
|
|
# define __PTHREAD_MUTEX_SPINS_OFFSET 20
|
|
# define __PTHREAD_MUTEX_LIST_OFFSET 24
|
|
#else
|
|
# define __PTHREAD_MUTEX_NUSERS_OFFSET 16
|
|
# define __PTHREAD_MUTEX_KIND_OFFSET 12
|
|
# define __PTHREAD_MUTEX_SPINS_OFFSET 20
|
|
# define __PTHREAD_MUTEX_LIST_OFFSET 20
|
|
#endif
|
|
|
|
#if __WORDSIZE == 64
|
|
# define __PTHREAD_RWLOCK_FLAGS_OFFSET 48
|
|
#else
|
|
# if __BYTE_ORDER == __BIG_ENDIAN
|
|
# define __PTHREAD_RWLOCK_FLAGS_OFFSET 27
|
|
# else
|
|
# define __PTHREAD_RWLOCK_FLAGS_OFFSET 24
|
|
# endif
|
|
#endif
|