sh: Tidy up lib64 udelay impl.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
600ee240d1
commit
99432700cf
|
@ -13,8 +13,6 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <asm/param.h>
|
#include <asm/param.h>
|
||||||
|
|
||||||
extern unsigned long loops_per_jiffy;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use only for very small delays (< 1 msec).
|
* Use only for very small delays (< 1 msec).
|
||||||
*
|
*
|
||||||
|
@ -49,11 +47,10 @@ void __ndelay(unsigned long long nsecs, unsigned long lpj)
|
||||||
|
|
||||||
void udelay(unsigned long usecs)
|
void udelay(unsigned long usecs)
|
||||||
{
|
{
|
||||||
__udelay(usecs, loops_per_jiffy);
|
__udelay(usecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndelay(unsigned long nsecs)
|
void ndelay(unsigned long nsecs)
|
||||||
{
|
{
|
||||||
__ndelay(nsecs, loops_per_jiffy);
|
__ndelay(nsecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Delay routines calling functions in arch/sh/lib/delay.c
|
* Delay routines calling functions in arch/sh/lib/delay.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void __bad_udelay(void);
|
extern void __bad_udelay(void);
|
||||||
extern void __bad_ndelay(void);
|
extern void __bad_ndelay(void);
|
||||||
|
|
||||||
|
@ -15,13 +15,17 @@ extern void __ndelay(unsigned long nsecs);
|
||||||
extern void __const_udelay(unsigned long usecs);
|
extern void __const_udelay(unsigned long usecs);
|
||||||
extern void __delay(unsigned long loops);
|
extern void __delay(unsigned long loops);
|
||||||
|
|
||||||
|
#ifdef CONFIG_SUPERH32
|
||||||
#define udelay(n) (__builtin_constant_p(n) ? \
|
#define udelay(n) (__builtin_constant_p(n) ? \
|
||||||
((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
|
((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
|
||||||
__udelay(n))
|
__udelay(n))
|
||||||
|
|
||||||
|
|
||||||
#define ndelay(n) (__builtin_constant_p(n) ? \
|
#define ndelay(n) (__builtin_constant_p(n) ? \
|
||||||
((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
|
((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
|
||||||
__ndelay(n))
|
__ndelay(n))
|
||||||
|
#else
|
||||||
|
extern void udelay(unsigned long usecs);
|
||||||
|
extern void ndelay(unsigned long nsecs);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ASM_SH_DELAY_H */
|
#endif /* __ASM_SH_DELAY_H */
|
||||||
|
|
Loading…
Reference in New Issue