Skip to content

Commit 394b40f

Browse files
committed
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>
1 parent 5af19e4 commit 394b40f

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

arch/x86/xen/enlighten.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,21 @@ static void __init xen_banner(void)
223223
version >> 16, version & 0xffff, extra.extraversion,
224224
xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : "");
225225
}
226+
/* Check if running on Xen version (major, minor) or later */
227+
bool
228+
xen_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+
}
226241

227242
#define CPUID_THERM_POWER_LEAF 6
228243
#define APERFMPERF_PRESENT 0

drivers/xen/xen-acpi-pad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <acpi/acpi_drivers.h>
2121
#include <asm/xen/hypercall.h>
2222
#include <xen/interface/version.h>
23+
#include <xen/xen-ops.h>
2324

2425
#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
2526
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"

include/xen/interface/version.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,4 @@ struct xen_feature_info {
6363
/* arg == xen_domain_handle_t. */
6464
#define XENVER_guest_handle 8
6565

66-
/* Declares the xen_domain() macros. */
67-
#include <xen/xen.h>
68-
69-
/* Check if running on Xen version (major, minor) or later */
70-
static inline bool
71-
xen_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-
}
8466
#endif /* __XEN_PUBLIC_VERSION_H__ */

include/xen/xen-ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
2929
unsigned long mfn, int nr,
3030
pgprot_t prot, unsigned domid);
3131

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

0 commit comments

Comments
 (0)