From 3683e9c84c8a9a47fff9e986890bdd2160ab588a Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 13 Nov 2010 13:04:57 +0000 Subject: [PATCH] - use uint32_t instead of an int to detect the processor frequency git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@254 315a16e6-25f9-4109-90ae-ca3045a26c18 --- include/metalsvm/processor.h | 4 ++-- kernel/processor.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/metalsvm/processor.h b/include/metalsvm/processor.h index f28d653e..8202d2ea 100644 --- a/include/metalsvm/processor.h +++ b/include/metalsvm/processor.h @@ -28,8 +28,8 @@ extern "C" { #endif -int detect_cpu_frequency(void); -int get_cpu_frequency(void); +uint32_t detect_cpu_frequency(void); +uint32_t get_cpu_frequency(void); void udelay(unsigned int usecs); #ifdef __cplusplus diff --git a/kernel/processor.c b/kernel/processor.c index a9461bce..98d2a001 100644 --- a/kernel/processor.c +++ b/kernel/processor.c @@ -22,9 +22,9 @@ #include #include -static int cpu_freq = 0; +static uint32_t cpu_freq = 0; -int detect_cpu_frequency(void) +uint32_t detect_cpu_frequency(void) { uint64_t start, end; uint64_t ticks, old; @@ -41,12 +41,12 @@ int detect_cpu_frequency(void) ; end = rdtsc(); - cpu_freq = end - start; + cpu_freq = (uint32_t) (end - start); return cpu_freq; } -int get_cpu_frequency(void) +uint32_t get_cpu_frequency(void) { if (cpu_freq > 0) return cpu_freq;