xref: /openbsd-src/sys/dev/pci/drm/include/linux/delay.h (revision 4e1ee0786f11cc571bd0be17d38e46f635c719fc)
1 /* Public domain. */
2 
3 #ifndef _LINUX_DELAY_H
4 #define _LINUX_DELAY_H
5 
6 #include <sys/param.h>
7 #include <linux/kernel.h>
8 
9 static inline void
10 udelay(unsigned long usecs)
11 {
12 	DELAY(usecs);
13 }
14 
15 static inline void
16 ndelay(unsigned long nsecs)
17 {
18 	DELAY(MAX(nsecs / 1000, 1));
19 }
20 
21 static inline void
22 usleep_range(unsigned long min, unsigned long max)
23 {
24 	DELAY((min + max) / 2);
25 }
26 
27 static inline void
28 mdelay(unsigned long msecs)
29 {
30 	int loops = msecs;
31 	while (loops--)
32 		DELAY(1000);
33 }
34 
35 #define drm_msleep(x)		mdelay(x)
36 
37 #endif
38