diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-20 00:49:36 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:49 -0500 |
commit | 99432700cf2f28976191ab546deffc0007ef4eb7 (patch) | |
tree | f472c1aebbf3215f6c69c0c110816fea835bae7d | |
parent | 600ee240d15e535d51e6c2b2f8475f0aa42885ea (diff) |
sh: Tidy up lib64 udelay impl.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/lib64/udelay.c | 7 | ||||
-rw-r--r-- | include/asm-sh/delay.h | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/arch/sh/lib64/udelay.c b/arch/sh/lib64/udelay.c index 327653914007..4c71a7428e60 100644 --- a/arch/sh/lib64/udelay.c +++ b/arch/sh/lib64/udelay.c | |||
@@ -13,8 +13,6 @@ | |||
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <asm/param.h> | 14 | #include <asm/param.h> |
15 | 15 | ||
16 | extern unsigned long loops_per_jiffy; | ||
17 | |||
18 | /* | 16 | /* |
19 | * Use only for very small delays (< 1 msec). | 17 | * Use only for very small delays (< 1 msec). |
20 | * | 18 | * |
@@ -49,11 +47,10 @@ void __ndelay(unsigned long long nsecs, unsigned long lpj) | |||
49 | 47 | ||
50 | void udelay(unsigned long usecs) | 48 | void udelay(unsigned long usecs) |
51 | { | 49 | { |
52 | __udelay(usecs, loops_per_jiffy); | 50 | __udelay(usecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy); |
53 | } | 51 | } |
54 | 52 | ||
55 | void ndelay(unsigned long nsecs) | 53 | void ndelay(unsigned long nsecs) |
56 | { | 54 | { |
57 | __ndelay(nsecs, loops_per_jiffy); | 55 | __ndelay(nsecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy); |
58 | } | 56 | } |
59 | |||
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h index db599b2a5a9c..031db84f2aa1 100644 --- a/include/asm-sh/delay.h +++ b/include/asm-sh/delay.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Delay routines calling functions in arch/sh/lib/delay.c | 7 | * Delay routines calling functions in arch/sh/lib/delay.c |
8 | */ | 8 | */ |
9 | 9 | ||
10 | extern void __bad_udelay(void); | 10 | extern void __bad_udelay(void); |
11 | extern void __bad_ndelay(void); | 11 | extern void __bad_ndelay(void); |
12 | 12 | ||
@@ -15,13 +15,17 @@ extern void __ndelay(unsigned long nsecs); | |||
15 | extern void __const_udelay(unsigned long usecs); | 15 | extern void __const_udelay(unsigned long usecs); |
16 | extern void __delay(unsigned long loops); | 16 | extern void __delay(unsigned long loops); |
17 | 17 | ||
18 | #ifdef CONFIG_SUPERH32 | ||
18 | #define udelay(n) (__builtin_constant_p(n) ? \ | 19 | #define udelay(n) (__builtin_constant_p(n) ? \ |
19 | ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \ | 20 | ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \ |
20 | __udelay(n)) | 21 | __udelay(n)) |
21 | 22 | ||
22 | |||
23 | #define ndelay(n) (__builtin_constant_p(n) ? \ | 23 | #define ndelay(n) (__builtin_constant_p(n) ? \ |
24 | ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ | 24 | ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ |
25 | __ndelay(n)) | 25 | __ndelay(n)) |
26 | #else | ||
27 | extern void udelay(unsigned long usecs); | ||
28 | extern void ndelay(unsigned long nsecs); | ||
29 | #endif | ||
26 | 30 | ||
27 | #endif /* __ASM_SH_DELAY_H */ | 31 | #endif /* __ASM_SH_DELAY_H */ |