GNU Linux-libre 4.14.290-gnu1
[releases.git] / arch / cris / include / arch-v32 / arch / delay.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_CRIS_ARCH_DELAY_H
3 #define _ASM_CRIS_ARCH_DELAY_H
4
5 extern void cris_delay10ns(u32 n10ns);
6 #define udelay(u) cris_delay10ns((u)*100)
7 #define ndelay(n) cris_delay10ns(((n)+9)/10)
8
9 /*
10  * Not used anymore for udelay or ndelay.  Referenced by
11  * e.g. init/calibrate.c.  All other references are likely bugs;
12  * should be replaced by mdelay, udelay or ndelay.
13  */
14
15 static inline void
16 __delay(int loops)
17 {
18         __asm__ __volatile__ (
19                 "move.d %0, $r9\n\t"
20                 "beq 2f\n\t"
21                 "subq 1, $r9\n\t"
22                 "1:\n\t"
23                 "bne 1b\n\t"
24                 "subq 1, $r9\n"
25                 "2:"
26                 : : "g" (loops) : "r9");
27 }
28
29 #endif /* _ASM_CRIS_ARCH_DELAY_H */