2009-06-12 18:01:00 +04:00
|
|
|
#ifndef _ASM_SCORE_DELAY_H
|
|
|
|
#define _ASM_SCORE_DELAY_H
|
|
|
|
|
2009-12-17 13:31:23 +03:00
|
|
|
#include <asm-generic/param.h>
|
|
|
|
|
2009-06-12 18:01:00 +04:00
|
|
|
static inline void __delay(unsigned long loops)
|
|
|
|
{
|
2009-06-19 09:53:49 +04:00
|
|
|
/* 3 cycles per loop. */
|
2009-06-12 18:01:00 +04:00
|
|
|
__asm__ __volatile__ (
|
2009-06-19 09:53:49 +04:00
|
|
|
"1:\tsubi\t%0, 3\n\t"
|
2009-06-12 18:01:00 +04:00
|
|
|
"cmpz.c\t%0\n\t"
|
2009-06-19 09:53:49 +04:00
|
|
|
"ble\t1b\n\t"
|
2009-06-12 18:01:00 +04:00
|
|
|
: "=r" (loops)
|
|
|
|
: "0" (loops));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void __udelay(unsigned long usecs)
|
|
|
|
{
|
2009-06-19 09:53:49 +04:00
|
|
|
unsigned long loops_per_usec;
|
|
|
|
|
|
|
|
loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
|
|
|
|
|
|
|
|
__delay(usecs * loops_per_usec);
|
2009-06-12 18:01:00 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#define udelay(usecs) __udelay(usecs)
|
|
|
|
|
|
|
|
#endif /* _ASM_SCORE_DELAY_H */
|