xref: /openbmc/linux/arch/mips/include/asm/delay.h (revision 5210edcd)
1384740dcSRalf Baechle /*
2384740dcSRalf Baechle  * This file is subject to the terms and conditions of the GNU General Public
3384740dcSRalf Baechle  * License.  See the file "COPYING" in the main directory of this archive
4384740dcSRalf Baechle  * for more details.
5384740dcSRalf Baechle  *
6384740dcSRalf Baechle  * Copyright (C) 1994 by Waldorf Electronics
7384740dcSRalf Baechle  * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle
8384740dcSRalf Baechle  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9384740dcSRalf Baechle  * Copyright (C) 2007  Maciej W. Rozycki
10384740dcSRalf Baechle  */
11384740dcSRalf Baechle #ifndef _ASM_DELAY_H
12384740dcSRalf Baechle #define _ASM_DELAY_H
13384740dcSRalf Baechle 
14e3bf887dSRalf Baechle #include <linux/param.h>
15e3bf887dSRalf Baechle 
165210edcdSDavid Daney extern void __delay(unsigned long loops);
175210edcdSDavid Daney extern void __ndelay(unsigned long ns);
185210edcdSDavid Daney extern void __udelay(unsigned long us);
19384740dcSRalf Baechle 
2039027ff0SRalf Baechle #define ndelay(ns) __ndelay(ns)
215636919bSRalf Baechle #define udelay(us) __udelay(us)
22384740dcSRalf Baechle 
23384740dcSRalf Baechle /* make sure "usecs *= ..." in udelay do not overflow. */
24384740dcSRalf Baechle #if HZ >= 1000
25384740dcSRalf Baechle #define MAX_UDELAY_MS	1
26384740dcSRalf Baechle #elif HZ <= 200
27384740dcSRalf Baechle #define MAX_UDELAY_MS	5
28384740dcSRalf Baechle #else
29384740dcSRalf Baechle #define MAX_UDELAY_MS	(1000 / HZ)
30384740dcSRalf Baechle #endif
31384740dcSRalf Baechle 
32384740dcSRalf Baechle #endif /* _ASM_DELAY_H */
33