You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/01/27 16:21:58 UTC

[nuttx] 01/03: sched: Add SIGFPE, SIGILL and SIGSEGV definition

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 739be677447f67970c3e16bcf6952bbf0b94865d
Author: yintao <yi...@xiaomi.com>
AuthorDate: Thu Aug 11 13:25:52 2022 +0800

    sched: Add SIGFPE, SIGILL and SIGSEGV definition
    
    Signed-off-by: yintao <yi...@xiaomi.com>
---
 include/signal.h | 22 ++++++++++++++++++++--
 sched/Kconfig    | 28 ++++++++++++++++++++++++++--
 2 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/include/signal.h b/include/signal.h
index fa053b29d7..ed70c4f177 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -222,11 +222,29 @@
 #  define SIGTTIN       CONFIG_SIG_TTIN
 #endif
 
+#ifndef CONFIG_SIG_FPE
+#  define SIGFPE        16
+#else
+#  define SIGFPE       CONFIG_SIG_FPE
+#endif
+
+#ifndef CONFIG_SIG_ILL
+#  define SIGILL        17
+#else
+#  define SIGILL       CONFIG_SIG_ILL
+#endif
+
+#ifndef CONFIG_SIG_SEGV
+#  define SIGSEGV       18
+#else
+#  define SIGSEGV       CONFIG_SIG_SEGV
+#endif
+
 /* The following are non-standard signal definitions */
 
 #ifndef CONFIG_DISABLE_PTHREAD
 #  ifndef CONFIG_SIG_SIGCONDTIMEDOUT
-#    define SIGCONDTIMEDOUT 16  /* Used in the implementation of pthread_cond_timedwait */
+#    define SIGCONDTIMEDOUT 19  /* Used in the implementation of pthread_cond_timedwait */
 #  else
 #    define SIGCONDTIMEDOUT CONFIG_SIG_SIGCONDTIMEDOUT
 #  endif
@@ -236,7 +254,7 @@
 
 #if defined(CONFIG_SCHED_WORKQUEUE) || defined(CONFIG_PAGING)
 #  ifndef CONFIG_SIG_SIGWORK
-#    define SIGWORK     17  /* Used to wake up the work queue */
+#    define SIGWORK     20  /* Used to wake up the work queue */
 #  else
 #    define SIGWORK     CONFIG_SIG_SIGWORK
 #  endif
diff --git a/sched/Kconfig b/sched/Kconfig
index 17b2034e9a..28957426bb 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -1403,11 +1403,35 @@ config SIG_TTIN
 		information about how this interacts with the terminal driver, see Access
 		to the Controlling Terminal.
 
+config SIG_FPE
+	int "SIGFPE"
+	default 16
+	---help---
+		The SIGFPE is issued when fatal arithmetic operation errors occur.
+		It includes not only floating-point operation errors, but also all other
+		arithmetic errors such as overflow and divisor zero.
+
+config SIG_ILL
+	int "SIGILL"
+	default 17
+	---help---
+		The SIGILL executed an illegal instruction. It is usually because of an
+		error in the executable file itself or an attempt to execute a data segment.
+		This signal may also be generated when the stack overflows.
+
+config SIG_SEGA
+	int "SIGSEGA"
+	default 18
+	---help---
+		The SIGSEGA is sent when an attempt is made to access memory that is
+		not allocated to itself, or to write data to a memory address that does
+		not have write permission, or to illegally use the memory address signal.
+
 comment "Non-standard Signal Numbers"
 
 config SIG_SIGCONDTIMEDOUT
 	int "SIGCONDTIMEDOUT"
-	default 16
+	default 19
 	depends on !DISABLE_PTHREAD
 	---help---
 		This non-standard signal number is used the implementation of
@@ -1415,7 +1439,7 @@ config SIG_SIGCONDTIMEDOUT
 
 config SIG_SIGWORK
 	int "SIGWORK"
-	default 17
+	default 20
 	depends on SCHED_WORKQUEUE || LIBC_USRWORK
 	---help---
 		SIGWORK is a non-standard signal used to wake up various internal