timex.h 546 B

12345678910111213141516171819202122
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_TIMEX_H
  3. #define _ASM_X86_TIMEX_H
  4. #include <asm/processor.h>
  5. #include <asm/tsc.h>
  6. static inline unsigned long random_get_entropy(void)
  7. {
  8. if (!IS_ENABLED(CONFIG_X86_TSC) &&
  9. !cpu_feature_enabled(X86_FEATURE_TSC))
  10. return random_get_entropy_fallback();
  11. return rdtsc();
  12. }
  13. #define random_get_entropy random_get_entropy
  14. /* Assume we use the PIT time source for the clock tick */
  15. #define CLOCK_TICK_RATE PIT_TICK_RATE
  16. #define ARCH_HAS_READ_CURRENT_TIMER
  17. #endif /* _ASM_X86_TIMEX_H */