5 * Copyright (C) 1993 Linus Torvalds
7 * Delay routines, using a pre-computed "loops_per_jiffy" value.
10 <<<<<<< HEAD
:include
/linux
/delay
.h
12 #include <linux/kernel.h>
14 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/delay
.h
15 extern unsigned long loops_per_jiffy
;
17 #include <asm/delay.h>
20 * Using udelay() for intervals greater than a few milliseconds can
21 * risk overflow for high loops_per_jiffy (high bogomips) machines. The
22 * mdelay() provides a wrapper to prevent this. For delays greater
23 * than MAX_UDELAY_MS milliseconds, the wrapper is used. Architecture
24 * specific values can be defined in asm-???/delay.h as an override.
25 * The 2nd mdelay() definition ensures GCC will optimize away the
26 * while loop for the common cases where n <= MAX_UDELAY_MS -- Paul G.
30 #define MAX_UDELAY_MS 5
35 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \
36 ({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
40 <<<<<<< HEAD
:include
/linux
/delay
.h
41 #define ndelay(x) udelay(((x)+999)/1000)
43 static inline void ndelay(unsigned long x
)
45 udelay(DIV_ROUND_UP(x
, 1000));
47 #define ndelay(x) ndelay(x)
48 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/delay
.h
51 void calibrate_delay(void);
52 void msleep(unsigned int msecs
);
53 unsigned long msleep_interruptible(unsigned int msecs
);
55 static inline void ssleep(unsigned int seconds
)
57 msleep(seconds
* 1000);
60 #endif /* defined(_LINUX_DELAY_H) */