Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/include Define a macro to check hypervisor vers...



details:   https://anonhg.NetBSD.org/src/rev/409ed915a722
branches:  trunk
changeset: 796685:409ed915a722
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Jun 14 02:53:02 2014 +0000

description:
Define a macro to check hypervisor version.  OK cherry@

diffstat:

 sys/arch/xen/include/hypervisor.h |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r e073ad667d14 -r 409ed915a722 sys/arch/xen/include/hypervisor.h
--- a/sys/arch/xen/include/hypervisor.h Sat Jun 14 02:05:38 2014 +0000
+++ b/sys/arch/xen/include/hypervisor.h Sat Jun 14 02:53:02 2014 +0000
@@ -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 @@
 #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);



Home | Main Index | Thread Index | Old Index