delay.h 359 B

1234567891011121314151617181920
  1. #ifndef _CRIS_ARCH_DELAY_H
  2. #define _CRIS_ARCH_DELAY_H
  3. extern __inline__ void __delay(int loops)
  4. {
  5. __asm__ __volatile__ (
  6. "move.d %0,$r9\n\t"
  7. "beq 2f\n\t"
  8. "subq 1,$r9\n\t"
  9. "1:\n\t"
  10. "bne 1b\n\t"
  11. "subq 1,$r9\n"
  12. "2:"
  13. : : "g" (loops) : "r9");
  14. }
  15. #endif /* defined(_CRIS_ARCH_DELAY_H) */