This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][PATCH 06/22] Add Infinity THREAD_SELF macros to sysdeps/i386/nptl/tls.h
- From: Gary Benson <gbenson at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 20 Oct 2015 15:55:59 +0100
- Subject: [RFC][PATCH 06/22] Add Infinity THREAD_SELF macros to sysdeps/i386/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 i386.
---
sysdeps/i386/nptl/tls.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
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) \
--
1.7.1