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

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


The following commit(s) were added to refs/heads/master by this push:
     new 97726d9747 arch/x86_64/intel64/intel64_rtc.c: fix compilation
97726d9747 is described below

commit 97726d974744e5485daef763aece683aeb102499
Author: p-szafonimateusz <p-szafonimate...@xiaomi.com>
AuthorDate: Tue May 14 10:31:26 2024 +0200

    arch/x86_64/intel64/intel64_rtc.c: fix compilation
    
    fix missing reference to comm_region->tsc_khz and
    fix 'defined but not used' warnings in arch/x86_64/intel64_rtc.c
    
    Signed-off-by: p-szafonimateusz <p-szafonimate...@xiaomi.com>
---
 arch/x86_64/src/intel64/intel64_freq.c         | 2 +-
 arch/x86_64/src/intel64/intel64_rtc.c          | 7 ++-----
 arch/x86_64/src/intel64/intel64_tsc_tickless.c | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/x86_64/src/intel64/intel64_freq.c 
b/arch/x86_64/src/intel64/intel64_freq.c
index e63b526e73..fa389ecd3f 100644
--- a/arch/x86_64/src/intel64/intel64_freq.c
+++ b/arch/x86_64/src/intel64/intel64_freq.c
@@ -38,7 +38,7 @@
  * Public Data
  ****************************************************************************/
 
-extern unsigned long g_x86_64_timer_freq;
+unsigned long g_x86_64_timer_freq;
 
 /****************************************************************************
  * Public Functions
diff --git a/arch/x86_64/src/intel64/intel64_rtc.c 
b/arch/x86_64/src/intel64/intel64_rtc.c
index 11dc83a8a6..1dc3ce5f34 100644
--- a/arch/x86_64/src/intel64/intel64_rtc.c
+++ b/arch/x86_64/src/intel64/intel64_rtc.c
@@ -73,10 +73,8 @@ volatile bool g_rtc_enabled = false;
  * Private Functions
  ****************************************************************************/
 
-static unsigned long rtc_freq;
-static unsigned long rtc_overflow;
+extern unsigned long g_x86_64_timer_freq;
 static unsigned long rtc_last;
-static unsigned long rtc_overflows;
 
 /****************************************************************************
  * Private Functions
@@ -92,7 +90,7 @@ static unsigned long rtc_read(void)
     }
 
   rtc_last = tmr;
-  tmr = (tmr / (rtc_freq / 1000000ul)) * 1000l;
+  tmr = (tmr / (g_x86_64_timer_freq / 1000000ul)) * 1000l;
   return tmr;
 }
 
@@ -117,7 +115,6 @@ static unsigned long rtc_read(void)
 
 int up_rtc_initialize(void)
 {
-  rtc_freq = comm_region->tsc_khz * 1000L;
   g_rtc_enabled = true;
 
   return OK;
diff --git a/arch/x86_64/src/intel64/intel64_tsc_tickless.c 
b/arch/x86_64/src/intel64/intel64_tsc_tickless.c
index 13c643d187..1ca12523eb 100644
--- a/arch/x86_64/src/intel64/intel64_tsc_tickless.c
+++ b/arch/x86_64/src/intel64/intel64_tsc_tickless.c
@@ -74,7 +74,7 @@
  * Private Data
  ****************************************************************************/
 
-unsigned long g_x86_64_timer_freq;
+extern unsigned long g_x86_64_timer_freq;
 
 static struct timespec g_goal_time_ts;
 static uint64_t g_last_stop_time;

Reply via email to