This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit d2581d40f7cfdfa67b513a09ccee713830354ff5 Author: ouyangxiangzhen <[email protected]> AuthorDate: Fri Jul 3 11:36:54 2026 +0800 sched/hrtimer: Convert hrtimer_unmark_running to inline function Convert hrtimer_unmark_running from a macro to an inline function, moving UP_SEV() into the function body guarded by CONFIG_SMP so that the wakeup signal is encapsulated with the state clear operation. Assisted-by: mimo-v2.6-pro Signed-off-by: ouyangxiangzhen <[email protected]> --- sched/hrtimer/hrtimer.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sched/hrtimer/hrtimer.h b/sched/hrtimer/hrtimer.h index 151169fb326..79ee9a8637e 100644 --- a/sched/hrtimer/hrtimer.h +++ b/sched/hrtimer/hrtimer.h @@ -511,7 +511,35 @@ DEFINE_HRTIMER_READ(32, uint32_t) #else # define hrtimer_mark_running(timer, cpu) UNUSED(cpu) #endif -#define hrtimer_unmark_running(cpu) hrtimer_mark_running(NULL, cpu) + +/**************************************************************************** + * Name: hrtimer_unmark_running + * + * Description: + * Mark the timer as not running and signal any CPU waiting for the + * running timer to complete. + * + * Input Parameters: + * cpu - The CPU core Id. + * + * Returned Value: + * None. + * + * Assumption: + * The caller must hold the lock. + * + ****************************************************************************/ + +static inline_function +void hrtimer_unmark_running(int cpu) +{ +#ifdef CONFIG_SMP + hrtimer_mark_running(NULL, cpu); + UP_SEV(); +#else + UNUSED(cpu); +#endif +} /**************************************************************************** * Name: hrtimer_is_running @@ -741,7 +769,6 @@ static inline_function void hrtimer_process(uint64_t now) } hrtimer_unmark_running(cpu); - UP_SEV(); } /* Release the lock and give up the ownership of the hrtimer queue. */
