From b921da960a181e1f77cdbb3000ed4915edc5d06c Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 6 Jan 2011 10:49:04 +0000 Subject: [PATCH] - use the record scc_info to determine the cpu frequency git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@368 315a16e6-25f9-4109-90ae-ca3045a26c18 --- arch/x86/kernel/processor.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/processor.c b/arch/x86/kernel/processor.c index cdc197d1..3de3d90c 100644 --- a/arch/x86/kernel/processor.c +++ b/arch/x86/kernel/processor.c @@ -21,7 +21,9 @@ #include #include #include -//#include +#ifdef CONFIG_ROCKCREEK +#include +#endif static uint32_t cpu_freq = 0; @@ -31,10 +33,18 @@ void udelay(uint32_t usecs) __attribute__((optimize(0))); uint32_t detect_cpu_frequency(void) { +#ifdef CONFIG_ROCKCREEK + if (cpu_freq > 0) + return cpu_freq; + + cpu_freq = scc_info.tile_frequency*1000000; + + return cpu_freq; +#else uint64_t start, end, diff; uint64_t ticks, old; - if (cpu_freq > 0) + if (BUILTIN_EXPECT(cpu_freq > 0, 0)) return cpu_freq; old = get_clock_tick(); @@ -53,6 +63,7 @@ uint32_t detect_cpu_frequency(void) cpu_freq = (uint32_t) (diff / (uint64_t) 1000000); return cpu_freq; +#endif } uint32_t get_cpu_frequency(void)