You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/01/12 08:20:48 UTC
(nuttx) branch master updated (a22e26924d6 -> 51bcec53c4f)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from a22e26924d6 cmocka/defconfig: Update defconfigs to include cmocka application
new 9f44bff3cc5 sched/sched:merge tickless and tick process together
new 15f6e399b8a nuttx/arch: merge tickless and tick process
new 813ab962f55 nuttx/drivers: merge tickless and tick process
new 51bcec53c4f nuttx/sched: rename nxsched_timer_expiration
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Documentation/ReleaseNotes/NuttX-7.29 | 2 +-
Documentation/reference/os/nuttx.rst | 2 +-
Documentation/reference/os/time_clock.rst | 16 ++++-----
arch/arm/src/imxrt/imxrt_tickless.c | 10 +++---
arch/arm/src/lpc43xx/lpc43_rit.c | 2 +-
arch/arm/src/lpc43xx/lpc43_tickless_rit.c | 2 +-
arch/arm/src/lpc54xx/lpc54_tickless.c | 2 +-
arch/arm/src/nrf52/nrf52_tickless_rtc.c | 4 +--
arch/arm/src/nrf53/nrf53_tickless_rtc.c | 4 +--
arch/arm/src/nrf91/nrf91_tickless_rtc.c | 4 +--
arch/arm/src/sam34/sam4cm_tickless.c | 10 +++---
arch/arm/src/sama5/sam_tickless.c | 10 +++---
arch/arm/src/samd5e5/sam_tickless.c | 10 +++---
arch/arm/src/samv7/sam_tickless.c | 10 +++---
arch/arm/src/stm32/stm32_tickless.c | 10 +++---
arch/arm/src/stm32f7/stm32_tickless.c | 10 +++---
arch/arm/src/stm32h7/stm32_tickless.c | 10 +++---
arch/arm/src/stm32l4/stm32l4_tickless.c | 10 +++---
arch/arm/src/stm32wb/stm32wb_tickless.c | 10 +++---
arch/arm/src/xmc4/xmc4_tickless.c | 10 +++---
arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c | 4 +--
arch/risc-v/src/common/espressif/esp_tickless.c | 8 ++---
arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c | 8 ++---
arch/risc-v/src/litex/litex_tickless.c | 8 ++---
arch/sparc/src/bm3803/bm3803_tickless.c | 10 +++---
arch/xtensa/src/esp32/esp32_tickless.c | 8 ++---
arch/xtensa/src/esp32s3/esp32s3_tickless.c | 8 ++---
drivers/timers/arch_alarm.c | 8 ++---
drivers/timers/arch_timer.c | 8 ++---
include/nuttx/arch.h | 40 ++++-----------------
sched/sched/CMakeLists.txt | 5 ++-
sched/sched/Make.defs | 4 +--
sched/sched/sched.h | 24 +++++++++++++
sched/sched/sched_processtimer.c | 41 ++++++++++++++--------
sched/sched/sched_timerexpiration.c | 6 ++--
35 files changed, 173 insertions(+), 165 deletions(-)
(nuttx) 03/04: nuttx/drivers: merge tickless and tick process
Posted by xi...@apache.org.
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 813ab962f55cdfef0df91a3f6f6cf49dfff1e7ea
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Mon Jan 12 11:31:11 2026 +0800
nuttx/drivers: merge tickless and tick process
merge nxsched_timer_expiration() into nxsched_process_timer()
to improve code efficient
Signed-off-by: Chengdong Wang <wa...@lixiang.com>
---
drivers/timers/arch_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c
index a6caacb59b3..9b0c348b6c9 100644
--- a/drivers/timers/arch_timer.c
+++ b/drivers/timers/arch_timer.c
@@ -174,7 +174,7 @@ static bool timer_callback(FAR uint32_t *next_interval, FAR void *arg)
g_timer.timebase += *next_interval;
temp_interval = g_oneshot_maxticks;
g_timer.next_interval = &temp_interval;
- nxsched_timer_expiration();
+ nxsched_process_timer();
g_timer.next_interval = NULL;
TIMER_TICK_GETSTATUS(g_timer.lower, &status);
(nuttx) 02/04: nuttx/arch: merge tickless and tick process
Posted by xi...@apache.org.
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 15f6e399b8adf680d037f2ac42fe99dc63181210
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Mon Jan 12 11:31:03 2026 +0800
nuttx/arch: merge tickless and tick process
merge nxsched_timer_expiration() into nxsched_process_timer()
to improve code efficient
Signed-off-by: Chengdong Wang <wa...@lixiang.com>
---
arch/arm/src/imxrt/imxrt_tickless.c | 10 +++++-----
arch/arm/src/lpc43xx/lpc43_rit.c | 2 +-
arch/arm/src/lpc43xx/lpc43_tickless_rit.c | 2 +-
arch/arm/src/lpc54xx/lpc54_tickless.c | 2 +-
arch/arm/src/nrf52/nrf52_tickless_rtc.c | 4 ++--
arch/arm/src/nrf53/nrf53_tickless_rtc.c | 4 ++--
arch/arm/src/nrf91/nrf91_tickless_rtc.c | 4 ++--
arch/arm/src/sam34/sam4cm_tickless.c | 10 +++++-----
arch/arm/src/sama5/sam_tickless.c | 10 +++++-----
arch/arm/src/samd5e5/sam_tickless.c | 10 +++++-----
arch/arm/src/samv7/sam_tickless.c | 10 +++++-----
arch/arm/src/stm32/stm32_tickless.c | 10 +++++-----
arch/arm/src/stm32f7/stm32_tickless.c | 10 +++++-----
arch/arm/src/stm32h7/stm32_tickless.c | 10 +++++-----
arch/arm/src/stm32l4/stm32l4_tickless.c | 10 +++++-----
arch/arm/src/stm32wb/stm32wb_tickless.c | 10 +++++-----
arch/arm/src/xmc4/xmc4_tickless.c | 10 +++++-----
arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c | 4 ++--
arch/risc-v/src/common/espressif/esp_tickless.c | 8 ++++----
arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c | 8 ++++----
arch/risc-v/src/litex/litex_tickless.c | 8 ++++----
arch/sparc/src/bm3803/bm3803_tickless.c | 10 +++++-----
arch/xtensa/src/esp32/esp32_tickless.c | 8 ++++----
arch/xtensa/src/esp32s3/esp32s3_tickless.c | 8 ++++----
24 files changed, 91 insertions(+), 91 deletions(-)
diff --git a/arch/arm/src/imxrt/imxrt_tickless.c b/arch/arm/src/imxrt/imxrt_tickless.c
index 406bd23cb08..bbcd10263d1 100644
--- a/arch/arm/src/imxrt/imxrt_tickless.c
+++ b/arch/arm/src/imxrt/imxrt_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
* NOTE
@@ -183,7 +183,7 @@ static void imxrt_interval_handler(void)
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -477,7 +477,7 @@ int up_timer_gettime(struct timespec *ts)
* Name: up_alarm_start
*
* Description:
- * Start the alarm. nxsched_timer_expiration() will be called when the
+ * Start the alarm. nxsched_process_timer() will be called when the
* alarm occurs (unless up_alaram_cancel is called to stop it).
*
* Provided by platform-specific code and called from the RTOS base code.
@@ -485,7 +485,7 @@ int up_timer_gettime(struct timespec *ts)
* Input Parameters:
* 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().
+ * nxsched_process_timer().
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -553,7 +553,7 @@ int up_alarm_start(const struct timespec *ts)
* Description:
* 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
+ * nxsched_process_timer() 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
diff --git a/arch/arm/src/lpc43xx/lpc43_rit.c b/arch/arm/src/lpc43xx/lpc43_rit.c
index 0188723a8d5..f7e788672f1 100644
--- a/arch/arm/src/lpc43xx/lpc43_rit.c
+++ b/arch/arm/src/lpc43xx/lpc43_rit.c
@@ -86,7 +86,7 @@ static int lpc43_rit_isr(int irq, void *context, void *arg)
{
/* handle expired alarm */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
leave_critical_section(flags);
diff --git a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c
index 8c08db6b8b6..5dac6789b61 100644
--- a/arch/arm/src/lpc43xx/lpc43_tickless_rit.c
+++ b/arch/arm/src/lpc43xx/lpc43_tickless_rit.c
@@ -496,7 +496,7 @@ static inline void lpc43_tl_alarm(uint32_t curr)
lpc43_tl_init_timer_vars();
lpc43_tl_set_default_compare(curr);
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/* Interrupt handler */
diff --git a/arch/arm/src/lpc54xx/lpc54_tickless.c b/arch/arm/src/lpc54xx/lpc54_tickless.c
index dedd2a00db9..2ef0d16d911 100644
--- a/arch/arm/src/lpc54xx/lpc54_tickless.c
+++ b/arch/arm/src/lpc54xx/lpc54_tickless.c
@@ -539,7 +539,7 @@ static inline void lpc54_tl_alarm(uint64_t curr)
lpc54_init_timer_vars();
lpc54_set_default_compare(curr);
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/* Interrupt handler */
diff --git a/arch/arm/src/nrf52/nrf52_tickless_rtc.c b/arch/arm/src/nrf52/nrf52_tickless_rtc.c
index 78aeb7f6888..9d05a703229 100644
--- a/arch/arm/src/nrf52/nrf52_tickless_rtc.c
+++ b/arch/arm/src/nrf52/nrf52_tickless_rtc.c
@@ -246,7 +246,7 @@ static int rtc_handler(int irq, void *context, void *arg)
/* let scheduler now of alarm firing */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
leave_critical_section(flags);
@@ -357,5 +357,5 @@ void up_timer_initialize(void)
/* kick off alarm scheduling */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
diff --git a/arch/arm/src/nrf53/nrf53_tickless_rtc.c b/arch/arm/src/nrf53/nrf53_tickless_rtc.c
index 0af41431673..8fa6e0df338 100644
--- a/arch/arm/src/nrf53/nrf53_tickless_rtc.c
+++ b/arch/arm/src/nrf53/nrf53_tickless_rtc.c
@@ -244,7 +244,7 @@ static int rtc_handler(int irq, void *context, void *arg)
/* let scheduler now of alarm firing */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
leave_critical_section(flags);
@@ -355,5 +355,5 @@ void up_timer_initialize(void)
/* kick off alarm scheduling */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
diff --git a/arch/arm/src/nrf91/nrf91_tickless_rtc.c b/arch/arm/src/nrf91/nrf91_tickless_rtc.c
index 4165c01f361..b3065a54620 100644
--- a/arch/arm/src/nrf91/nrf91_tickless_rtc.c
+++ b/arch/arm/src/nrf91/nrf91_tickless_rtc.c
@@ -240,7 +240,7 @@ static int rtc_handler(int irq, void *context, void *arg)
/* let scheduler now of alarm firing */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
leave_critical_section(flags);
@@ -351,5 +351,5 @@ void up_timer_initialize(void)
/* kick off alarm scheduling */
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
diff --git a/arch/arm/src/sam34/sam4cm_tickless.c b/arch/arm/src/sam34/sam4cm_tickless.c
index a2f2621df13..b8262b751d2 100644
--- a/arch/arm/src/sam34/sam4cm_tickless.c
+++ b/arch/arm/src/sam34/sam4cm_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -188,7 +188,7 @@ static struct sam_tickless_s g_tickless;
static void sam_oneshot_handler(void *arg)
{
tmrinfo("Expired...\n");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -323,7 +323,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -365,14 +365,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/sama5/sam_tickless.c b/arch/arm/src/sama5/sam_tickless.c
index da588817430..cf497896013 100644
--- a/arch/arm/src/sama5/sam_tickless.c
+++ b/arch/arm/src/sama5/sam_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -200,7 +200,7 @@ static struct sam_tickless_s g_tickless;
static void sam_oneshot_handler(void *arg)
{
tmrinfo("Expired...\n");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -335,7 +335,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -377,14 +377,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/samd5e5/sam_tickless.c b/arch/arm/src/samd5e5/sam_tickless.c
index bde7eb332e8..7629bdab14b 100644
--- a/arch/arm/src/samd5e5/sam_tickless.c
+++ b/arch/arm/src/samd5e5/sam_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(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");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -333,7 +333,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -375,14 +375,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/samv7/sam_tickless.c b/arch/arm/src/samv7/sam_tickless.c
index f867d0f94ae..6777cf2f8ea 100644
--- a/arch/arm/src/samv7/sam_tickless.c
+++ b/arch/arm/src/samv7/sam_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -212,7 +212,7 @@ static struct sam_tickless_s g_tickless;
static void sam_oneshot_handler(void *arg)
{
tmrinfo("Expired...\n");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -321,7 +321,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -363,14 +363,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/stm32/stm32_tickless.c b/arch/arm/src/stm32/stm32_tickless.c
index 6062912deaf..d7eb0b74999 100644
--- a/arch/arm/src/stm32/stm32_tickless.c
+++ b/arch/arm/src/stm32/stm32_tickless.c
@@ -54,7 +54,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -318,7 +318,7 @@ static void stm32_interval_handler(void)
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -746,7 +746,7 @@ void up_timer_getmask(clock_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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -883,14 +883,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/stm32f7/stm32_tickless.c b/arch/arm/src/stm32f7/stm32_tickless.c
index fcb9d1b5e3d..3e426826d27 100644
--- a/arch/arm/src/stm32f7/stm32_tickless.c
+++ b/arch/arm/src/stm32f7/stm32_tickless.c
@@ -54,7 +54,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -322,7 +322,7 @@ static void stm32_interval_handler(void)
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -787,7 +787,7 @@ void up_timer_getmask(clock_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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -926,14 +926,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/stm32h7/stm32_tickless.c b/arch/arm/src/stm32h7/stm32_tickless.c
index feb5d85c754..7e3b712f9ff 100644
--- a/arch/arm/src/stm32h7/stm32_tickless.c
+++ b/arch/arm/src/stm32h7/stm32_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -309,7 +309,7 @@ static void stm32_interval_handler(void)
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -761,7 +761,7 @@ void up_timer_getmask(clock_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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -900,14 +900,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/stm32l4/stm32l4_tickless.c b/arch/arm/src/stm32l4/stm32l4_tickless.c
index de6172ea04d..6ca4f157bb3 100644
--- a/arch/arm/src/stm32l4/stm32l4_tickless.c
+++ b/arch/arm/src/stm32l4/stm32l4_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -144,7 +144,7 @@ static struct stm32l4_tickless_s g_tickless;
static void stm32l4_oneshot_handler(void *arg)
{
tmrinfo("Expired...\n");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -273,7 +273,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -312,14 +312,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/stm32wb/stm32wb_tickless.c b/arch/arm/src/stm32wb/stm32wb_tickless.c
index fc24296d3ac..88c7a1bca59 100644
--- a/arch/arm/src/stm32wb/stm32wb_tickless.c
+++ b/arch/arm/src/stm32wb/stm32wb_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -272,7 +272,7 @@ static void stm32wb_interval_handler(void)
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -612,7 +612,7 @@ void up_timer_getmask(clock_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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -749,14 +749,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/arm/src/xmc4/xmc4_tickless.c b/arch/arm/src/xmc4/xmc4_tickless.c
index ce7e35b0a8d..85c7a951118 100644
--- a/arch/arm/src/xmc4/xmc4_tickless.c
+++ b/arch/arm/src/xmc4/xmc4_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
* NOTE
@@ -150,7 +150,7 @@ static void xmc4_interval_handler(void *arg)
putreg32(CCU4_CC4_TCCLR_TRBC_MASK, XMC4_CCU41_CC40TCCLR);
g_tickless.pending = false;
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -385,7 +385,7 @@ int up_timer_gettime(struct timespec *ts)
* Name: up_alarm_start
*
* Description:
- * Start the alarm. nxsched_timer_expiration() will be called when the
+ * Start the alarm. nxsched_process_timer() will be called when the
* alarm occurs (unless up_alaram_cancel is called to stop it).
*
* Provided by platform-specific code and called from the RTOS base code.
@@ -393,7 +393,7 @@ int up_timer_gettime(struct timespec *ts)
* Input Parameters:
* 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().
+ * nxsched_process_timer().
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -466,7 +466,7 @@ int up_timer_start(const struct timespec *ts)
* Description:
* 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
+ * nxsched_process_timer() 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
diff --git a/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c b/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
index 323bcd8e53c..0257da058b2 100644
--- a/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
+++ b/arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c
@@ -269,7 +269,7 @@ static void avrdx_check_alarm_expired(uint8_t context)
* context. Remove non-interrupt flags from the context before
* using it.
*
- * Deactivate alarm first. Call to nxsched_timer_expiration()
+ * Deactivate alarm first. Call to nxsched_process_timer()
* in turns calls up_timer_gettick(), that one calls
* up_timer_gettime() which calls this method through
* avrdx_increment_uptime(), causing a recursion loop.
@@ -283,7 +283,7 @@ static void avrdx_check_alarm_expired(uint8_t context)
*/
avrdx_deactivate_alarm();
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
else
{
diff --git a/arch/risc-v/src/common/espressif/esp_tickless.c b/arch/risc-v/src/common/espressif/esp_tickless.c
index 9d7b57224eb..f66688a19b3 100644
--- a/arch/risc-v/src/common/espressif/esp_tickless.c
+++ b/arch/risc-v/src/common/espressif/esp_tickless.c
@@ -97,7 +97,7 @@ static int esp_tickless_isr(int irq, void *context, void *arg)
systimer_ll_clear_alarm_int(systimer_hal.dev,
SYSTIMER_ALARM_OS_TICK_CORE0);
- nxsched_timer_expiration();
+ nxsched_process_timer();
return OK;
}
@@ -235,7 +235,7 @@ int IRAM_ATTR up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -325,14 +325,14 @@ int IRAM_ATTR up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c b/arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c
index 4176ccee909..d16ea6308fe 100644
--- a/arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c
+++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_tickless.c
@@ -281,7 +281,7 @@ static void IRAM_ATTR up_timer_expire(int irq, void *regs, void *arg)
{
g_timer_started = false;
setbits(SYS_TIMER_TARGET0_INT_CLR, SYS_TIMER_SYSTIMER_INT_CLR_REG);
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -343,7 +343,7 @@ int IRAM_ATTR up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -420,14 +420,14 @@ int IRAM_ATTR up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/risc-v/src/litex/litex_tickless.c b/arch/risc-v/src/litex/litex_tickless.c
index cb9efbaa212..48b6c6228f7 100644
--- a/arch/risc-v/src/litex/litex_tickless.c
+++ b/arch/risc-v/src/litex/litex_tickless.c
@@ -79,7 +79,7 @@ static int up_timer_expire(int irq, void *regs, void *arg)
{
g_timer_started = false;
putreg32(1 << LITEX_TIMER0_TIMEOUT_EV_OFFSET, LITEX_TIMER0_EV_PENDING);
- nxsched_timer_expiration();
+ nxsched_process_timer();
return OK;
}
@@ -211,7 +211,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -272,14 +272,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/sparc/src/bm3803/bm3803_tickless.c b/arch/sparc/src/bm3803/bm3803_tickless.c
index 121d506772e..b7e100bfc12 100644
--- a/arch/sparc/src/bm3803/bm3803_tickless.c
+++ b/arch/sparc/src/bm3803/bm3803_tickless.c
@@ -38,7 +38,7 @@
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_process_timer(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -144,7 +144,7 @@ static struct bm3803_tickless_s g_tickless;
static void bm3803_oneshot_handler(void *arg)
{
tmrinfo("Expired...\n");
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
/****************************************************************************
@@ -273,7 +273,7 @@ int up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -312,14 +312,14 @@ int up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/xtensa/src/esp32/esp32_tickless.c b/arch/xtensa/src/esp32/esp32_tickless.c
index c57661cf6fa..d621f7d71c3 100644
--- a/arch/xtensa/src/esp32/esp32_tickless.c
+++ b/arch/xtensa/src/esp32/esp32_tickless.c
@@ -270,7 +270,7 @@ static int up_timer_expire(int irq, void *regs, void *arg)
if (do_sched)
{
up_timer_cancel(NULL);
- nxsched_timer_expiration();
+ nxsched_process_timer();
}
}
else
@@ -340,7 +340,7 @@ int IRAM_ATTR up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -415,14 +415,14 @@ int IRAM_ATTR up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
diff --git a/arch/xtensa/src/esp32s3/esp32s3_tickless.c b/arch/xtensa/src/esp32s3/esp32s3_tickless.c
index fc5e56c7453..e8357b5eb95 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_tickless.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_tickless.c
@@ -255,7 +255,7 @@ static int IRAM_ATTR tickless_isr(int irq, void *context, void *arg)
return OK;
}
- nxsched_timer_expiration();
+ nxsched_process_timer();
return OK;
}
@@ -319,7 +319,7 @@ int IRAM_ATTR up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_process_timer() 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
@@ -397,14 +397,14 @@ int IRAM_ATTR up_timer_cancel(struct timespec *ts)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be
+ * Start the interval timer. nxsched_process_timer() 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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_process_timer() is
* called.
*
* Returned Value:
(nuttx) 04/04: nuttx/sched: rename nxsched_timer_expiration
Posted by xi...@apache.org.
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 51bcec53c4f166d9fd07b02418491355b9463e1d
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Mon Jan 12 11:42:54 2026 +0800
nuttx/sched: rename nxsched_timer_expiration
rename nxsched_timer_expiration to nxsched_tick_expiration
to align with nxsched_process_tick()
Signed-off-by: Chengdong Wang <wa...@lixiang.com>
---
Documentation/ReleaseNotes/NuttX-7.29 | 2 +-
Documentation/reference/os/nuttx.rst | 2 +-
Documentation/reference/os/time_clock.rst | 16 ++++++++--------
drivers/timers/arch_alarm.c | 6 +++---
drivers/timers/arch_timer.c | 6 +++---
include/nuttx/arch.h | 14 +++++++-------
sched/sched/sched.h | 4 ++--
sched/sched/sched_processtimer.c | 2 +-
sched/sched/sched_timerexpiration.c | 6 +++---
9 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/Documentation/ReleaseNotes/NuttX-7.29 b/Documentation/ReleaseNotes/NuttX-7.29
index e51c46dfdd6..5b6c01baf04 100644
--- a/Documentation/ReleaseNotes/NuttX-7.29
+++ b/Documentation/ReleaseNotes/NuttX-7.29
@@ -25,7 +25,7 @@ still needed). From Gregory Nutt.
- Rename all internal OS functions from task_* to nxtask_* to indicate
that they are NuttX internal functions. From Gregory Nutt.
- Rename sched_process_timer to nxsched_process_timer. Rename
-sched_timer_expiration to nxsched_timer_expiration. Rename
+sched_timer_expiration to nxsched_tick_expiration. Rename
sched_alarm_expiration to nxsched_alarm_expiration. Those are the
appropriate names for an internal sched/ function (still many named
incorrectly). From Gregory Nutt.
diff --git a/Documentation/reference/os/nuttx.rst b/Documentation/reference/os/nuttx.rst
index 5678d2d9bac..9e38497342e 100644
--- a/Documentation/reference/os/nuttx.rst
+++ b/Documentation/reference/os/nuttx.rst
@@ -22,7 +22,7 @@ OS List Management APIs
periodically -- the calling interval must be
``CONFIG_USEC_PER_TICK``.
-.. c:function:: void nxsched_timer_expiration(void)
+.. c:function:: void nxsched_tick_expiration(void)
Description: if ``CONFIG_SCHED_TICKLESS`` is defined, then this
function is provided by the RTOS base code and called from
diff --git a/Documentation/reference/os/time_clock.rst b/Documentation/reference/os/time_clock.rst
index 86d35955827..c679ea949b0 100644
--- a/Documentation/reference/os/time_clock.rst
+++ b/Documentation/reference/os/time_clock.rst
@@ -372,7 +372,7 @@ In addition to these imported interfaces, the RTOS will export the
following interfaces for use by the platform-specific interval
timer implementation:
-- ``nxsched_timer_expiration()``: called by the platform-specific logic when the interval time expires.
+- ``nxsched_tick_expiration()``: called by the platform-specific logic when the interval time expires.
.. c:function:: void archname_timer_initialize(void)
@@ -410,7 +410,7 @@ timer implementation:
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
+ ``nxsched_tick_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.
@@ -427,13 +427,13 @@ timer implementation:
.. c:function:: int up_alarm_start(FAR const struct timespec *ts)
- Start the alarm. ``nxsched_timer_expiration()`` will be called
+ Start the alarm. ``nxsched_tick_expiration()`` will be called
when the alarm occurs (unless ``up_alarm_cancel`` is called to
stop it).
:param 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()``.
+ ``nxsched_tick_expiration()``.
:return: Zero (OK) on success; a negated errno value on failure.
@@ -445,11 +445,11 @@ timer implementation:
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
+``nxsched_tick_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
+``nxsched_tick_expiration()`` is not called spuriously and the
remaining time of zero should be returned.
:param ts: Location to return the remaining time. Zero should be
@@ -463,12 +463,12 @@ disabled internally to assure non-reentrancy.
.. c:function:: int up_timer_start(FAR const struct timespec *ts)
-Start the interval timer. ``nxsched_timer_expiration()`` will be
+Start the interval timer. ``nxsched_tick_expiration()`` will be
called at the completion of the timeout (unless
``up_timer_cancel()`` is called to stop the timing).
:param ts: Provides the time interval until
- ``nxsched_timer_expiration()`` is called.
+ ``nxsched_tick_expiration()`` is called.
:return: Zero (OK) on success; a negated errno value on failure.
diff --git a/drivers/timers/arch_alarm.c b/drivers/timers/arch_alarm.c
index d7580662d68..72e6f35e5f6 100644
--- a/drivers/timers/arch_alarm.c
+++ b/drivers/timers/arch_alarm.c
@@ -301,7 +301,7 @@ int weak_function up_timer_gettime(struct timespec *ts)
* Description:
* 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
+ * nxsched_tick_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
@@ -360,14 +360,14 @@ int weak_function up_alarm_tick_cancel(FAR clock_t *ticks)
* Name: up_alarm_start
*
* Description:
- * Start the alarm. nxsched_timer_expiration() will be called when the
+ * Start the alarm. nxsched_tick_expiration() will be called when the
* alarm occurs (unless up_alaram_cancel is called to stop it).
*
* Provided by platform-specific code and called from the RTOS base code.
*
* Input Parameters:
* 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().
+ * alarm occurs the timer logic will call nxsched_tick_expiration().
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
diff --git a/drivers/timers/arch_timer.c b/drivers/timers/arch_timer.c
index 9b0c348b6c9..80129815860 100644
--- a/drivers/timers/arch_timer.c
+++ b/drivers/timers/arch_timer.c
@@ -295,7 +295,7 @@ int weak_function up_timer_gettime(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.
- * nxsched_timer_expiration() will not be called unless the timer is
+ * nxsched_tick_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
@@ -344,14 +344,14 @@ int weak_function up_timer_tick_cancel(FAR clock_t *ticks)
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be called at
+ * Start the interval timer. nxsched_tick_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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_tick_expiration() is
* called.
*
* Returned Value:
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 8adfb659308..f975ecfe395 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -1925,7 +1925,7 @@ void up_timer_initialize(void);
* The RTOS will provide the following interfaces for use by the platform-
* specific interval timer implementation:
*
- * void nxsched_timer_expiration(void): Called by the platform-specific
+ * void nxsched_tick_expiration(void): Called by the platform-specific
* logic when the interval timer expires.
*
****************************************************************************/
@@ -1973,7 +1973,7 @@ void up_timer_getmask(FAR clock_t *mask);
* Description:
* 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
+ * nxsched_tick_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
@@ -2010,7 +2010,7 @@ int up_alarm_tick_cancel(FAR clock_t *ticks);
* Name: up_alarm_start
*
* Description:
- * Start the alarm. nxsched_timer_expiration() will be called when the
+ * Start the alarm. nxsched_tick_expiration() will be called when the
* alarm occurs (unless up_alaram_cancel is called to stop it).
*
* Provided by platform-specific code and called from the RTOS base code.
@@ -2018,7 +2018,7 @@ int up_alarm_tick_cancel(FAR clock_t *ticks);
* Input Parameters:
* 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().
+ * nxsched_tick_expiration().
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
@@ -2042,7 +2042,7 @@ int up_alarm_tick_start(clock_t ticks);
* Description:
* 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
+ * nxsched_tick_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
@@ -2081,14 +2081,14 @@ int up_timer_tick_cancel(FAR clock_t *ticks);
* Name: up_timer_start
*
* Description:
- * Start the interval timer. nxsched_timer_expiration() will be called at
+ * Start the interval timer. nxsched_tick_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 nxsched_timer_expiration() is
+ * ts - Provides the time interval until nxsched_tick_expiration() is
* called.
*
* Returned Value:
diff --git a/sched/sched/sched.h b/sched/sched/sched.h
index 55704b2e439..6ad3a19a08f 100644
--- a/sched/sched/sched.h
+++ b/sched/sched/sched.h
@@ -308,7 +308,7 @@ extern volatile spinlock_t g_cpu_tasklistlock;
****************************************************************************/
/****************************************************************************
- * Name: nxsched_timer_expiration
+ * Name: nxsched_tick_expiration
*
* Description:
* If CONFIG_SCHED_TICKLESS is defined, then this function is provided by
@@ -328,7 +328,7 @@ extern volatile spinlock_t g_cpu_tasklistlock;
****************************************************************************/
#if defined(CONFIG_SCHED_TICKLESS)
-void nxsched_timer_expiration(void);
+void nxsched_tick_expiration(void);
#endif
int nxthread_create(FAR const char *name, uint8_t ttype, int priority,
diff --git a/sched/sched/sched_processtimer.c b/sched/sched/sched_processtimer.c
index 83ebadefb10..9dc7a076129 100644
--- a/sched/sched/sched_processtimer.c
+++ b/sched/sched/sched_processtimer.c
@@ -208,7 +208,7 @@ void nxsched_process_timer(void)
#ifdef CONFIG_SCHED_TICKLESS
/* Tickless scheduling */
- nxsched_timer_expiration();
+ nxsched_tick_expiration();
#else
/* Periodic tick-based scheduling */
diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c
index 1c1785e6d4b..51561dbd68b 100644
--- a/sched/sched/sched_timerexpiration.c
+++ b/sched/sched/sched_timerexpiration.c
@@ -92,7 +92,7 @@ static clock_t nxsched_timer_start(clock_t ticks, clock_t interval);
static clock_t g_timer_tick;
/* This is the duration of the currently active timer or, when
- * nxsched_timer_expiration() is called, the duration of interval timer
+ * nxsched_tick_expiration() is called, the duration of interval timer
* that just expired. The value zero means that no timer was active.
*/
@@ -373,7 +373,7 @@ static clock_t nxsched_timer_start(clock_t ticks, clock_t interval)
****************************************************************************/
/****************************************************************************
- * Name: nxsched_timer_expiration
+ * Name: nxsched_tick_expiration
*
* Description:
* if CONFIG_SCHED_TICKLESS is defined, then this function is provided by
@@ -388,7 +388,7 @@ static clock_t nxsched_timer_start(clock_t ticks, clock_t interval)
*
****************************************************************************/
-void nxsched_timer_expiration(void)
+void nxsched_tick_expiration(void)
{
irqstate_t flags;
clock_t ticks;
(nuttx) 01/04: sched/sched:merge tickless and tick process together
Posted by xi...@apache.org.
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 9f44bff3cc5ce9a89207a41443a5caba6030e193
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Sun Jan 11 22:46:18 2026 +0800
sched/sched:merge tickless and tick process together
Merge tickless and tick process into nxsched_process_timer
to improve code level efficient
Signed-off-by: Chengdong Wang <wa...@lixiang.com>
---
drivers/timers/arch_alarm.c | 2 +-
include/nuttx/arch.h | 26 -------------------------
sched/sched/CMakeLists.txt | 5 ++---
sched/sched/Make.defs | 4 +---
sched/sched/sched.h | 24 +++++++++++++++++++++++
sched/sched/sched_processtimer.c | 41 ++++++++++++++++++++++++++--------------
6 files changed, 55 insertions(+), 47 deletions(-)
diff --git a/drivers/timers/arch_alarm.c b/drivers/timers/arch_alarm.c
index 4f04e0d44b6..d7580662d68 100644
--- a/drivers/timers/arch_alarm.c
+++ b/drivers/timers/arch_alarm.c
@@ -119,7 +119,7 @@ static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg)
{
#ifdef CONFIG_SCHED_TICKLESS
- nxsched_timer_expiration();
+ nxsched_process_timer();
#else
clock_t now;
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 788b4219909..8adfb659308 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -2461,33 +2461,7 @@ void up_ndelay(unsigned long nanoseconds);
*
****************************************************************************/
-#ifndef CONFIG_SCHED_TICKLESS
void nxsched_process_timer(void);
-#endif
-
-/****************************************************************************
- * Name: nxsched_timer_expiration
- *
- * Description:
- * If CONFIG_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 implement the tick-less OS expires.
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * None
- *
- * Assumptions/Limitations:
- * Base code implementation assumes that this function is called from
- * interrupt handling logic with interrupts disabled.
- *
- ****************************************************************************/
-
-#if defined(CONFIG_SCHED_TICKLESS)
-void nxsched_timer_expiration(void);
-#endif
/****************************************************************************
* Name: nxsched_get_next_expired
diff --git a/sched/sched/CMakeLists.txt b/sched/sched/CMakeLists.txt
index 782234f846d..1f7d29875bb 100644
--- a/sched/sched/CMakeLists.txt
+++ b/sched/sched/CMakeLists.txt
@@ -48,7 +48,8 @@ set(SRCS
sched_sysinfo.c
sched_get_stateinfo.c
sched_switchcontext.c
- sched_sleep.c)
+ sched_sleep.c
+ sched_processtimer.c)
if(DEFINED CONFIG_STACKCHECK_MARGIN)
if(NOT CONFIG_STACKCHECK_MARGIN EQUAL -1)
@@ -98,8 +99,6 @@ endif()
if(CONFIG_SCHED_TICKLESS)
list(APPEND SRCS sched_timerexpiration.c)
-else()
- list(APPEND SRCS sched_processtimer.c)
endif()
if(CONFIG_SCHED_CRITMONITOR)
diff --git a/sched/sched/Make.defs b/sched/sched/Make.defs
index 71a7bc2ce6b..232408a7536 100644
--- a/sched/sched/Make.defs
+++ b/sched/sched/Make.defs
@@ -30,7 +30,7 @@ CSRCS += sched_yield.c sched_rrgetinterval.c sched_foreach.c
CSRCS += sched_lock.c sched_unlock.c sched_lockcount.c
CSRCS += sched_idletask.c sched_self.c sched_get_stackinfo.c sched_get_tls.c
CSRCS += sched_sysinfo.c sched_get_stateinfo.c sched_getcpu.c
-CSRCS += sched_switchcontext.c sched_sleep.c
+CSRCS += sched_switchcontext.c sched_sleep.c sched_processtimer.c
ifneq ($(CONFIG_STACKCHECK_MARGIN),)
ifneq ($(CONFIG_STACKCHECK_MARGIN),-1)
@@ -80,8 +80,6 @@ endif
ifeq ($(CONFIG_SCHED_TICKLESS),y)
CSRCS += sched_timerexpiration.c
-else
-CSRCS += sched_processtimer.c
endif
ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
diff --git a/sched/sched/sched.h b/sched/sched/sched.h
index 3fb922585cb..55704b2e439 100644
--- a/sched/sched/sched.h
+++ b/sched/sched/sched.h
@@ -307,6 +307,30 @@ extern volatile spinlock_t g_cpu_tasklistlock;
* Public Function Prototypes
****************************************************************************/
+/****************************************************************************
+ * Name: nxsched_timer_expiration
+ *
+ * Description:
+ * If CONFIG_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 implement the tick-less OS expires.
+ *
+ * Input Parameters:
+ * None
+ *
+ * Returned Value:
+ * None
+ *
+ * Assumptions/Limitations:
+ * Base code implementation assumes that this function is called from
+ * interrupt handling logic with interrupts disabled.
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_SCHED_TICKLESS)
+void nxsched_timer_expiration(void);
+#endif
+
int nxthread_create(FAR const char *name, uint8_t ttype, int priority,
FAR void *stack_addr, int stack_size, main_t entry,
FAR char * const argv[], FAR char * const envp[]);
diff --git a/sched/sched/sched_processtimer.c b/sched/sched/sched_processtimer.c
index 6dbf2d15509..83ebadefb10 100644
--- a/sched/sched/sched_processtimer.c
+++ b/sched/sched/sched_processtimer.c
@@ -49,6 +49,7 @@
* Private Functions
****************************************************************************/
+#ifndef CONFIG_SCHED_TICKLESS
/****************************************************************************
* Name: nxsched_cpu_scheduler
*
@@ -145,19 +146,7 @@ static inline void nxsched_process_scheduler(void)
#endif
/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * System Timer Hooks
- *
- * These are standard interfaces that are exported by the OS
- * for use by the architecture specific logic
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Name: nxsched_process_timer
+ * Name: nxsched_process_tick
*
* Description:
* This function handles system timer events.
@@ -174,7 +163,7 @@ static inline void nxsched_process_scheduler(void)
*
****************************************************************************/
-void nxsched_process_timer(void)
+static void nxsched_process_tick(void)
{
#ifdef CONFIG_CLOCK_TIMEKEEPING
/* Process wall time */
@@ -204,3 +193,27 @@ void nxsched_process_timer(void)
board_timerhook();
#endif
}
+#endif
+
+/****************************************************************************
+ * System Timer Hooks
+ *
+ * These are standard interfaces that are exported by the OS
+ * for use by the architecture specific logic
+ *
+ ****************************************************************************/
+
+void nxsched_process_timer(void)
+{
+#ifdef CONFIG_SCHED_TICKLESS
+ /* Tickless scheduling */
+
+ nxsched_timer_expiration();
+
+#else
+ /* Periodic tick-based scheduling */
+
+ nxsched_process_tick();
+
+#endif
+}