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