From 9acb652e29faef36dbf88d9c60df29db90b5e472 Mon Sep 17 00:00:00 2001
From: Gregory Nutt Description: Input Parameters: Description: Input Parameters: Returned Value: Description: Input Parameters: Description: Input Parameters: Returned Value:nx_start()
4.7.2 OS List Management APIs
4.7.3 nxsched_process_timer()
- 4.7.4 sched_timer_expiration()
+ 4.7.4 nxsched_timer_expiration()
4.7.5 sched_alarm_expiration()
4.7.6 irq_dispatch()
@@ -2653,7 +2653,7 @@ config ARCH_SIM
sched_alarm_expiration()
. Called by the platform-specific logic when the alarm expires.
sched_timer_expiration()
. Called by the platform-specific logic when the interval time expires.
+ nxsched_timer_expiration()
. Called by the platform-specific logic when the interval time expires.
sched_timer_expiration()
will not be called unless the alarm is restarted with up_alarm_start()
. If, as a race condition, the alarm has already expired when this function is called, then time returned is the current time.
+ Cancel the alarm and return the time of cancellation of the alarm. These two steps need to be as nearly atomic as possible. nxsched_timer_expiration()
will not be called unless the alarm is restarted with up_alarm_start()
. If, as a race condition, the alarm has already expired when this function is called, then time returned is the current time.
sched_timer_expiration()
will be called when the alarm occurs (unless up_alarm_cancel
is called to stop it).
+ Start the alarm. nxsched_timer_expiration()
will be called when the alarm occurs (unless up_alarm_cancel
is called to stop it).
-
ts
: The time in the future at the alarm is expected to occur. When the alarm occurs the timer logic will call sched_timer_expiration()
.ts
: The time in the future at the alarm is expected to occur. When the alarm occurs the timer logic will call nxsched_timer_expiration()
.
@@ -2757,7 +2757,7 @@ int up_alarm_start(FAR const struct timespec *ts);
int up_timer_cancel(FAR struct timespec *ts);
sched_timer_expiration()
will not be called unless the timer is restarted with up_timer_start()
. If, as a race condition, the timer has already expired when this function is called, then that pending interrupt must be cleared so that sched_timer_expiration()
is not called spuriously and the remaining time of zero should be returned.
+ Cancel the interval timer and return the time remaining on the timer. These two steps need to be as nearly atomic as possible. nxsched_timer_expiration()
will not be called unless the timer is restarted with up_timer_start()
. If, as a race condition, the timer has already expired when this function is called, then that pending interrupt must be cleared so that nxsched_timer_expiration()
is not called spuriously and the remaining time of zero should be returned.
sched_timer_expiration()
will be called at the completion of the timeout (unless up_timer_cancel()
is called to stop the timing).
+ Start the interval timer. nxsched_timer_expiration()
will be called at the completion of the timeout (unless up_timer_cancel()
is called to stop the timing).
-
ts
: Provides the time interval until sched_timer_expiration()
is called.ts
: Provides the time interval until nxsched_timer_expiration()
is called.
@@ -3960,11 +3960,11 @@ void nxsched_process_timer(void);
CONFIG_USEC_PER_TICK
.
sched_timer_expiration()
nxsched_timer_expiration()
Function Prototype:
#include <nuttx/arch.h> -void sched_timer_expiration(void); +void nxsched_timer_expiration(void);
Description:
Description: ifCONFIG_SCHED_TICKLESS
is defined, then this function is provided by the RTOS base code and called from platform-specific code when the interval timer used to implemented the tick-less OS expires.
@@ -3987,7 +3987,7 @@ void sched_timer_expiration(void);
Function Prototype:
#include <nuttx/arch.h> -void sched_timer_expiration(void); +void nxsched_timer_expiration(void);Description:
Description: ifCONFIG_SCHED_TICKLESS
is defined, then this function is provided by the RTOS base code and called from platform-specific code when the interval timer used to implemented the tick-less OS expires. diff --git a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c index 6ffaac8f80..c029a9a0fa 100644 --- a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c +++ b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c @@ -530,7 +530,7 @@ static inline void lpc43_tl_alarm(uint32_t curr) up_timer_gettime(&ts); sched_alarm_expiration(&ts); #else - sched_timer_expiration(); + nxsched_timer_expiration(); #endif } diff --git a/arch/arm/src/lpc54xx/lpc54_tickless.c b/arch/arm/src/lpc54xx/lpc54_tickless.c index 57dd593cf8..62192dff97 100644 --- a/arch/arm/src/lpc54xx/lpc54_tickless.c +++ b/arch/arm/src/lpc54xx/lpc54_tickless.c @@ -560,7 +560,7 @@ static inline void lpc54_tl_alarm(uint64_t curr) up_timer_gettime(&ts); sched_alarm_expiration(&ts); #else - sched_timer_expiration(); + nxsched_timer_expiration(); #endif } diff --git a/arch/arm/src/sam34/sam4cm_tickless.c b/arch/arm/src/sam34/sam4cm_tickless.c index 118c41b184..1c6dca291f 100644 --- a/arch/arm/src/sam34/sam4cm_tickless.c +++ b/arch/arm/src/sam34/sam4cm_tickless.c @@ -50,7 +50,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -198,7 +198,7 @@ static struct sam_tickless_s g_tickless; static void sam_oneshot_handler(void *arg) { tmrinfo("Expired...\n"); - sched_timer_expiration(); + nxsched_timer_expiration(); } /**************************************************************************** @@ -333,7 +333,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -374,14 +374,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/arch/arm/src/sama5/sam_tickless.c b/arch/arm/src/sama5/sam_tickless.c index 30d1830787..b3b6d83de3 100644 --- a/arch/arm/src/sama5/sam_tickless.c +++ b/arch/arm/src/sama5/sam_tickless.c @@ -50,7 +50,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -210,7 +210,7 @@ static struct sam_tickless_s g_tickless; static void sam_oneshot_handler(void *arg) { tmrinfo("Expired...\n"); - sched_timer_expiration(); + nxsched_timer_expiration(); } /**************************************************************************** @@ -345,7 +345,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -386,14 +386,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/arch/arm/src/samv7/sam_tickless.c b/arch/arm/src/samv7/sam_tickless.c index d6ddd2aabf..191a778b47 100644 --- a/arch/arm/src/samv7/sam_tickless.c +++ b/arch/arm/src/samv7/sam_tickless.c @@ -50,7 +50,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -222,7 +222,7 @@ static struct sam_tickless_s g_tickless; static void sam_oneshot_handler(void *arg) { tmrinfo("Expired...\n"); - sched_timer_expiration(); + nxsched_timer_expiration(); } /**************************************************************************** @@ -331,7 +331,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -372,14 +372,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/arch/arm/src/stm32/stm32_tickless.c b/arch/arm/src/stm32/stm32_tickless.c index 4fd59b4420..8e4bdc0aae 100644 --- a/arch/arm/src/stm32/stm32_tickless.c +++ b/arch/arm/src/stm32/stm32_tickless.c @@ -52,7 +52,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -319,7 +319,7 @@ static void stm32_interval_handler(void) g_tickless.pending = false; - sched_timer_expiration(); + nxsched_timer_expiration(); } /**************************************************************************** @@ -736,7 +736,7 @@ void up_timer_getmask(FAR uint64_t *mask) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -873,14 +873,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/arch/arm/src/stm32l4/stm32l4_tickless.c b/arch/arm/src/stm32l4/stm32l4_tickless.c index 11c3caeccb..ec83a88107 100644 --- a/arch/arm/src/stm32l4/stm32l4_tickless.c +++ b/arch/arm/src/stm32l4/stm32l4_tickless.c @@ -51,7 +51,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -155,7 +155,7 @@ static struct stm32l4_tickless_s g_tickless; static void stm32l4_oneshot_handler(FAR void *arg) { tmrinfo("Expired...\n"); - sched_timer_expiration(); + nxsched_timer_expiration(); } /**************************************************************************** @@ -284,7 +284,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -323,14 +323,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/arch/sim/src/up_tickless.c b/arch/sim/src/up_tickless.c index 0a4bb64aca..f7db3a8203 100644 --- a/arch/sim/src/up_tickless.c +++ b/arch/sim/src/up_tickless.c @@ -50,7 +50,7 @@ * The RTOS will provide the following interfaces for use by the platform- * specific interval timer implementation: * - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * ****************************************************************************/ @@ -170,7 +170,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -223,14 +223,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be + * Start the interval timer. nxsched_timer_expiration() will be * called at the completion of the timeout (unless up_timer_cancel * is called to stop the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: @@ -291,7 +291,7 @@ void up_timer_update(void) /* No more seconds left... the timer has expired */ g_timer_active = false; - sched_timer_expiration(); + nxsched_timer_expiration(); } else { @@ -321,7 +321,7 @@ void up_timer_update(void) else { g_timer_active = false; - sched_timer_expiration(); + nxsched_timer_expiration(); } } } diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c index 0c42c02893..bc9d8b138e 100644 --- a/drivers/timers/arch_timer.c +++ b/drivers/timers/arch_timer.c @@ -222,7 +222,7 @@ static bool timer_callback(FAR uint32_t *next_interval_us, FAR void *arg) g_timer.timebase += *next_interval_us; next_interval = g_timer.maxtimeout; g_timer.next_interval = &next_interval; - sched_timer_expiration(); + nxsched_timer_expiration(); g_timer.next_interval = NULL; TIMER_GETSTATUS(g_timer.lower, &status); @@ -344,7 +344,7 @@ int up_timer_gettime(FAR struct timespec *ts) * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -393,14 +393,14 @@ int up_timer_cancel(FAR struct timespec *ts) * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be called at + * Start the interval timer. nxsched_timer_expiration() will be called at * the completion of the timeout (unless up_timer_cancel is called to stop * the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 2920f0aa2b..0cc0e858b3 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -1434,7 +1434,7 @@ int up_prioritize_irq(int irq, int priority); * void sched_alarm_expiration(FAR const struct timespec *ts): Called * by the platform-specific logic when the alarm expires. * #else - * void sched_timer_expiration(void): Called by the platform-specific + * void nxsched_timer_expiration(void): Called by the platform-specific * logic when the interval timer expires. * #endif * @@ -1554,7 +1554,7 @@ int up_alarm_start(FAR const struct timespec *ts); * Description: * Cancel the interval timer and return the time remaining on the timer. * These two steps need to be as nearly atomic as possible. - * sched_timer_expiration() will not be called unless the timer is + * nxsched_timer_expiration() will not be called unless the timer is * restarted with up_timer_start(). * * If, as a race condition, the timer has already expired when this @@ -1592,14 +1592,14 @@ int up_timer_cancel(FAR struct timespec *ts); * Name: up_timer_start * * Description: - * Start the interval timer. sched_timer_expiration() will be called at + * Start the interval timer. nxsched_timer_expiration() will be called at * the completion of the timeout (unless up_timer_cancel is called to stop * the timing. * * Provided by platform-specific code and called from the RTOS base code. * * Input Parameters: - * ts - Provides the time interval until sched_timer_expiration() is + * ts - Provides the time interval until nxsched_timer_expiration() is * called. * * Returned Value: @@ -2006,7 +2006,7 @@ void nxsched_process_timer(void); #endif /**************************************************************************** - * Name: sched_timer_expiration + * Name: nxsched_timer_expiration * * Description: * if CONFIG_SCHED_TICKLESS is defined, then this function is provided by @@ -2026,7 +2026,7 @@ void nxsched_process_timer(void); ****************************************************************************/ #if defined(CONFIG_SCHED_TICKLESS) && !defined(CONFIG_SCHED_TICKLESS_ALARM) -void sched_timer_expiration(void); +void nxsched_timer_expiration(void); #endif /**************************************************************************** diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index f6331aa917..4a0a13b432 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -141,7 +141,7 @@ static void nxsched_timer_start(unsigned int ticks); static struct timespec g_stop_time; #else /* This is the duration of the currently active timer or, when - * sched_timer_expiration() is called, the duration of interval timer + * nxsched_timer_expiration() is called, the duration of interval timer * that just expired. The value zero means that no timer was active. */ @@ -533,7 +533,7 @@ void sched_alarm_expiration(FAR const struct timespec *ts) #endif /**************************************************************************** - * Name: sched_timer_expiration + * Name: nxsched_timer_expiration * * Description: * if CONFIG_SCHED_TICKLESS is defined, then this function is provided by @@ -549,7 +549,7 @@ void sched_alarm_expiration(FAR const struct timespec *ts) ****************************************************************************/ #ifndef CONFIG_SCHED_TICKLESS_ALARM -void sched_timer_expiration(void) +void nxsched_timer_expiration(void) { unsigned int elapsed; unsigned int nexttime;