Skip to content

Commit

Permalink
xen/acpi: Move the xen_running_on_version_or_later function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Konrad Rzeszutek Wilk committed Nov 28, 2012
1 parent 5af19e4 commit 394b40f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
15 changes: 15 additions & 0 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions drivers/xen/xen-acpi-pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <acpi/acpi_drivers.h>
#include <asm/xen/hypercall.h>
#include <xen/interface/version.h>
#include <xen/xen-ops.h>

#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
Expand Down
18 changes: 0 additions & 18 deletions include/xen/interface/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,4 @@ struct xen_feature_info {
/* arg == xen_domain_handle_t. */
#define XENVER_guest_handle 8

/* Declares the xen_domain() macros. */
#include <xen/xen.h>

/* Check if running on Xen version (major, minor) or later */
static inline 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;
}
#endif /* __XEN_PUBLIC_VERSION_H__ */
1 change: 1 addition & 0 deletions include/xen/xen-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
unsigned long mfn, int nr,
pgprot_t prot, unsigned domid);

bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
#endif /* INCLUDE_XEN_OPS_H */

0 comments on commit 394b40f

Please sign in to comment.