|
|
Message-ID: <20261102165837.24591-6-kaloz@kernel.org>
Date: Mon, 2 Nov 2026 17:58:32 +0100
From: Imre Kaloz <kaloz@...nel.org>
To: musl@...ts.openwall.com
Subject: [PATCH 05/10] add MC_NPC hook for cancellation on delayed-branch archs
sparc resumes a signal context at its pc/npc pair, so npc has to
follow pc to __cp_cancel.
---
src/thread/pthread_cancel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/thread/pthread_cancel.c b/src/thread/pthread_cancel.c
index 139a6fc8..479bbef3 100644
--- a/src/thread/pthread_cancel.c
+++ b/src/thread/pthread_cancel.c
@@ -63,6 +63,9 @@ static void cancel_handler(int sig, siginfo_t *si, void *ctx)
if (pc >= (uintptr_t)__cp_begin && pc < (uintptr_t)__cp_end) {
uc->uc_mcontext.MC_PC = (uintptr_t)__cp_cancel;
+#ifdef MC_NPC
+ uc->uc_mcontext.MC_NPC = (uintptr_t)__cp_cancel + 4;
+#endif
#ifdef CANCEL_GOT
uc->uc_mcontext.MC_GOT = CANCEL_GOT;
#endif
--
2.47.3
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.