/*1* Copyright (C) 1995-2004 Russell King2*3* Delay routines, using a pre-computed "loops_per_second" value.4*/5#ifndef __ASM_ARM_DELAY_H6#define __ASM_ARM_DELAY_H78#include <asm/param.h> /* HZ */910extern void __delay(int loops);1112/*13* This function intentionally does not exist; if you see references to14* it, it means that you're calling udelay() with an out of range value.15*16* With currently imposed limits, this means that we support a max delay17* of 2000us. Further limits: HZ<=1000 and bogomips<=335518*/19extern void __bad_udelay(void);2021/*22* division by multiplication: you don't have to worry about23* loss of precision.24*25* Use only for very small delays ( < 1 msec). Should probably use a26* lookup table, really, as the multiplications take much too long with27* short delays. This is a "reasonable" implementation, though (and the28* first constant multiplications gets optimized away if the delay is29* a constant)30*/31extern void __udelay(unsigned long usecs);32extern void __const_udelay(unsigned long);3334#define MAX_UDELAY_MS 23536#define udelay(n) \37(__builtin_constant_p(n) ? \38((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() : \39__const_udelay((n) * ((2199023U*HZ)>>11))) : \40__udelay(n))4142#endif /* defined(_ARM_DELAY_H) */43444546