From cafdcb1eb0abc6de6c3f1e3bb962934782370456 Mon Sep 17 00:00:00 2001 From: chao an Date: Thu, 12 Dec 2024 15:09:21 +0800 Subject: [PATCH] sched/clock: cleanup g_system_ticks reference if arch timer is enabled continue work of: https://github.com/apache/nuttx/pull/15139 Signed-off-by: chao an --- sched/clock/clock.h | 3 ++- sched/clock/clock_initialize.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sched/clock/clock.h b/sched/clock/clock.h index 507adac3476d8..8c676ec41ae4b 100644 --- a/sched/clock/clock.h +++ b/sched/clock/clock.h @@ -75,7 +75,8 @@ extern struct timespec g_basetime; int clock_basetime(FAR struct timespec *tp); void clock_initialize(void); -#ifndef CONFIG_SCHED_TICKLESS +#if !defined(CONFIG_SCHED_TICKLESS) && \ + !defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH) void clock_timer(void); #else # define clock_timer() diff --git a/sched/clock/clock_initialize.c b/sched/clock/clock_initialize.c index 079af0c10c82a..19cf8e0170c15 100644 --- a/sched/clock/clock_initialize.c +++ b/sched/clock/clock_initialize.c @@ -49,12 +49,9 @@ * Public Data ****************************************************************************/ -#ifndef CONFIG_SCHED_TICKLESS -#ifdef CONFIG_SYSTEM_TIME64 -volatile uint64_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS; -#else -volatile uint32_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS; -#endif +#if !defined(CONFIG_SCHED_TICKLESS) && \ + !defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH) +volatile clock_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS; #endif #ifndef CONFIG_CLOCK_TIMEKEEPING @@ -305,7 +302,9 @@ void clock_synchronize(FAR const struct timespec *tp) * ****************************************************************************/ -#if defined(CONFIG_RTC) && !defined(CONFIG_SCHED_TICKLESS) && !defined(CONFIG_CLOCK_TIMEKEEPING) +#if defined(CONFIG_RTC) && !defined(CONFIG_SCHED_TICKLESS) && \ + !defined(CONFIG_CLOCK_TIMEKEEPING) && !defined(CONFIG_ALARM_ARCH) && \ + !defined(CONFIG_TIMER_ARCH) void clock_resynchronize(FAR struct timespec *rtc_diff) { struct timespec rtc_time; @@ -393,7 +392,8 @@ void clock_resynchronize(FAR struct timespec *rtc_diff) * ****************************************************************************/ -#ifndef CONFIG_SCHED_TICKLESS +#if !defined(CONFIG_SCHED_TICKLESS) && \ + !defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH) void clock_timer(void) { /* Increment the per-tick system counter */