]> Savannah Git Hosting - gnulib.git/commitdiff
sigsegv: Improve support for Linux/LoongArch64.
authorBruno Haible <bruno@clisp.org>
Fri, 7 Jan 2022 18:11:25 +0000 (19:11 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 7 Jan 2022 18:11:25 +0000 (19:11 +0100)
* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for
Linux/LoongArch.

ChangeLog
lib/sigsegv.c

index 1208d4c6d5d13623ac1ebee2da2e7f2150a57dcb..60ca624f1d8fefd5c896b0ea254a00b0db6615c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-01-07  Bruno Haible  <bruno@clisp.org>
+
+       sigsegv: Improve support for Linux/LoongArch64.
+       * lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for
+       Linux/LoongArch.
+
 2022-01-05  Glenn Washburn  <development@efficientek.com>
 
        bootstrap: When a commit is specified, do a shallow fetch if possible.
index ef00f6139381a2d26991850160a3bfdbfa154866..da70ffa5fda154e00cdef828f8a3173e9b6f563a 100644 (file)
@@ -168,6 +168,15 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
    because $bsp and $bspstore never differ by more than ca. 1 KB.  */
 #  define SIGSEGV_FAULT_BSP_POINTER  ((ucontext_t *) ucp)->uc_mcontext.sc_ar_bsp
 
+# elif defined __loongarch__
+
+/* See <sys/ucontext.h>.
+   Note that the 'mcontext_t' defined in <sys/ucontext.h>
+   and the 'struct sigcontext' defined in <bits/sigcontext.h>
+   (see also <asm/sigcontext.h>) are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.__gregs[3]
+
 # elif defined __m68k__
 
 /* See glibc/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h