This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][PATCH 13/22] Add Infinity THREAD_SELF macros to sysdeps/s390/nptl/tls.h
- From: Gary Benson <gbenson at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 20 Oct 2015 15:56:06 +0100
- Subject: [RFC][PATCH 13/22] Add Infinity THREAD_SELF macros to sysdeps/s390/nptl/tls.h
- Authentication-results: sourceware.org; auth=none
- References: <1445352975-17844-1-git-send-email-gbenson at redhat dot com>
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