aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/delay.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-14 05:23:37 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-16 07:05:02 -0400
commit8b99cfb8cc51adae7f5294c8962a026c63100959 (patch)
tree349cebcae3eda608f1ed52fa3afcf661fca075a9 /include/asm-sparc64/delay.h
parent27a2ef382c7935a4dd02bff9fd361ce118df98c6 (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 'include/asm-sparc64/delay.h')
-rw-r--r--include/asm-sparc64/delay.h32
1 files changed, 6 insertions, 26 deletions
diff --git a/include/asm-sparc64/delay.h b/include/asm-sparc64/delay.h
index a4aae6f80627..a77aa622d762 100644
--- a/include/asm-sparc64/delay.h
+++ b/include/asm-sparc64/delay.h
@@ -1,37 +1,17 @@
1/* delay.h: Linux delay routines on sparc64. 1/* delay.h: Linux delay routines on sparc64.
2 * 2 *
3 * Copyright (C) 1996, 2004 David S. Miller (davem@davemloft.net). 3 * Copyright (C) 1996, 2004, 2007 David S. Miller (davem@davemloft.net).
4 *
5 * Based heavily upon x86 variant which is:
6 * Copyright (C) 1993 Linus Torvalds
7 *
8 * Delay routines calling functions in arch/sparc64/lib/delay.c
9 */ 4 */
10 5
11#ifndef __SPARC64_DELAY_H 6#ifndef _SPARC64_DELAY_H
12#define __SPARC64_DELAY_H 7#define _SPARC64_DELAY_H
13
14#include <linux/param.h>
15#include <asm/cpudata.h>
16 8
17#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
18 10
19extern void __bad_udelay(void);
20extern void __bad_ndelay(void);
21
22extern void __udelay(unsigned long usecs);
23extern void __ndelay(unsigned long nsecs);
24extern void __const_udelay(unsigned long usecs);
25extern void __delay(unsigned long loops); 11extern void __delay(unsigned long loops);
26 12extern void udelay(unsigned long usecs);
27#define udelay(n) (__builtin_constant_p(n) ? \ 13#define mdelay(n) udelay((n) * 1000)
28 ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
29 __udelay(n))
30
31#define ndelay(n) (__builtin_constant_p(n) ? \
32 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
33 __ndelay(n))
34 14
35#endif /* !__ASSEMBLY__ */ 15#endif /* !__ASSEMBLY__ */
36 16
37#endif /* defined(__SPARC64_DELAY_H) */ 17#endif /* _SPARC64_DELAY_H */