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.
This commit is contained in:
Gregory Nutt 2023-03-23 08:30:08 -06:00 committed by Petro Karashchenko
parent 663b4c4f34
commit 104a7d4e00
2 changed files with 7 additions and 6 deletions

View File

@ -82,7 +82,7 @@
* *
* Required for sigqueue * 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 * _POSIX_SIGQUEUE_MAX Max number signals a task can queue
* *
* Required for POSIX timers * Required for POSIX timers
@ -146,7 +146,7 @@
/* Required for sigqueue */ /* Required for sigqueue */
#define _POSIX_RTSIG_MAX 31 #define _POSIX_RTSIG_MAX 2 /* Number of reserved realtime signals */
#define _POSIX_SIGQUEUE_MAX 32 #define _POSIX_SIGQUEUE_MAX 32
/* Required for symbolic links */ /* Required for symbolic links */

View File

@ -39,14 +39,15 @@
#define NULL_SIGNAL_SET ((sigset_t)0x00000000) #define NULL_SIGNAL_SET ((sigset_t)0x00000000)
#define ALL_SIGNAL_SET ((sigset_t)0xffffffff) #define ALL_SIGNAL_SET ((sigset_t)0xffffffff)
#define MIN_SIGNO 1 #define MIN_SIGNO 1 /* Lowest valid signal number */
#define MAX_SIGNO 31 #define MAX_SIGNO 31 /* Highest valid signal number */
#define GOOD_SIGNO(s) ((((unsigned)(s)) <= MAX_SIGNO)) #define GOOD_SIGNO(s) ((((unsigned)(s)) <= MAX_SIGNO))
#define SIGNO2SET(s) ((sigset_t)1 << (s)) #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 SIGRTMAX MAX_SIGNO /* Last real time signal */
#define _NSIG (MAX_SIGNO + 1) /* Biggest signal number + 1 */ #define _NSIG (MAX_SIGNO + 1) /* Biggest signal number + 1 */