This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] PowerPC thread pointer bias requires powerpc/lowlevelrobustlock.sym
- From: "Ryan S. Arnold" <rsa at us dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>, Ben Collins <ben dot collins at ubuntu dot com>, Fabio Massimo Di Nitto <fabbione at ubuntu dot com>, Jeff Bailey <jbailey at ubuntu dot com>, Paul Mackerras <paulus at samba dot org>, Steve Munroe <sjmunroe at us dot ibm dot com>
- Date: Wed, 01 Nov 2006 18:14:48 -0600
- Subject: [PATCH] PowerPC thread pointer bias requires powerpc/lowlevelrobustlock.sym
I've been sitting on this patch for way too long.
The TID implementation in the default lowlevelrobustlock.sym is wrong
for PowerPC. The thread point on PowerPC is biased by -0x7000 to extend
the size of the FAST TLS to 64KB. This patch provides a powerpc
implementation to take this into account.
Ryan S. Arnold
IBM Linux Technology Center
2006-11-01 Ryan S. Arnold <rsa@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevelrobustlock.sym: New file.
Powerpc thread pointer bias requires separate implementation of TID
for powerpc.
diff -uNr glibc-orig/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevelrobustlock.sym glibc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevelrobustlock.sym
--- glibc-orig/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevelrobustlock.sym 1969-12-31 16:00:00.000000000 -0800
+++ glibc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevelrobustlock.sym 2006-05-22 12:06:33.000000000 -0700
@@ -0,0 +1,11 @@
+#include <sysdep.h>
+#include <tls.h>
+
+--
+
+-- Abuse tls.h macros to derive offsets relative to the thread register.
+# undef __thread_register
+# define __thread_register ((void *) 0)
+# define thread_offsetof(mem) ((ptrdiff_t) THREAD_SELF + offsetof (struct pthread, mem))
+
+TID thread_offsetof (tid)