This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 800d39cdbf935429e6437156b251fa1295d08df6 Author: wangchengdong <[email protected]> AuthorDate: Sun Feb 8 15:35:08 2026 +0800 drivers/timers: remove nxsig_notification when signal support is disabled When all signals are disabled, nxsig_notification is not available and should not be invoked. Remove the call to avoid build and runtime issues in no-signal configurations. Signed-off-by: Chengdong Wang <[email protected]> --- drivers/timers/Kconfig | 3 +++ drivers/timers/oneshot.c | 10 ++++++++++ drivers/timers/timer.c | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/drivers/timers/Kconfig b/drivers/timers/Kconfig index 2c796d10c50..14d3c2df34b 100644 --- a/drivers/timers/Kconfig +++ b/drivers/timers/Kconfig @@ -97,6 +97,7 @@ if CAPTURE config CAPTURE_NOTIFY bool "Capture Notification Support" default n + depends on !DISABLE_ALL_SIGNALS ---help--- Some hardware will support notification when a capture event occurs. If the hardware will support notification, then this @@ -239,6 +240,7 @@ endif # !RTC_DATETIME config RTC_ALARM bool "RTC Alarm Support" default n + depends on !DISABLE_ALL_SIGNALS ---help--- Enable if the RTC hardware supports setting of an alarm. A callback function will be executed when the alarm goes off. @@ -269,6 +271,7 @@ config RTC_ARCH config RTC_PERIODIC bool "RTC Periodic Interrupts" default n + depends on !DISABLE_ALL_SIGNALS ---help--- Add interrupt controls for RTCs that support periodic interrupts. diff --git a/drivers/timers/oneshot.c b/drivers/timers/oneshot.c index 4dc15c440a6..318221c019a 100644 --- a/drivers/timers/oneshot.c +++ b/drivers/timers/oneshot.c @@ -54,9 +54,11 @@ struct oneshot_dev_s /* Oneshot timer expiration notification information */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS struct sigevent od_event; /* Signal info */ struct sigwork_s od_work; /* Signal work */ pid_t od_pid; /* PID to be notified */ +#endif }; /**************************************************************************** @@ -70,8 +72,10 @@ static ssize_t oneshot_write(FAR struct file *filep, FAR const char *buffer, static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg); +#ifndef CONFIG_DISABLE_ALL_SIGNALS static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, FAR void *arg); +#endif /**************************************************************************** * Private Data @@ -95,6 +99,7 @@ static const struct file_operations g_oneshot_ops = * Name: oneshot_callback ****************************************************************************/ +#ifndef CONFIG_DISABLE_ALL_SIGNALS static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, FAR void *arg) { @@ -107,6 +112,7 @@ static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, nxsig_notification(priv->od_pid, &priv->od_event, SI_QUEUE, &priv->od_work); } +#endif /**************************************************************************** * Name: oneshot_read @@ -193,6 +199,7 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * Argument: A reference to struct oneshot_start_s */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS case OSIOC_START: { FAR struct oneshot_start_s *start; @@ -234,6 +241,7 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg) nxsig_cancel_notification(&priv->od_work); } break; +#endif /* OSIOC_CURRENT - Get the current time * Argument: A reference to a struct timespec in @@ -311,8 +319,10 @@ int oneshot_register(FAR const char *devname, priv->od_lower = lower; +#ifndef CONFIG_DISABLE_ALL_SIGNALS lower->callback = oneshot_callback; lower->arg = priv; +#endif nxmutex_init(&priv->od_lock); diff --git a/drivers/timers/timer.c b/drivers/timers/timer.c index 10b0e1b325b..c9bb4fc11fd 100644 --- a/drivers/timers/timer.c +++ b/drivers/timers/timer.c @@ -61,8 +61,10 @@ struct timer_upperhalf_s /* The contained signal info */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS struct timer_notify_s notify; struct sigwork_s work; +#endif /* The contained lower-half driver */ @@ -116,6 +118,7 @@ static const struct file_operations g_timerops = * ****************************************************************************/ +#ifndef CONFIG_DISABLE_ALL_SIGNALS static bool timer_notifier(FAR uint32_t *next_interval_us, FAR void *arg) { FAR struct timer_upperhalf_s *upper = (FAR struct timer_upperhalf_s *)arg; @@ -131,6 +134,7 @@ static bool timer_notifier(FAR uint32_t *next_interval_us, FAR void *arg) return notify->periodic; } +#endif /**************************************************************************** * Name: timer_open @@ -381,6 +385,7 @@ static int timer_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * Argument: signal information */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS case TCIOC_NOTIFICATION: { FAR struct timer_notify_s *notify = @@ -398,6 +403,7 @@ static int timer_ioctl(FAR struct file *filep, int cmd, unsigned long arg) } } break; +#endif /* cmd: TCIOC_MAXTIMEOUT * Description: Get the maximum supported timeout value
