blob: 031db84f2aa150255348ae123778fe84776519bf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_SH_DELAY_H
2#define __ASM_SH_DELAY_H
3
4/*
5 * Copyright (C) 1993 Linus Torvalds
6 *
7 * Delay routines calling functions in arch/sh/lib/delay.c
8 */
Paul Mundt99432702007-11-20 14:49:36 +09009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010extern void __bad_udelay(void);
11extern void __bad_ndelay(void);
12
13extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs);
16extern void __delay(unsigned long loops);
17
Paul Mundt99432702007-11-20 14:49:36 +090018#ifdef CONFIG_SUPERH32
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#define udelay(n) (__builtin_constant_p(n) ? \
20 ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
21 __udelay(n))
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#define ndelay(n) (__builtin_constant_p(n) ? \
24 ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
25 __ndelay(n))
Paul Mundt99432702007-11-20 14:49:36 +090026#else
27extern void udelay(unsigned long usecs);
28extern void ndelay(unsigned long nsecs);
29#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31#endif /* __ASM_SH_DELAY_H */