delay.h 820 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __ASM_ARM_DELAY_H
  2. #define __ASM_ARM_DELAY_H
  3. /*
  4. * Copyright (C) 1995 Russell King
  5. *
  6. * Delay routines, using a pre-computed "loops_per_second" value.
  7. */
  8. extern void __delay(int loops);
  9. /*
  10. * division by multiplication: you don't have to worry about
  11. * loss of precision.
  12. *
  13. * Use only for very small delays ( < 1 msec). Should probably use a
  14. * lookup table, really, as the multiplications take much too long with
  15. * short delays. This is a "reasonable" implementation, though (and the
  16. * first constant multiplications gets optimized away if the delay is
  17. * a constant)
  18. *
  19. * FIXME - lets improve it then...
  20. */
  21. extern void udelay(unsigned long usecs);
  22. static inline unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
  23. {
  24. return a * b / c;
  25. }
  26. #endif /* defined(_ARM_DELAY_H) */