summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/ia64
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/ia64
parent2c6cfe6853a30deb4af842aacc924fa298d0521a (diff)
Updated to fedora-glibc-20051220T1028
Diffstat (limited to 'nptl/sysdeps/ia64')
-rw-r--r--nptl/sysdeps/ia64/tls.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/nptl/sysdeps/ia64/tls.h b/nptl/sysdeps/ia64/tls.h
index e3ad0681d6..eb773aa97d 100644
--- a/nptl/sysdeps/ia64/tls.h
+++ b/nptl/sysdeps/ia64/tls.h
@@ -81,13 +81,14 @@ register struct pthread *__thread_self __asm__("r13");
# define TLS_TCB_SIZE sizeof (tcbhead_t)
/* This is the size we need before TCB.
- If there is not any room for uintptr_t stack_guard in struct pthread's
- final padding, we need to put struct pthread 16 byte slower. */
+ If there is not any room for uintptr_t stack_guard and
+ uintptr_t pointer_guard in struct pthread's final padding,
+ we need to put struct pthread 16 byte slower. */
# define TLS_PRE_TCB_SIZE \
- (sizeof (struct pthread) \
- + (PTHREAD_STRUCT_END_PADDING < sizeof (uintptr_t) \
- ? ((sizeof (uintptr_t) + __alignof__ (struct pthread) - 1)\
- & ~(__alignof__ (struct pthread) - 1)) \
+ (sizeof (struct pthread) \
+ + (PTHREAD_STRUCT_END_PADDING < 2 * sizeof (uintptr_t) \
+ ? ((2 * sizeof (uintptr_t) + __alignof__ (struct pthread) - 1) \
+ & ~(__alignof__ (struct pthread) - 1)) \
: 0))
/* Alignment requirements for the TCB. */
@@ -156,6 +157,15 @@ register struct pthread *__thread_self __asm__("r13");
(((uintptr_t *) ((char *) (descr) + TLS_PRE_TCB_SIZE))[-1] \
= ((uintptr_t *) __thread_self)[-1])
+/* Set the pointer guard field in TCB head. */
+#define THREAD_GET_POINTER_GUARD() \
+ (((uintptr_t *) __thread_self)[-2])
+#define THREAD_SET_POINTER_GUARD(value) \
+ (((uintptr_t *) __thread_self)[-2] = (value))
+#define THREAD_COPY_POINTER_GUARD(descr) \
+ (((uintptr_t *) ((char *) (descr) + TLS_PRE_TCB_SIZE))[-2] \
+ = THREAD_GET_POINTER_GUARD ())
+
#endif /* __ASSEMBLER__ */
#endif /* tls.h */