Full support for Ginger Console
[linux-ginger.git] / arch / score / include / asm / delay.h
blob6726ec199dc02afbbe1f8ea379eba4e8309ab882
1 #ifndef _ASM_SCORE_DELAY_H
2 #define _ASM_SCORE_DELAY_H
4 static inline void __delay(unsigned long loops)
6 /* 3 cycles per loop. */
7 __asm__ __volatile__ (
8 "1:\tsubi\t%0, 3\n\t"
9 "cmpz.c\t%0\n\t"
10 "ble\t1b\n\t"
11 : "=r" (loops)
12 : "0" (loops));
15 static inline void __udelay(unsigned long usecs)
17 unsigned long loops_per_usec;
19 loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
21 __delay(usecs * loops_per_usec);
24 #define udelay(usecs) __udelay(usecs)
26 #endif /* _ASM_SCORE_DELAY_H */