sched/clock: Make g_system_ticks a static variable

Make g_system_ticks a static variable, as it is only accessed by
    clock_get_sched_ticks().

    This change improves code modularity and enhances safety, since
    clock_get_sched_ticks() performs proper synchronization when
    reading g_system_ticks.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
wangchengdong
2025-11-13 18:40:16 -03:00
committed by Alan C. Assis
parent 1b58dd92d8
commit 1b58a449c5
4 changed files with 6 additions and 22 deletions
-12
View File
@@ -324,18 +324,6 @@ extern "C"
#define EXTERN extern
#endif
/* Access to raw system clock ***********************************************/
/* Direct access to the system timer/counter is supported only if (1) the
* system timer counter is available (i.e., we are not configured to use
* a hardware periodic timer), and (2) the execution environment has direct
* access to kernel global data
*/
#ifdef __HAVE_KERNEL_GLOBALS
EXTERN volatile clock_t g_system_ticks;
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/