[RFC,13/22] Add Infinity THREAD_SELF macros to sysdeps/s390/nptl/tls.h

Message ID 1445352975-17844-14-git-send-email-gbenson@redhat.com
State New, archived
Headers

Commit Message

Gary Benson Oct. 20, 2015, 2:56 p.m. UTC
  This commit adds Infinity THREAD_SELF macros for s390.

I was confused as to how the size for the 64-bit version of
DB_THREAD_SELF used __WORDSIZE where the 32-bit version just
has 32.  I've used __s390x__ as a conditional and used
__WORDSIZE in the presumably 64-bit version for Infinity but
please advise if this should be changed.
---
 sysdeps/s390/nptl/tls.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
  

Patch

diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h
index e6f8a47..cf679ea 100644
--- a/sysdeps/s390/nptl/tls.h
+++ b/sysdeps/s390/nptl/tls.h
@@ -147,6 +147,16 @@  typedef struct
 # define DB_THREAD_SELF REGISTER (32, 32, 18 * 4, 0) \
 			REGISTER (64, __WORDSIZE, 18 * 8, 0)
 
+/* Magic for Infinity to know how to do THREAD_SELF.  */
+# define I8_THREAD_SELF I8_TS_REGISTER
+# if defined __s390x__
+#  define I8_TS_REG_SIZE __WORDSIZE
+#  define I8_TS_REG_OFFSET 18 * 8
+# else
+#  define I8_TS_REG_SIZE 32
+#  define I8_TS_REG_OFFSET 18 * 4
+# define I8_TS_REG_BIAS 0
+
 /* Access to data in the thread descriptor is easy.  */
 #define THREAD_GETMEM(descr, member) \
   descr->member