diff options
author | Greg Watson <jarrah@users.sourceforge.net> | 2003-07-28 21:16:49 +0000 |
---|---|---|
committer | Greg Watson <jarrah@users.sourceforge.net> | 2003-07-28 21:16:49 +0000 |
commit | cc6b6c4c83bfd8bb074029814ce2a501c2cd64a9 (patch) | |
tree | c56897eec541f96050015a5f591c7a62c8adbd68 /src | |
parent | 008c127074345910de4b7726ccd0cca2d8a89854 (diff) |
made timer more generic
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1051 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/ppc/lib/timer.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/arch/ppc/lib/timer.c b/src/arch/ppc/lib/timer.c index c82df1973b..37576d71f4 100644 --- a/src/arch/ppc/lib/timer.c +++ b/src/arch/ppc/lib/timer.c @@ -2,29 +2,29 @@ /* This code is distributed without warranty under the GPL v2 (see COPYING) */ #include <timer.h> -#include <bsp.h> +#include <ppc.h> -unsigned get_hz(void) +unsigned long get_hz(void) { - return bsp_clock_speed(); + return get_clock_speed(); } -unsigned ticks_since_boot(void) +unsigned long ticks_since_boot(void) { - extern unsigned long long _timebase(void); - return (unsigned) (_timebase()); + extern unsigned long _timebase(void); + return _timebase(); } -void sleep_ticks(unsigned ticks) +void sleep_ticks(unsigned long ticks) { - unsigned then = ticks + ticks_since_boot(); + unsigned long then = ticks + ticks_since_boot(); while(ticks_since_boot() < then) ; } void udelay(int usecs) { - unsigned ticksperusec = get_hz() / 1000000; + unsigned long ticksperusec = get_hz() / 1000000; sleep_ticks(ticksperusec * usecs); } |