Module Name: src
Committed By: pgoyette
Date: Sat Jun 14 02:53:02 UTC 2014
Modified Files:
src/sys/arch/xen/include: hypervisor.h
Log Message:
Define a macro to check hypervisor version. OK cherry@
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/include/hypervisor.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.43 src/sys/arch/xen/include/hypervisor.h:1.44
--- src/sys/arch/xen/include/hypervisor.h:1.43 Sun Jan 13 21:01:05 2013
+++ src/sys/arch/xen/include/hypervisor.h Sat Jun 14 02:53:02 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.h,v 1.43 2013/01/13 21:01:05 bouyer Exp $ */
+/* $NetBSD: hypervisor.h,v 1.44 2014/06/14 02:53:02 pgoyette Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -136,6 +136,15 @@ extern int xen_version;
#define XEN_MAJOR(x) (((x) & 0xffff0000) >> 16)
#define XEN_MINOR(x) ((x) & 0x0000ffff)
+/*
+ * Does the hypervisor we're running on support an api
+ * call at the requested version number ?
+ */
+#define XEN_VERSION_SUPPORTED(major, minor) \
+ (XEN_MAJOR(xen_version) > (major) || \
+ (XEN_MAJOR(xen_version) == (major) && \
+ XEN_MINOR(xen_version) >= (minor)))
+
/* hypervisor_machdep.c */
void hypervisor_send_event(struct cpu_info *, unsigned int);
void hypervisor_unmask_event(unsigned int);