mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
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:
committed by
Xiang Xiao
parent
913aa99f05
commit
800d39cdbf
@@ -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.
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user