timex.h 707 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * OpenRISC Linux
  4. *
  5. * Linux architectural port borrowing liberally from similar works of
  6. * others. All original copyrights apply as per the original source
  7. * declaration.
  8. *
  9. * OpenRISC implementation:
  10. * Copyright (C) 2010-2011 Jonas Bonn <[email protected]>
  11. */
  12. #ifndef __ASM_OPENRISC_TIMEX_H
  13. #define __ASM_OPENRISC_TIMEX_H
  14. #define get_cycles get_cycles
  15. #include <asm-generic/timex.h>
  16. #include <asm/spr.h>
  17. #include <asm/spr_defs.h>
  18. static inline cycles_t get_cycles(void)
  19. {
  20. return mfspr(SPR_TTCR);
  21. }
  22. #define get_cycles get_cycles
  23. /* This isn't really used any more */
  24. #define CLOCK_TICK_RATE 1000
  25. #define ARCH_HAS_READ_CURRENT_TIMER
  26. #endif