diff --git a/arch/x86_64/src/intel64/intel64_freq.c b/arch/x86_64/src/intel64/intel64_freq.c index e63b526e738..fa389ecd3f5 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 11dc83a8a63..1dc3ce5f343 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 13c643d1873..1ca12523eb9 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;