This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v2][PATCH 06/27] 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: Mon, 13 Jun 2016 11:38:10 +0100
- Subject: [RFC v2][PATCH 06/27] Add Infinity THREAD_SELF macros to sysdeps/i386/nptl/tls.h
- Authentication-results: sourceware.org; auth=none
- References: <1465814311-31470-1-git-send-email-gbenson at redhat dot com>
This commit adds Infinity THREAD_SELF macros for i386.
---
sysdeps/i386/nptl/tls.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h
index a6dfa9b..f504ef2 100644
--- a/sysdeps/i386/nptl/tls.h
+++ b/sysdeps/i386/nptl/tls.h
@@ -259,6 +259,14 @@ 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_OFFSET 26 * 8 /* x86-64's user_regs_struct->gs */
+# else
+# 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