delay.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _ASM_POWERPC_DELAY_H
  2. #define _ASM_POWERPC_DELAY_H
  3. #ifdef __KERNEL__
  4. /*
  5. * Copyright 1996, Paul Mackerras.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the License, or (at your option) any later version.
  11. *
  12. * PPC64 Support added by Dave Engebretsen, Todd Inglett, Mike Corrigan,
  13. * Anton Blanchard.
  14. */
  15. extern void __delay(unsigned long loops);
  16. extern void udelay(unsigned long usecs);
  17. /*
  18. * On shared processor machines the generic implementation of mdelay can
  19. * result in large errors. While each iteration of the loop inside mdelay
  20. * is supposed to take 1ms, the hypervisor could sleep our partition for
  21. * longer (eg 10ms). With the right timing these errors can add up.
  22. *
  23. * Since there is no 32bit overflow issue on 64bit kernels, just call
  24. * udelay directly.
  25. */
  26. #ifdef CONFIG_PPC64
  27. #define mdelay(n) udelay((n) * 1000)
  28. #endif
  29. #endif /* __KERNEL__ */
  30. #endif /* _ASM_POWERPC_DELAY_H */