You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2025/11/13 21:40:22 UTC

(nuttx) branch master updated (1b58dd92d8e -> 63f081cbf2a)

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


    from 1b58dd92d8e boards/arm/kinetis: CMake added NXP KWIKSTIK-K40 and PJRC Teensy 3.x boards
     new 1b58a449c57 sched/clock: Make g_system_ticks a static variable
     new 63f081cbf2a arm/lc823450: Use clock_systime_ticks() to access system ticks

The 2 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:
 arch/arm/src/lc823450/lc823450_timer.c |  2 +-
 include/nuttx/clock.h                  | 12 ------------
 sched/clock/clock.h                    |  8 --------
 sched/clock/clock_initialize.c         |  2 --
 sched/clock/clock_sched_ticks.c        |  6 ++++++
 5 files changed, 7 insertions(+), 23 deletions(-)


(nuttx) 02/02: arm/lc823450: Use clock_systime_ticks() to access system ticks

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 63f081cbf2a76b1e00d087ce5416c8c29dfde068
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Thu Nov 13 19:02:34 2025 +0800

    arm/lc823450: Use clock_systime_ticks() to access system ticks
    
        Use clock_get_sched_tclock_systime_ticks() to access system ticks
         in order to fix the build error and improve code safety.
    
    Signed-off-by: Chengdong Wang <wa...@lixiang.com>
---
 arch/arm/src/lc823450/lc823450_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/src/lc823450/lc823450_timer.c b/arch/arm/src/lc823450/lc823450_timer.c
index badfa915958..7b636975584 100644
--- a/arch/arm/src/lc823450/lc823450_timer.c
+++ b/arch/arm/src/lc823450/lc823450_timer.c
@@ -705,7 +705,7 @@ int up_rtc_gettime(struct timespec *tp)
 
   /* Get the elapsed time */
 
-  elapsed = NSEC_PER_TICK * (uint64_t)g_system_ticks;
+  elapsed = NSEC_PER_TICK * (uint64_t)clock_systime_ticks();
 
   /* Add the timer fraction in nanoseconds */
 


(nuttx) 01/02: sched/clock: Make g_system_ticks a static variable

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1b58a449c57ec586661887c5bde731e2571c1884
Author: wangchengdong <wa...@lixiang.com>
AuthorDate: Thu Nov 13 17:26:31 2025 +0800

    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
---
 include/nuttx/clock.h           | 12 ------------
 sched/clock/clock.h             |  8 --------
 sched/clock/clock_initialize.c  |  2 --
 sched/clock/clock_sched_ticks.c |  6 ++++++
 4 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/include/nuttx/clock.h b/include/nuttx/clock.h
index dafe1d79b3d..140f3c39f08 100644
--- a/include/nuttx/clock.h
+++ b/include/nuttx/clock.h
@@ -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
  ****************************************************************************/
diff --git a/sched/clock/clock.h b/sched/clock/clock.h
index cd9a3c9d42e..dee8d848ee7 100644
--- a/sched/clock/clock.h
+++ b/sched/clock/clock.h
@@ -61,14 +61,6 @@
  * Public Data
  ****************************************************************************/
 
-#if !defined(__HAVE_KERNEL_GLOBALS)
-  /* The system clock exists (CONFIG_SCHED_TICKLESS), but it not prototyped
-   * globally in include/nuttx/clock.h.
-   */
-
-extern volatile clock_t g_system_ticks;
-#endif
-
 #ifndef CONFIG_CLOCK_TIMEKEEPING
 extern struct timespec  g_basetime;
 extern spinlock_t g_basetime_lock;
diff --git a/sched/clock/clock_initialize.c b/sched/clock/clock_initialize.c
index 490dfccc071..36f1749d5d3 100644
--- a/sched/clock/clock_initialize.c
+++ b/sched/clock/clock_initialize.c
@@ -51,8 +51,6 @@
  * Public Data
  ****************************************************************************/
 
-volatile clock_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS;
-
 #ifndef CONFIG_CLOCK_TIMEKEEPING
 struct timespec   g_basetime;
 spinlock_t g_basetime_lock = SP_UNLOCKED;
diff --git a/sched/clock/clock_sched_ticks.c b/sched/clock/clock_sched_ticks.c
index 0635a5d4b84..9836ae50290 100644
--- a/sched/clock/clock_sched_ticks.c
+++ b/sched/clock/clock_sched_ticks.c
@@ -34,6 +34,12 @@
 
 #include "clock/clock.h"
 
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static volatile clock_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS;
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/