From 1933d3737133314c97e42f6ad928f00ed6e71120 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 12 Feb 2016 11:38:51 +0100 Subject: [PATCH] Make grub_cpu_is_tsc_supported generally available. --- grub-core/kern/i386/tsc.c | 16 ---------------- include/grub/i386/tsc.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c index 82cdea491..2e85289d8 100644 --- a/grub-core/kern/i386/tsc.c +++ b/grub-core/kern/i386/tsc.c @@ -43,22 +43,6 @@ grub_tsc_get_time_ms (void) return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; } -static __inline int -grub_cpu_is_tsc_supported (void) -{ -#ifndef GRUB_MACHINE_XEN - grub_uint32_t a,b,c,d; - if (! grub_cpu_is_cpuid_supported ()) - return 0; - - grub_cpuid(1,a,b,c,d); - - return (d & (1 << 4)) != 0; -#else - return 1; -#endif -} - static int calibrate_tsc_hardcode (void) { diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index 71fa7ca2f..a0aa2c573 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -51,4 +51,20 @@ grub_get_tsc (void) return (((grub_uint64_t) hi) << 32) | lo; } +static __inline int +grub_cpu_is_tsc_supported (void) +{ +#ifndef GRUB_MACHINE_XEN + grub_uint32_t a,b,c,d; + if (! grub_cpu_is_cpuid_supported ()) + return 0; + + grub_cpuid(1,a,b,c,d); + + return (d & (1 << 4)) != 0; +#else + return 1; +#endif +} + #endif /* ! KERNEL_CPU_TSC_HEADER */