Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / score / include / asm / delay.h
bloba4bd2c748ab4e0061596ab216b788f76544412ec
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SCORE_DELAY_H
3 #define _ASM_SCORE_DELAY_H
5 #include <asm-generic/param.h>
7 static inline void __delay(unsigned long loops)
9 /* 3 cycles per loop. */
10 __asm__ __volatile__ (
11 "1:\tsubi\t%0, 3\n\t"
12 "cmpz.c\t%0\n\t"
13 "ble\t1b\n\t"
14 : "=r" (loops)
15 : "0" (loops));
18 static inline void __udelay(unsigned long usecs)
20 unsigned long loops_per_usec;
22 loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
24 __delay(usecs * loops_per_usec);
27 #define udelay(usecs) __udelay(usecs)
29 #endif /* _ASM_SCORE_DELAY_H */