Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen - make xen_version globally available, with mac...



details:   https://anonhg.NetBSD.org/src/rev/0177dc81c534
branches:  trunk
changeset: 777410:0177dc81c534
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Feb 17 18:42:19 2012 +0000

description:
- make xen_version globally available, with macros to access major and
  minor xen version.
- In xen_initclocks(), do a VCPUOP_stop_periodic_timer only for Xen 3.1
  and later
Should fix PR port-xen/45961

diffstat:

 sys/arch/xen/include/hypervisor.h |   6 +++++-
 sys/arch/xen/xen/hypervisor.c     |  11 ++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r e2cf3da949f9 -r 0177dc81c534 sys/arch/xen/include/hypervisor.h
--- a/sys/arch/xen/include/hypervisor.h Fri Feb 17 18:40:18 2012 +0000
+++ b/sys/arch/xen/include/hypervisor.h Fri Feb 17 18:42:19 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hypervisor.h,v 1.37 2012/02/17 18:40:19 bouyer Exp $   */
+/*     $NetBSD: hypervisor.h,v 1.38 2012/02/17 18:42:19 bouyer Exp $   */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -132,6 +132,10 @@
 void do_hypervisor_callback(struct intrframe *regs);
 void hypervisor_enable_event(unsigned int);
 
+extern int xen_version;
+#define XEN_MAJOR(x) (((x) & 0xffff0000) >> 16)
+#define XEN_MINOR(x) ((x) & 0x0000ffff)
+
 /* hypervisor_machdep.c */
 void hypervisor_send_event(struct cpu_info *, unsigned int);
 void hypervisor_unmask_event(unsigned int);
diff -r e2cf3da949f9 -r 0177dc81c534 sys/arch/xen/xen/hypervisor.c
--- a/sys/arch/xen/xen/hypervisor.c     Fri Feb 17 18:40:18 2012 +0000
+++ b/sys/arch/xen/xen/hypervisor.c     Fri Feb 17 18:42:19 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.60 2011/12/09 11:47:49 cherry Exp $ */
+/* $NetBSD: hypervisor.c,v 1.61 2012/02/17 18:42:19 bouyer Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.60 2011/12/09 11:47:49 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.61 2012/02/17 18:42:19 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -169,6 +169,8 @@
 #endif
 #endif
 
+int xen_version;
+
 /* power management, for save/restore */
 static bool hypervisor_suspend(device_t, const pmf_qual_t *);
 static bool hypervisor_resume(device_t, const pmf_qual_t *);
@@ -201,7 +203,6 @@
 void
 hypervisor_attach(device_t parent, device_t self, void *aux)
 {
-       int xen_version;
 
 #if NPCI >0
 #ifdef PCI_BUS_FIXUP
@@ -213,8 +214,8 @@
        xenkernfs_init();
 
        xen_version = HYPERVISOR_xen_version(XENVER_version, NULL);
-       aprint_normal(": Xen version %d.%d\n", (xen_version & 0xffff0000) >> 16,
-              xen_version & 0x0000ffff);
+       aprint_normal(": Xen version %d.%d\n", XEN_MAJOR(xen_version),
+              XEN_MINOR(xen_version));
 
        xengnt_init();
        events_init();



Home | Main Index | Thread Index | Old Index