tools, slub: Fix off-by-one buffer corruption after readlink() call
[linux-2.6/linux-mips.git] / arch / score / include / asm / delay.h
blob529e494712a5a46aee7b3431771df8416c62107d
1 #ifndef _ASM_SCORE_DELAY_H
2 #define _ASM_SCORE_DELAY_H
4 #include <asm-generic/param.h>
6 static inline void __delay(unsigned long loops)
8 /* 3 cycles per loop. */
9 __asm__ __volatile__ (
10 "1:\tsubi\t%0, 3\n\t"
11 "cmpz.c\t%0\n\t"
12 "ble\t1b\n\t"
13 : "=r" (loops)
14 : "0" (loops));
17 static inline void __udelay(unsigned long usecs)
19 unsigned long loops_per_usec;
21 loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
23 __delay(usecs * loops_per_usec);
26 #define udelay(usecs) __udelay(usecs)
28 #endif /* _ASM_SCORE_DELAY_H */