ef8355c3a3
Signed-off-by: Cui Bixiong <bixiong@sunnorth.com.cn> Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
29 lines
528 B
C
29 lines
528 B
C
#ifndef _ASM_SCORE_DELAY_H
|
|
#define _ASM_SCORE_DELAY_H
|
|
|
|
#include <asm-generic/param.h>
|
|
|
|
static inline void __delay(unsigned long loops)
|
|
{
|
|
/* 3 cycles per loop. */
|
|
__asm__ __volatile__ (
|
|
"1:\tsubi\t%0, 3\n\t"
|
|
"cmpz.c\t%0\n\t"
|
|
"ble\t1b\n\t"
|
|
: "=r" (loops)
|
|
: "0" (loops));
|
|
}
|
|
|
|
static inline void __udelay(unsigned long usecs)
|
|
{
|
|
unsigned long loops_per_usec;
|
|
|
|
loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
|
|
|
|
__delay(usecs * loops_per_usec);
|
|
}
|
|
|
|
#define udelay(usecs) __udelay(usecs)
|
|
|
|
#endif /* _ASM_SCORE_DELAY_H */
|