From cc6b6c4c83bfd8bb074029814ce2a501c2cd64a9 Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Mon, 28 Jul 2003 21:16:49 +0000 Subject: made timer more generic git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1051 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/arch/ppc/lib/timer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/arch/ppc') 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 -#include +#include -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); } -- cgit v1.2.3