Patchwork [RFC,06/22] Add Infinity THREAD_SELF macros to sysdeps/i386/nptl/tls.h

login
register
mail settings
Submitter Gary Benson
Date Oct. 20, 2015, 2:55 p.m.
Message ID <1445352975-17844-7-git-send-email-gbenson@redhat.com>
Download mbox | patch
Permalink /patch/9263/
State New
Headers show

Comments

Gary Benson - Oct. 20, 2015, 2:55 p.m.
This commit adds Infinity THREAD_SELF macros for i386.
---
 sysdeps/i386/nptl/tls.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

Patch

diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h
index 829cd3a..8ccb2e3 100644
--- a/sysdeps/i386/nptl/tls.h
+++ b/sysdeps/i386/nptl/tls.h
@@ -259,6 +259,17 @@  tls_fill_user_desc (union user_desc_init *desc,
   REGISTER_THREAD_AREA (32, offsetof (struct user_regs_struct, xgs), 3) \
   REGISTER_THREAD_AREA (64, 26 * 8, 3) /* x86-64's user_regs_struct->gs */
 
+/* Magic for Infinity to know how to do THREAD_SELF.  */
+# define I8_THREAD_SELF I8_TS_REGISTER_THREAD_AREA
+# ifdef __LP64__
+#  define I8_TS_RTA_SIZE 64
+#  define I8_TS_RTA_OFFSET 26 * 8 /* x86-64's user_regs_struct->gs */
+# else
+#  define I8_TS_RTA_SIZE 32
+#  define I8_TS_RTA_OFFSET offsetof (struct user_regs_struct, xgs)
+# endif
+# define I8_TS_RTA_SCALE 3
+
 
 /* Read member of the thread descriptor directly.  */
 # define THREAD_GETMEM(descr, member) \