aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-11-27 11:39:40 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-11-28 14:39:31 -0500
commit394b40f62d7ae18a1c48c13fc483b8193f8c3a98 (patch)
tree1ed5bcd5dd1adbc35132ee486eef5efaef0de110
parent5af19e475fdc046a68be0c09cd53417ce73b8dcf (diff)
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>
-rw-r--r--arch/x86/xen/enlighten.c15
-rw-r--r--drivers/xen/xen-acpi-pad.c1
-rw-r--r--include/xen/interface/version.h18
-rw-r--r--include/xen/xen-ops.h1
4 files changed, 17 insertions, 18 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)
223 version >> 16, version & 0xffff, extra.extraversion, 223 version >> 16, version & 0xffff, extra.extraversion,
224 xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : ""); 224 xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : "");
225} 225}
226/* Check if running on Xen version (major, minor) or later */
227bool
228xen_running_on_version_or_later(unsigned int major, unsigned int minor)
229{
230 unsigned int version;
231
232 if (!xen_domain())
233 return false;
234
235 version = HYPERVISOR_xen_version(XENVER_version, NULL);
236 if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) ||
237 ((version >> 16) > major))
238 return true;
239 return false;
240}
226 241
227#define CPUID_THERM_POWER_LEAF 6 242#define CPUID_THERM_POWER_LEAF 6
228#define APERFMPERF_PRESENT 0 243#define APERFMPERF_PRESENT 0
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
index f23ecf380088..da39191e7278 100644
--- a/drivers/xen/xen-acpi-pad.c
+++ b/drivers/xen/xen-acpi-pad.c
@@ -20,6 +20,7 @@
20#include <acpi/acpi_drivers.h> 20#include <acpi/acpi_drivers.h>
21#include <asm/xen/hypercall.h> 21#include <asm/xen/hypercall.h>
22#include <xen/interface/version.h> 22#include <xen/interface/version.h>
23#include <xen/xen-ops.h>
23 24
24#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" 25#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
25#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" 26#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
diff --git a/include/xen/interface/version.h b/include/xen/interface/version.h
index 53553f046497..7ff6498679a3 100644
--- a/include/xen/interface/version.h
+++ b/include/xen/interface/version.h
@@ -63,22 +63,4 @@ struct xen_feature_info {
63/* arg == xen_domain_handle_t. */ 63/* arg == xen_domain_handle_t. */
64#define XENVER_guest_handle 8 64#define XENVER_guest_handle 8
65 65
66/* Declares the xen_domain() macros. */
67#include <xen/xen.h>
68
69/* Check if running on Xen version (major, minor) or later */
70static inline bool
71xen_running_on_version_or_later(unsigned int major, unsigned int minor)
72{
73 unsigned int version;
74
75 if (!xen_domain())
76 return false;
77
78 version = HYPERVISOR_xen_version(XENVER_version, NULL);
79 if ((((version >> 16) == major) && ((version & 0xffff) >= minor)) ||
80 ((version >> 16) > major))
81 return true;
82 return false;
83}
84#endif /* __XEN_PUBLIC_VERSION_H__ */ 66#endif /* __XEN_PUBLIC_VERSION_H__ */
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e46ab6e..6170abd53d0b 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,4 +29,5 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
29 unsigned long mfn, int nr, 29 unsigned long mfn, int nr,
30 pgprot_t prot, unsigned domid); 30 pgprot_t prot, unsigned domid);
31 31
32bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
32#endif /* INCLUDE_XEN_OPS_H */ 33#endif /* INCLUDE_XEN_OPS_H */