diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-11-27 11:39:40 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-11-28 14:39:31 -0500 |
commit | 394b40f62d7ae18a1c48c13fc483b8193f8c3a98 (patch) | |
tree | 1ed5bcd5dd1adbc35132ee486eef5efaef0de110 /arch/x86 | |
parent | 5af19e475fdc046a68be0c09cd53417ce73b8dcf (diff) | |
download | talos-op-linux-394b40f62d7ae18a1c48c13fc483b8193f8c3a98.tar.gz talos-op-linux-394b40f62d7ae18a1c48c13fc483b8193f8c3a98.zip |
xen/acpi: Move the xen_running_on_version_or_later function.
As on ia64 builds we get:
include/xen/interface/version.h: In function 'xen_running_on_version_or_later':
include/xen/interface/version.h:76: error: implicit declaration of function 'HYPERVISOR_xen_version'
We can later on make this function exportable if there are
modules using part of it. For right now the only two users are
built-in.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/xen/enlighten.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index eb0edff5499b..3325cd9f7790 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -223,6 +223,21 @@ static void __init xen_banner(void) version >> 16, version & 0xffff, extra.extraversion, xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); } +/* Check if running on Xen version (major, minor) or later */ +bool +xen_running_on_version_or_later(unsigned int major, unsigned int minor) +{ + unsigned int version; + + if (!xen_domain()) + return false; + + version = HYPERVISOR_xen_version(XENVER_version, NULL); + if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) || + ((version >> 16) > major)) + return true; + return false; +} #define CPUID_THERM_POWER_LEAF 6 #define APERFMPERF_PRESENT 0 |