diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-07-14 05:23:37 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-16 07:05:02 -0400 |
commit | 8b99cfb8cc51adae7f5294c8962a026c63100959 (patch) | |
tree | 349cebcae3eda608f1ed52fa3afcf661fca075a9 /arch/sparc64/lib | |
parent | 27a2ef382c7935a4dd02bff9fd361ce118df98c6 (diff) |
[SPARC64]: More sensible udelay implementation.
Take a page from the powerpc folks and just calculate the
delay factor directly.
Since frequency scaling chips use a system-tick register,
the value is going to be the same system-wide.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/lib')
-rw-r--r-- | arch/sparc64/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/sparc64/lib/delay.c | 46 |
2 files changed, 1 insertions, 47 deletions
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile index 4a725d8985f1..c4a6d6e7d03c 100644 --- a/arch/sparc64/lib/Makefile +++ b/arch/sparc64/lib/Makefile | |||
@@ -14,6 +14,6 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \ | |||
14 | NGmemcpy.o NGcopy_from_user.o NGcopy_to_user.o NGpatch.o \ | 14 | NGmemcpy.o NGcopy_from_user.o NGcopy_to_user.o NGpatch.o \ |
15 | NGpage.o NGbzero.o \ | 15 | NGpage.o NGbzero.o \ |
16 | copy_in_user.o user_fixup.o memmove.o \ | 16 | copy_in_user.o user_fixup.o memmove.o \ |
17 | mcount.o ipcsum.o rwsem.o xor.o delay.o | 17 | mcount.o ipcsum.o rwsem.o xor.o |
18 | 18 | ||
19 | obj-y += iomap.o | 19 | obj-y += iomap.o |
diff --git a/arch/sparc64/lib/delay.c b/arch/sparc64/lib/delay.c deleted file mode 100644 index fb27e54a03ee..000000000000 --- a/arch/sparc64/lib/delay.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* delay.c: Delay loops for sparc64 | ||
2 | * | ||
3 | * Copyright (C) 2004, 2006 David S. Miller <davem@davemloft.net> | ||
4 | * | ||
5 | * Based heavily upon x86 variant which is: | ||
6 | * Copyright (C) 1993 Linus Torvalds | ||
7 | * Copyright (C) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz> | ||
8 | */ | ||
9 | |||
10 | #include <linux/delay.h> | ||
11 | #include <asm/timer.h> | ||
12 | |||
13 | void __delay(unsigned long loops) | ||
14 | { | ||
15 | unsigned long bclock, now; | ||
16 | |||
17 | bclock = tick_ops->get_tick(); | ||
18 | do { | ||
19 | now = tick_ops->get_tick(); | ||
20 | } while ((now-bclock) < loops); | ||
21 | } | ||
22 | |||
23 | /* We used to multiply by HZ after shifting down by 32 bits | ||
24 | * but that runs into problems for higher values of HZ and | ||
25 | * slow cpus. | ||
26 | */ | ||
27 | void __const_udelay(unsigned long n) | ||
28 | { | ||
29 | n *= 4; | ||
30 | |||
31 | n *= (cpu_data(raw_smp_processor_id()).udelay_val * (HZ/4)); | ||
32 | n >>= 32; | ||
33 | |||
34 | __delay(n + 1); | ||
35 | } | ||
36 | |||
37 | void __udelay(unsigned long n) | ||
38 | { | ||
39 | __const_udelay(n * 0x10c7UL); | ||
40 | } | ||
41 | |||
42 | |||
43 | void __ndelay(unsigned long n) | ||
44 | { | ||
45 | __const_udelay(n * 0x5UL); | ||
46 | } | ||