Module Name:    src
Committed By:   bouyer
Date:           Fri Feb 17 18:42:19 UTC 2012

Modified Files:
        src/sys/arch/xen/include: hypervisor.h
        src/sys/arch/xen/xen: hypervisor.c

Log Message:
- 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


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/hypervisor.c

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.37 src/sys/arch/xen/include/hypervisor.h:1.38
--- src/sys/arch/xen/include/hypervisor.h:1.37	Fri Feb 17 18:40:19 2012
+++ src/sys/arch/xen/include/hypervisor.h	Fri Feb 17 18:42:19 2012
@@ -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 @@ struct cpu_info;
 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);

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.60 src/sys/arch/xen/xen/hypervisor.c:1.61
--- src/sys/arch/xen/xen/hypervisor.c:1.60	Fri Dec  9 11:47:49 2011
+++ src/sys/arch/xen/xen/hypervisor.c	Fri Feb 17 18:42:19 2012
@@ -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 @@ struct  x86_isa_chipset x86_isa_chipset;
 #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 @@ hypervisor_vcpu_print(void *aux, const c
 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 @@ hypervisor_attach(device_t parent, devic
 	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();

Reply via email to