diff --git a/doc/services/portability/posix/kconfig/index.rst b/doc/services/portability/posix/kconfig/index.rst index 059c0c1affe..9263ba0bd6b 100644 --- a/doc/services/portability/posix/kconfig/index.rst +++ b/doc/services/portability/posix/kconfig/index.rst @@ -27,7 +27,6 @@ implementation of the POSIX API. * :kconfig:option:`CONFIG_POSIX_API` * :kconfig:option:`CONFIG_POSIX_CLOCK` * :kconfig:option:`CONFIG_POSIX_FS` -* :kconfig:option:`CONFIG_POSIX_LIMITS_RTSIG_MAX` * :kconfig:option:`CONFIG_POSIX_MAX_FDS` * :kconfig:option:`CONFIG_POSIX_MAX_OPEN_FILES` * :kconfig:option:`CONFIG_POSIX_MQUEUE` diff --git a/lib/posix/options/Kconfig.deprecated b/lib/posix/options/Kconfig.deprecated index 92d3967d38c..126d14f5aae 100644 --- a/lib/posix/options/Kconfig.deprecated +++ b/lib/posix/options/Kconfig.deprecated @@ -5,4 +5,14 @@ # This file should be removed after Zephyr 4.0 is released menu "Deprecated POSIX options" + +config POSIX_LIMITS_RTSIG_MAX + int "_POSIX_RTSIG_MAX value in limits.h [DEPRECATED]" + default POSIX_RTSIG_MAX if POSIX_REALTIME_SIGNALS + default 0 + help + This option is deprecated. + + Please use CONFIG_POSIX_RTSIG_MAX instead. + endmenu diff --git a/lib/posix/options/Kconfig.signal b/lib/posix/options/Kconfig.signal index 99c225564c7..a25ac268d8a 100644 --- a/lib/posix/options/Kconfig.signal +++ b/lib/posix/options/Kconfig.signal @@ -4,15 +4,23 @@ menu "Signal support" -# needed outside of if clause above to define constants & types in signal.h +config POSIX_REALTIME_SIGNALS + bool "POSIX realtime signals" + default y if POSIX_API + help + Enable support for POSIX realtime signals. + +if POSIX_REALTIME_SIGNALS + config POSIX_RTSIG_MAX int "Maximum number of realtime signals" - default 31 if POSIX_SIGNAL - default 0 + default 8 help Define the maximum number of realtime signals (RTSIG_MAX). The range of realtime signals is [SIGRTMIN .. (SIGRTMIN+RTSIG_MAX)] +endif # POSIX_REALTIME_SIGNALS + config POSIX_SIGNAL bool "Support for POSIX signal APIs" default y if POSIX_API @@ -28,13 +36,6 @@ config POSIX_SIGNAL_STRING_DESC Use full description for the strsignal API. Will use 256 bytes of ROM. -config POSIX_LIMITS_RTSIG_MAX - int "_POSIX_RTSIG_MAX value in limits.h" - default 8 - help - Define the _POSIX_RTSIG_MAX value in limits.h. - IEEE 1003.1 defines this to be 8. - endif endmenu # "Signal support" diff --git a/lib/posix/options/signal.c b/lib/posix/options/signal.c index f14ef7fe614..362742063fc 100644 --- a/lib/posix/options/signal.c +++ b/lib/posix/options/signal.c @@ -13,8 +13,7 @@ #define SIGNO_WORD_IDX(_signo) (signo / BITS_PER_LONG) #define SIGNO_WORD_BIT(_signo) (signo & BIT_MASK(LOG2(BITS_PER_LONG))) -BUILD_ASSERT(CONFIG_POSIX_LIMITS_RTSIG_MAX >= 0); -BUILD_ASSERT(CONFIG_POSIX_RTSIG_MAX >= CONFIG_POSIX_LIMITS_RTSIG_MAX); +BUILD_ASSERT(CONFIG_POSIX_RTSIG_MAX >= 0); static inline bool signo_valid(int signo) {