about summary refs log tree commit diff
path: root/nptl/sysdeps/sh
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-20 15:28:51 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-20 15:28:51 +0000
commitd9038ff837089bcef3623b362cbe8ea5e96b2d87 (patch)
treeed44d5c34146eb88152bc4fb92731f2d09198f06 /nptl/sysdeps/sh
parent35259015841308f7db2bc05a5664fcaab506e6ff (diff)
downloadglibc-d9038ff837089bcef3623b362cbe8ea5e96b2d87.tar.gz
glibc-d9038ff837089bcef3623b362cbe8ea5e96b2d87.tar.xz
glibc-d9038ff837089bcef3623b362cbe8ea5e96b2d87.zip
* sysdeps/unix/sysv/linux/sh/sysdep.h: Include tls.h.
	(PTR_MANGLE, PTR_DEMANGLE): Define.
	(SYSCALL_ERROR_HANDLER): Fix typo.
	* sysdeps/sh/sh4/__longjmp.S: Use PTR_DEMANGLE if defined.
	* sysdeps/sh/sh3/__longjmp.S: Likewise.
	* sysdeps/sh/sh4/setjmp.S: Use PTR_MANGLE if defined.
	* sysdeps/sh/sh3/setjmp.S: Likewise.
Diffstat (limited to 'nptl/sysdeps/sh')
-rw-r--r--nptl/sysdeps/sh/tcb-offsets.sym1
-rw-r--r--nptl/sysdeps/sh/tls.h15
2 files changed, 15 insertions, 1 deletions
diff --git a/nptl/sysdeps/sh/tcb-offsets.sym b/nptl/sysdeps/sh/tcb-offsets.sym
index 539789a817..4ad866335b 100644
--- a/nptl/sysdeps/sh/tcb-offsets.sym
+++ b/nptl/sysdeps/sh/tcb-offsets.sym
@@ -9,3 +9,4 @@ CLEANUP_JMP_BUF		offsetof (struct pthread, cleanup_jmp_buf)
 MULTIPLE_THREADS_OFFSET	offsetof (struct pthread, header.multiple_threads)
 TLS_PRE_TCB_SIZE	sizeof (struct pthread)
 MUTEX_FUTEX		offsetof (pthread_mutex_t, __data.__lock)
+POINTER_GUARD		offsetof (tcbhead_t, pointer_guard)
diff --git a/nptl/sysdeps/sh/tls.h b/nptl/sysdeps/sh/tls.h
index e883bae993..49d105518a 100644
--- a/nptl/sysdeps/sh/tls.h
+++ b/nptl/sysdeps/sh/tls.h
@@ -41,7 +41,7 @@ typedef union dtv
 typedef struct
 {
   dtv_t *dtv;
-  void *private;
+  uintptr_t pointer_guard;
 } tcbhead_t;
 
 # define TLS_MULTIPLE_THREADS_IN_TCB 1
@@ -140,6 +140,19 @@ typedef struct
 # define THREAD_SETMEM_NC(descr, member, idx, value) \
     descr->member[idx] = (value)
 
+#define THREAD_GET_POINTER_GUARD() \
+  ({ tcbhead_t *__tcbp;							      \
+     __asm __volatile ("stc gbr,%0" : "=r" (__tcbp));			      \
+     __tcbp->pointer_guard;})
+ #define THREAD_SET_POINTER_GUARD(value) \
+  ({ tcbhead_t *__tcbp;							      \
+     __asm __volatile ("stc gbr,%0" : "=r" (__tcbp));			      \
+     __tcbp->pointer_guard = (value);})
+#define THREAD_COPY_POINTER_GUARD(descr) \
+  ({ tcbhead_t *__tcbp;							      \
+     __asm __volatile ("stc gbr,%0" : "=r" (__tcbp));			      \
+     ((tcbhead_t *) (descr + 1))->pointer_guard	= __tcbp->pointer_guard;})
+
 #endif /* __ASSEMBLER__ */
 
 #endif	/* tls.h */