* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Define also on CheriBSD.
2023-11-09 Bruno Haible <bruno@clisp.org>
+ sigsegv: Improve port to CHERI.
+ * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Define also on CheriBSD.
+
sigsegv: Port to CHERI.
* lib/sigsegv.c: Treat __aarch64__ like __arm64__.
(SIGSEGV_FOR_ALL_SIGNALS): Treat SIGPROT like SIGSEGV and SIGBUS.
# define SIGSEGV_FAULT_ADDRESS sip->si_addr
# define SIGSEGV_FAULT_CONTEXT ((ucontext_t *) ucp)
-# if defined __arm64__ /* 64-bit */
+# if defined __arm64__ || defined __aarch64__ /* 64-bit */
/* See sys/arm64/include/ucontext.h. */
-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.mc_gpregs.gp_sp
+# if defined __CHERI__
+# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.mc_capregs.cap_sp
+# else
+# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.mc_gpregs.gp_sp
+# endif
# elif defined __arm__ || defined __armhf__ /* 32-bit */