about summary refs log tree commit diff
path: root/arch/powerpc/pthread_arch.h
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2012-11-09 23:36:55 +0100
committerrofl0r <retnyg@gmx.net>2012-11-13 19:12:25 +0100
commit1c8eb8bad791fe9d01d0d4ab77882db634fa933d (patch)
treed3faf83663c1383f7ea16a0e6c68b3e2f4cc968a /arch/powerpc/pthread_arch.h
parent7669d1e334e6b96455eece78da43bf830b93d697 (diff)
downloadmusl-1c8eb8bad791fe9d01d0d4ab77882db634fa933d.tar.gz
musl-1c8eb8bad791fe9d01d0d4ab77882db634fa933d.tar.xz
musl-1c8eb8bad791fe9d01d0d4ab77882db634fa933d.zip
PPC port cleaned up, static linking works well now.
Diffstat (limited to 'arch/powerpc/pthread_arch.h')
-rw-r--r--arch/powerpc/pthread_arch.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h
new file mode 100644
index 00000000..cb2a70b8
--- /dev/null
+++ b/arch/powerpc/pthread_arch.h
@@ -0,0 +1,14 @@
+static inline struct pthread *__pthread_self()
+{
+	register char* tp __asm__("r2");
+	return (pthread_t)(tp - 0x7000 - sizeof(struct pthread));
+}
+                        
+#define TLS_ABOVE_TP
+#define TP_ADJ(p) ((char *)(p) + sizeof(struct pthread) + 0x7000)
+
+// offset of the PC register in mcontext_t, divided by the system wordsize
+// the kernel calls the ip "nip", it's the first saved value after the 32
+// GPRs.
+#define CANCEL_REG_IP 32
+