summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-07-14 16:48:14 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-07-14 16:48:14 +0000
commitaeb84d0d09322e445c37e4037207311fa7c7941d (patch)
treef877c83a36757b0fe9a7b19ae2466bafbe413743 /include
parenta1aefa45eb1fc75eaee170b69482223f5a408d1d (diff)
Fix TIB/TCB on powerpc64. Some bright sould decided that the TCB should
be 8 bytes in the 64-bit ABI just like in the 32-bit ABI. But that means there is no "spare" word in the TCB that we can use to store a pointer to our struct pthread. So we have to treat powerpc64 special. Also recognize that the thread pointer points 0x7000 bytes after the TCB. Since the TCB is 8 bytes this means that TCB_OFFSET should be 0x7008. Pointed out by guenther@; ok deraadt@
Diffstat (limited to 'include')
-rw-r--r--include/tib.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/tib.h b/include/tib.h
index 8d9216f19dc..d901b54aa23 100644
--- a/include/tib.h
+++ b/include/tib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tib.h,v 1.7 2019/05/10 13:29:21 guenther Exp $ */
+/* $OpenBSD: tib.h,v 1.8 2020/07/14 16:48:13 kettenis Exp $ */
/*
* Copyright (c) 2011,2014 Philip Guenther <guenther@openbsd.org>
*
@@ -143,8 +143,13 @@ struct tib {
int tib_canceled;
int tib_errno;
void *tib_locale;
+#ifdef __powerpc64__
+ void *tib_thread;
+ void *tib_dtv; /* internal to the runtime linker */
+#else
void *tib_dtv; /* internal to the runtime linker */
void *tib_thread;
+#endif
};