about summary refs log tree commit diff
path: root/nptl/sysdeps/powerpc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-12-20 10:50:52 +0000
committerJakub Jelinek <jakub@redhat.com>2005-12-20 10:50:52 +0000
commit7d0bcd10a7e3455697985522580267c8470cfcb9 (patch)
treee297bb71c9979eda34a12ca4f3ff1acf5194d886 /nptl/sysdeps/powerpc
parent2c6cfe6853a30deb4af842aacc924fa298d0521a (diff)
downloadglibc-7d0bcd10a7e3455697985522580267c8470cfcb9.tar.gz
glibc-7d0bcd10a7e3455697985522580267c8470cfcb9.tar.xz
glibc-7d0bcd10a7e3455697985522580267c8470cfcb9.zip
Updated to fedora-glibc-20051220T1028
Diffstat (limited to 'nptl/sysdeps/powerpc')
-rw-r--r--nptl/sysdeps/powerpc/tcb-offsets.sym1
-rw-r--r--nptl/sysdeps/powerpc/tls.h15
2 files changed, 15 insertions, 1 deletions
diff --git a/nptl/sysdeps/powerpc/tcb-offsets.sym b/nptl/sysdeps/powerpc/tcb-offsets.sym
index 3962edbd54..4a8671e802 100644
--- a/nptl/sysdeps/powerpc/tcb-offsets.sym
+++ b/nptl/sysdeps/powerpc/tcb-offsets.sym
@@ -14,3 +14,4 @@ MULTIPLE_THREADS_OFFSET		thread_offsetof (header.multiple_threads)
 #endif
 PID				thread_offsetof (pid)
 TID				thread_offsetof (tid)
+POINTER_GUARD			(offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
diff --git a/nptl/sysdeps/powerpc/tls.h b/nptl/sysdeps/powerpc/tls.h
index b2322b09bd..976a271362 100644
--- a/nptl/sysdeps/powerpc/tls.h
+++ b/nptl/sysdeps/powerpc/tls.h
@@ -66,9 +66,11 @@ typedef union dtv
 # include <nptl/descr.h>
 
 /* The stack_guard is accessed directly by GCC -fstack-protector code,
-   so it is a part of public ABI.  The dtv field is private.  */
+   so it is a part of public ABI.  The dtv and pointer_guard fields
+   are private.  */
 typedef struct
 {
+  uintptr_t pointer_guard;
   uintptr_t stack_guard;
   dtv_t *dtv;
 } tcbhead_t;
@@ -166,6 +168,17 @@ register void *__thread_register __asm__ ("r13");
      = ((tcbhead_t *) ((char *) __thread_register			      \
 		       - TLS_TCB_OFFSET))[-1].stack_guard)
 
+/* Set the stack guard field in TCB head.  */
+# define THREAD_GET_POINTER_GUARD() \
+    (((tcbhead_t *) ((char *) __thread_register				      \
+		     - TLS_TCB_OFFSET))[-1].pointer_guard)
+# define THREAD_SET_POINTER_GUARD(value) \
+    (THREAD_GET_POINTER_GUARD () = (value))
+# define THREAD_COPY_POINTER_GUARD(descr) \
+    (((tcbhead_t *) ((char *) (descr)					      \
+		     + TLS_PRE_TCB_SIZE))[-1].pointer_guard		      \
+     = THREAD_GET_POINTER_GUARD())
+
 /* l_tls_offset == 0 is perfectly valid on PPC, so we have to use some
    different value to mean unset l_tls_offset.  */
 # define NO_TLS_OFFSET		-1