mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
sched/wdog: move g_wdtimernested to wd_start.c
This patch moved the g_wdtimernested to wd_start.c Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com> Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
50f801dfaa
commit
66871ced4d
4 changed files with 22 additions and 10 deletions
|
@ -528,9 +528,7 @@ void nxsched_alarm_tick_expiration(clock_t ticks)
|
|||
|
||||
/* Process the timer ticks and set up the next interval (or not) */
|
||||
|
||||
g_wdtimernested++;
|
||||
nexttime = nxsched_timer_process(ticks, elapsed, false);
|
||||
g_wdtimernested--;
|
||||
|
||||
nxsched_timer_start(nexttime);
|
||||
#ifdef CONFIG_SMP
|
||||
|
|
|
@ -39,10 +39,6 @@
|
|||
|
||||
struct list_node g_wdactivelist = LIST_INITIAL_VALUE(g_wdactivelist);
|
||||
|
||||
#ifdef CONFIG_SCHED_TICKLESS
|
||||
unsigned int g_wdtimernested;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
|
@ -69,6 +69,14 @@
|
|||
# define CALL_FUNC(func, arg) func(arg)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_TICKLESS
|
||||
static unsigned int g_wdtimernested;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
@ -93,6 +101,14 @@ static inline_function void wd_expiration(clock_t ticks)
|
|||
FAR struct wdog_s *wdog;
|
||||
wdentry_t func;
|
||||
|
||||
#ifdef CONFIG_SCHED_TICKLESS
|
||||
/* Increment the nested watchdog timer count to handle cases where wd_start
|
||||
* is called in the watchdog callback functions.
|
||||
*/
|
||||
|
||||
g_wdtimernested++;
|
||||
#endif
|
||||
|
||||
/* Process the watchdog at the head of the list as well as any
|
||||
* other watchdogs that became ready to run at this time
|
||||
*/
|
||||
|
@ -122,6 +138,12 @@ static inline_function void wd_expiration(clock_t ticks)
|
|||
up_setpicbase(wdog->picbase);
|
||||
CALL_FUNC(func, wdog->arg);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCHED_TICKLESS
|
||||
/* Decrement the nested watchdog timer count */
|
||||
|
||||
g_wdtimernested--;
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -63,10 +63,6 @@ extern "C"
|
|||
|
||||
extern struct list_node g_wdactivelist;
|
||||
|
||||
#ifdef CONFIG_SCHED_TICKLESS
|
||||
extern unsigned int g_wdtimernested;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
Loading…
Reference in a new issue