- 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
This commit is contained in:
parent
3ed27e697d
commit
3683e9c84c
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#include <metalsvm/time.h>
|
||||
#include <metalsvm/processor.h>
|
||||
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue