You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/03/23 19:56:23 UTC

[nuttx] branch master updated: Correct Real Time signal definitions.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 104a7d4e00 Correct Real Time signal definitions.
104a7d4e00 is described below

commit 104a7d4e00a99ccb3dfc1ea6b661c5d553337525
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Thu Mar 23 08:30:08 2023 -0600

    Correct Real Time signal definitions.
    
    There are number problems with the implementation of realtime signals in NuttX as discussed in Issue #8869.  A first step to correcting any of these is to correct the definitions of SIGRTMIN, SIGRTMAX, and RTSIG_SIX.
    
    SIGRTMIN is the first real-time signals.  Real-time signal numbers must not overlap the standard signal numbers.  Before this fix, it was set equal to the first standard signal.  Real-time signals differ from standard signals in that (1) they have no default actions, and (2) real time signal actions are prioritized whereas standard signal actions are processed FIFO.
    
    SIGRTMAX is the last real-time signal.
    
    RTSIG_MAX must be set equal to maximum number of realtime signals reserved for application use
    
    The change corrects the definitons but has not impact at all becasuse none of there definitions are currently used in the OS.  But they will be when prioritized real time signal handling is implemented.
---
 include/limits.h | 4 ++--
 include/signal.h | 9 +++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/limits.h b/include/limits.h
index b4502fa8bd..e5ae7a379c 100644
--- a/include/limits.h
+++ b/include/limits.h
@@ -82,7 +82,7 @@
  *
  * Required for sigqueue
  *
- *   _POSIX_RTSIG_MAX      Difference between SIGRTMIN and SIGRTMAX
+ *   _POSIX_RTSIG_MAX      Number of realtime signals reserved for application
  *   _POSIX_SIGQUEUE_MAX   Max number signals a task can queue
  *
  * Required for POSIX timers
@@ -146,7 +146,7 @@
 
 /* Required for sigqueue */
 
-#define _POSIX_RTSIG_MAX      31
+#define _POSIX_RTSIG_MAX      2    /*  Number of reserved realtime signals */
 #define _POSIX_SIGQUEUE_MAX   32
 
 /* Required for symbolic links */
diff --git a/include/signal.h b/include/signal.h
index 392b4cc323..109bf94efc 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -39,14 +39,15 @@
 
 #define NULL_SIGNAL_SET ((sigset_t)0x00000000)
 #define ALL_SIGNAL_SET  ((sigset_t)0xffffffff)
-#define MIN_SIGNO       1
-#define MAX_SIGNO       31
+#define MIN_SIGNO       1               /* Lowest valid signal number */
+#define MAX_SIGNO       31              /* Highest valid signal number */
 #define GOOD_SIGNO(s)   ((((unsigned)(s)) <= MAX_SIGNO))
 #define SIGNO2SET(s)    ((sigset_t)1 << (s))
 
-/* All signals are "real time" signals */
+/* Definitions for "real time" signals */
 
-#define SIGRTMIN        MIN_SIGNO       /* First real time signal */
+#define SIGSTDMAX       29              /* Last standard signal number */
+#define SIGRTMIN        (SIGSTDMAX + 1) /* First real time signal */
 #define SIGRTMAX        MAX_SIGNO       /* Last real time signal */
 #define _NSIG           (MAX_SIGNO + 1) /* Biggest signal number + 1 */