This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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(-)

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
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]