#ifndef _H8300_DELAY_H1#define _H8300_DELAY_H23#include <asm/param.h>45/*6* Copyright (C) 2002 Yoshinori Sato <[email protected]>7*8* Delay routines, using a pre-computed "loops_per_second" value.9*/1011static inline void __delay(unsigned long loops)12{13__asm__ __volatile__ ("1:\n\t"14"dec.l #1,%0\n\t"15"bne 1b"16:"=r" (loops):"0"(loops));17}1819/*20* Use only for very small delays ( < 1 msec). Should probably use a21* lookup table, really, as the multiplications take much too long with22* short delays. This is a "reasonable" implementation, though (and the23* first constant multiplications gets optimized away if the delay is24* a constant)25*/2627extern unsigned long loops_per_jiffy;2829static inline void udelay(unsigned long usecs)30{31usecs *= 4295; /* 2**32 / 1000000 */32usecs /= (loops_per_jiffy*HZ);33if (usecs)34__delay(usecs);35}3637#endif /* _H8300_DELAY_H */383940