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 <wangchengdong@lixiang.com>
This commit is contained in:
wangchengdong
2026-02-08 15:35:08 +08:00
committed by Xiang Xiao
parent 913aa99f05
commit 800d39cdbf
3 changed files with 19 additions and 0 deletions
+3
View File
@@ -97,6 +97,7 @@ if CAPTURE
config CAPTURE_NOTIFY config CAPTURE_NOTIFY
bool "Capture Notification Support" bool "Capture Notification Support"
default n default n
depends on !DISABLE_ALL_SIGNALS
---help--- ---help---
Some hardware will support notification when a capture event Some hardware will support notification when a capture event
occurs. If the hardware will support notification, then this occurs. If the hardware will support notification, then this
@@ -239,6 +240,7 @@ endif # !RTC_DATETIME
config RTC_ALARM config RTC_ALARM
bool "RTC Alarm Support" bool "RTC Alarm Support"
default n default n
depends on !DISABLE_ALL_SIGNALS
---help--- ---help---
Enable if the RTC hardware supports setting of an alarm. A callback Enable if the RTC hardware supports setting of an alarm. A callback
function will be executed when the alarm goes off. function will be executed when the alarm goes off.
@@ -269,6 +271,7 @@ config RTC_ARCH
config RTC_PERIODIC config RTC_PERIODIC
bool "RTC Periodic Interrupts" bool "RTC Periodic Interrupts"
default n default n
depends on !DISABLE_ALL_SIGNALS
---help--- ---help---
Add interrupt controls for RTCs that support periodic interrupts. Add interrupt controls for RTCs that support periodic interrupts.
+10
View File
@@ -54,9 +54,11 @@ struct oneshot_dev_s
/* Oneshot timer expiration notification information */ /* Oneshot timer expiration notification information */
#ifndef CONFIG_DISABLE_ALL_SIGNALS
struct sigevent od_event; /* Signal info */ struct sigevent od_event; /* Signal info */
struct sigwork_s od_work; /* Signal work */ struct sigwork_s od_work; /* Signal work */
pid_t od_pid; /* PID to be notified */ 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, static int oneshot_ioctl(FAR struct file *filep, int cmd,
unsigned long arg); unsigned long arg);
#ifndef CONFIG_DISABLE_ALL_SIGNALS
static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg); FAR void *arg);
#endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -95,6 +99,7 @@ static const struct file_operations g_oneshot_ops =
* Name: oneshot_callback * Name: oneshot_callback
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_DISABLE_ALL_SIGNALS
static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg) 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, nxsig_notification(priv->od_pid, &priv->od_event, SI_QUEUE,
&priv->od_work); &priv->od_work);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: oneshot_read * 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 * Argument: A reference to struct oneshot_start_s
*/ */
#ifndef CONFIG_DISABLE_ALL_SIGNALS
case OSIOC_START: case OSIOC_START:
{ {
FAR struct oneshot_start_s *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); nxsig_cancel_notification(&priv->od_work);
} }
break; break;
#endif
/* OSIOC_CURRENT - Get the current time /* OSIOC_CURRENT - Get the current time
* Argument: A reference to a struct timespec in * Argument: A reference to a struct timespec in
@@ -311,8 +319,10 @@ int oneshot_register(FAR const char *devname,
priv->od_lower = lower; priv->od_lower = lower;
#ifndef CONFIG_DISABLE_ALL_SIGNALS
lower->callback = oneshot_callback; lower->callback = oneshot_callback;
lower->arg = priv; lower->arg = priv;
#endif
nxmutex_init(&priv->od_lock); nxmutex_init(&priv->od_lock);
+6
View File
@@ -61,8 +61,10 @@ struct timer_upperhalf_s
/* The contained signal info */ /* The contained signal info */
#ifndef CONFIG_DISABLE_ALL_SIGNALS
struct timer_notify_s notify; struct timer_notify_s notify;
struct sigwork_s work; struct sigwork_s work;
#endif
/* The contained lower-half driver */ /* 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) 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; 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; return notify->periodic;
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: timer_open * Name: timer_open
@@ -381,6 +385,7 @@ static int timer_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* Argument: signal information * Argument: signal information
*/ */
#ifndef CONFIG_DISABLE_ALL_SIGNALS
case TCIOC_NOTIFICATION: case TCIOC_NOTIFICATION:
{ {
FAR struct timer_notify_s *notify = FAR struct timer_notify_s *notify =
@@ -398,6 +403,7 @@ static int timer_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
} }
} }
break; break;
#endif
/* cmd: TCIOC_MAXTIMEOUT /* cmd: TCIOC_MAXTIMEOUT
* Description: Get the maximum supported timeout value * Description: Get the maximum supported timeout value