timex.h 477 B

123456789101112131415161718192021222324
  1. /*
  2. * asm-blackfin/timex.h: cpu cycles!
  3. *
  4. * Copyright 2004-2008 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef _ASM_BLACKFIN_TIMEX_H
  9. #define _ASM_BLACKFIN_TIMEX_H
  10. #define CLOCK_TICK_RATE 1000000 /* Underlying HZ */
  11. typedef unsigned long long cycles_t;
  12. static inline cycles_t get_cycles(void)
  13. {
  14. unsigned long tmp, tmp2;
  15. __asm__ __volatile__("%0 = cycles; %1 = cycles2;" : "=d"(tmp), "=d"(tmp2));
  16. return tmp | ((cycles_t)tmp2 << 32);
  17. }
  18. #endif