timex.h 827 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * linux/include/asm-alpha/timex.h
  4. *
  5. * ALPHA architecture timex specifications
  6. */
  7. #ifndef _ASMALPHA_TIMEX_H
  8. #define _ASMALPHA_TIMEX_H
  9. /* With only one or two oddballs, we use the RTC as the ticker, selecting
  10. the 32.768kHz reference clock, which nicely divides down to our HZ. */
  11. #define CLOCK_TICK_RATE 32768
  12. /*
  13. * Standard way to access the cycle counter.
  14. * Currently only used on SMP for scheduling.
  15. *
  16. * Only the low 32 bits are available as a continuously counting entity.
  17. * But this only means we'll force a reschedule every 8 seconds or so,
  18. * which isn't an evil thing.
  19. */
  20. typedef unsigned int cycles_t;
  21. static inline cycles_t get_cycles (void)
  22. {
  23. cycles_t ret;
  24. __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
  25. return ret;
  26. }
  27. #define get_cycles get_cycles
  28. #endif