xref: /kernel/linux/linux-5.10/arch/x86/include/asm/timex.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/x86/include/asm/
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_X86_TIMEX_H
38c2ecf20Sopenharmony_ci#define _ASM_X86_TIMEX_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/processor.h>
68c2ecf20Sopenharmony_ci#include <asm/tsc.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cistatic inline unsigned long random_get_entropy(void)
98c2ecf20Sopenharmony_ci{
108c2ecf20Sopenharmony_ci	if (!IS_ENABLED(CONFIG_X86_TSC) &&
118c2ecf20Sopenharmony_ci	    !cpu_feature_enabled(X86_FEATURE_TSC))
128c2ecf20Sopenharmony_ci		return random_get_entropy_fallback();
138c2ecf20Sopenharmony_ci	return rdtsc();
148c2ecf20Sopenharmony_ci}
158c2ecf20Sopenharmony_ci#define random_get_entropy random_get_entropy
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* Assume we use the PIT time source for the clock tick */
188c2ecf20Sopenharmony_ci#define CLOCK_TICK_RATE		PIT_TICK_RATE
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define ARCH_HAS_READ_CURRENT_TIMER
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#endif /* _ASM_X86_TIMEX_H */
23

Indexes created Thu Nov 07 10:32:03 CST 2024