bug-libsigsegv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-libsigsegv] [PATCH] Make it work on Linux/nds32


From: Nylon Chen
Subject: [bug-libsigsegv] [PATCH] Make it work on Linux/nds32
Date: Wed, 7 Aug 2019 07:44:27 +0800

---
 configure.ac            |  3 +++
 m4/stack-direction.m4   |  1 +
 src/Makefile.am         |  1 +
 src/fault-linux-nds32.h | 29 +++++++++++++++++++++++++++++
 4 files changed, 34 insertions(+)
 create mode 100644 src/fault-linux-nds32.h

diff --git a/configure.ac b/configure.ac
index 22b8eff..9eaa719 100644
--- a/configure.ac
+++ b/configure.ac
@@ -425,6 +425,9 @@ if test -z "$CFG_FAULT" && test "$sv_cv_fault_posix" = yes; 
then
             mips*)
               CFG_FAULT=fault-linux-mips.h
               ;;
+           nds32*)
+              CFG_FAULT=fault-linux-nds32.h
+              ;;
             powerpc* | rs6000)
               CFG_FAULT=fault-linux-powerpc.h
               ;;
diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
index ffd4bce..a7df7ea 100644
--- a/m4/stack-direction.m4
+++ b/m4/stack-direction.m4
@@ -39,6 +39,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
       mn10200 | \
       mn10300 | \
       nios2 | \
+      nds32* | \
       ns32k | \
       pdp11 | \
       pj* | \
diff --git a/src/Makefile.am b/src/Makefile.am
index 9a9982f..8910be8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,6 +41,7 @@ noinst_HEADERS = \
   fault-linux-ia64.h fault-linux-ia64-old.h \
   fault-linux-m68k.h fault-linux-m68k-old.h fault-linux-m68k-old.c \
   fault-linux-mips.h fault-linux-mips-old.h \
+  fault-linux-nds32.h \
   fault-linux-powerpc.h fault-linux-powerpc-old.h \
   fault-linux-riscv64.h \
   fault-linux-s390.h fault-linux-s390-old.h \
diff --git a/src/fault-linux-nds32.h b/src/fault-linux-nds32.h
new file mode 100644
index 0000000..a728060
--- /dev/null
+++ b/src/fault-linux-nds32.h
@@ -0,0 +1,29 @@
+/* Fault handler information.  Andse NDS32 32-bit version.
+ * Copyright (C) 2018  Nylon Chen <address@hidden>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "fault-posix-ucontext.h"
+
+/* See glibc/sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
+ * and the definition of GET_STACK in
+ * glibc/sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h.
+ * Note that the 'mcontext_t' defined in
+ * glibc/sysdeps/unix/sysv/linux/arm/nds32/ucontext.h
+ * and the 'struct sigcontext' defined in <asm/sigcontext.h>
+ */
+
+#define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.nds32_sp
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]