[RFC,v2,05/27] Add Infinity THREAD_SELF macros to sysdeps/hppa/nptl/tls.h

Message ID 1465814311-31470-6-git-send-email-gbenson@redhat.com
State New, archived
Headers

Commit Message

Gary Benson June 13, 2016, 10:38 a.m. UTC
  This commit adds Infinity THREAD_SELF macros for hppa.
---
 sysdeps/hppa/nptl/tls.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
  

Patch

diff --git a/sysdeps/hppa/nptl/tls.h b/sysdeps/hppa/nptl/tls.h
index 2e0c861..2ed0ef1 100644
--- a/sysdeps/hppa/nptl/tls.h
+++ b/sysdeps/hppa/nptl/tls.h
@@ -111,11 +111,16 @@  typedef struct
 	__self - 1;				\
    })
 
-/* Magic for libthread_db to know how to do THREAD_SELF.
+/* Magic for Infinity to know how to do THREAD_SELF.
    Our thread pointer is stored in cr27.  See asm/elf.h for the offset into
    elf_gregset_t.  The thread descriptor is sizeof (struct pthread) away.  */
+# define I8_THREAD_SELF I8_TS_REGISTER
+# define I8_TS_REG_OFFSET 53 * 4
+# define I8_TS_REG_BIAS -sizeof (struct pthread)
+
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
 # define DB_THREAD_SELF \
-  REGISTER (32, 32, 53 * 4, -sizeof (struct pthread))
+  REGISTER (32, 32, I8_TS_REG_OFFSET, I8_TS_REG_BIAS)
 
 /* Access to data in the thread descriptor is easy.  */
 # define THREAD_GETMEM(descr, member) \