path: root/arch/powerpc/pthread_arch.h
diff options
authorRich Felker <>2015-11-02 12:39:28 -0500
committerRich Felker <>2015-11-02 12:41:49 -0500
commitcb1bf2f321b45a06447133b3db00621b7300c456 (patch)
tree50518595b1f221270ec0a209b5252c85d4ba140c /arch/powerpc/pthread_arch.h
parentfead7e3fc04729b4cc8a5feec4a172b389395212 (diff)
properly access mcontext_t program counter in cancellation handler
using the actual mcontext_t definition rather than an overlaid pointer array both improves correctness/readability and eliminates some ugly hacks for archs with 64-bit registers bit 32-bit program counter. also fix UB due to comparison of pointers not in a common array object.
Diffstat (limited to 'arch/powerpc/pthread_arch.h')
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/pthread_arch.h b/arch/powerpc/pthread_arch.h
index bb7405d1..7c5c4fad 100644
--- a/arch/powerpc/pthread_arch.h
+++ b/arch/powerpc/pthread_arch.h
@@ -15,9 +15,8 @@ static inline struct pthread *__pthread_self()
#define DTP_OFFSET 0x8000
-// 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
+#define MC_PC gregs[32]
#define CANARY canary_at_end