aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/misc_32.S8
-rw-r--r--arch/powerpc/kernel/time.c28
2 files changed, 28 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index f6d84a75ed26..624a983a9676 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -27,14 +27,6 @@
27 27
28 .text 28 .text
29 29
30 .align 5
31_GLOBAL(__delay)
32 cmpwi 0,r3,0
33 mtctr r3
34 beqlr
351: bdnz 1b
36 blr
37
38/* 30/*
39 * This returns the high 64 bits of the product of two 64-bit numbers. 31 * This returns the high 64 bits of the product of two 64-bit numbers.
40 */ 32 */
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 070b4b458aaf..de8479769bb7 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -130,6 +130,34 @@ unsigned long tb_last_stamp;
130 */ 130 */
131DEFINE_PER_CPU(unsigned long, last_jiffy); 131DEFINE_PER_CPU(unsigned long, last_jiffy);
132 132
133void __delay(unsigned long loops)
134{
135 unsigned long start;
136 int diff;
137
138 if (__USE_RTC()) {
139 start = get_rtcl();
140 do {
141 /* the RTCL register wraps at 1000000000 */
142 diff = get_rtcl() - start;
143 if (diff < 0)
144 diff += 1000000000;
145 } while (diff < loops);
146 } else {
147 start = get_tbl();
148 while (get_tbl() - start < loops)
149 HMT_low();
150 HMT_medium();
151 }
152}
153EXPORT_SYMBOL(__delay);
154
155void udelay(unsigned long usecs)
156{
157 __delay(tb_ticks_per_usec * usecs);
158}
159EXPORT_SYMBOL(udelay);
160
133static __inline__ void timer_check_rtc(void) 161static __inline__ void timer_check_rtc(void)
134{ 162{
135 /* 163 /*