delay.h 610 B

12345678910111213141516171819202122232425262728
  1. #ifndef _ASM_CRIS_ARCH_DELAY_H
  2. #define _ASM_CRIS_ARCH_DELAY_H
  3. extern void cris_delay10ns(u32 n10ns);
  4. #define udelay(u) cris_delay10ns((u)*100)
  5. #define ndelay(n) cris_delay10ns(((n)+9)/10)
  6. /*
  7. * Not used anymore for udelay or ndelay. Referenced by
  8. * e.g. init/calibrate.c. All other references are likely bugs;
  9. * should be replaced by mdelay, udelay or ndelay.
  10. */
  11. static inline void
  12. __delay(int loops)
  13. {
  14. __asm__ __volatile__ (
  15. "move.d %0, $r9\n\t"
  16. "beq 2f\n\t"
  17. "subq 1, $r9\n\t"
  18. "1:\n\t"
  19. "bne 1b\n\t"
  20. "subq 1, $r9\n"
  21. "2:"
  22. : : "g" (loops) : "r9");
  23. }
  24. #endif /* _ASM_CRIS_ARCH_DELAY_H */