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

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

Comments

Gary Benson - Oct. 20, 2015, 2:56 p.m.
This commit adds Infinity THREAD_SELF macros for nios2.

It's possible for this platform to put the Infinity macros before
libthread_db's DB_THREAD_SELF, and define DB_THREAD_SELF in terms
of the Infinity values, but I wasn't sure if it would be appropriate.
---
 sysdeps/nios2/nptl/tls.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/sysdeps/nios2/nptl/tls.h b/sysdeps/nios2/nptl/tls.h
index 465a4b9..4c4252e 100644
--- a/sysdeps/nios2/nptl/tls.h
+++ b/sysdeps/nios2/nptl/tls.h
@@ -122,6 +122,12 @@  register struct pthread *__thread_self __asm__("r23");
 # define DB_THREAD_SELF \
   REGISTER (32, 32, 23 * 4, -TLS_PRE_TCB_SIZE - TLS_TCB_OFFSET)
 
+/* Magic for Infinity to know how to do THREAD_SELF.  */
+# define I8_THREAD_SELF I8_TS_REGISTER
+# define I8_TS_REG_SIZE 32
+# define I8_TS_REG_OFFSET 23 * 4
+# define I8_TS_REG_BIAS -TLS_PRE_TCB_SIZE - TLS_TCB_OFFSET
+
 /* Access to data in the thread descriptor is easy.  */
 # define THREAD_GETMEM(descr, member) \
   descr->member