about summary refs log tree commit diff
path: root/sysdeps/nptl/pthread-offsets.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/nptl/pthread-offsets.h')
-rw-r--r--sysdeps/nptl/pthread-offsets.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/nptl/pthread-offsets.h b/sysdeps/nptl/pthread-offsets.h
new file mode 100644
index 0000000000..a399608aa1
--- /dev/null
+++ b/sysdeps/nptl/pthread-offsets.h
@@ -0,0 +1,26 @@
+#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