Module Name:    src
Committed By:   cherry
Date:           Tue Feb 12 07:58:26 UTC 2019

Modified Files:
        src/sys/arch/xen/include: pci_machdep.h
        src/sys/arch/xen/x86: hypervisor_machdep.c

Log Message:
conditionally include XENPV specific code.

This explicitly excludes PV only functionality that would be wrong to
attempt to use in other modes, for eg: p2m table management.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/include/pci_machdep.h
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/x86/hypervisor_machdep.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/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.19 src/sys/arch/xen/include/pci_machdep.h:1.20
--- src/sys/arch/xen/include/pci_machdep.h:1.19	Sun Jul 16 06:14:24 2017
+++ src/sys/arch/xen/include/pci_machdep.h	Tue Feb 12 07:58:26 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.19 2017/07/16 06:14:24 cherry Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.20 2019/02/12 07:58:26 cherry Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -66,7 +66,7 @@ typedef intr_handle_t pci_intr_handle_t;
 
 #include "opt_xen.h"
 
-#ifndef DOM0OPS
+#if !defined(DOM0OPS) && defined(XENPV)
 int		xpci_enumerate_bus(struct pci_softc *, const int *,
 		   int (*)(const struct pci_attach_args *),
 		   struct pci_attach_args *);

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.34 src/sys/arch/xen/x86/hypervisor_machdep.c:1.35
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.34	Tue Dec 25 06:50:12 2018
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Tue Feb 12 07:58:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor_m
 #include "isa.h"
 #include "pci.h"
 
+#ifdef XENPV
 /*
  * arch-dependent p2m frame lists list (L3 and L2)
  * used by Xen for save/restore mappings
@@ -85,6 +86,8 @@ static int l2_p2m_page_size; /* size of 
 static void build_p2m_frame_list_list(void);
 static void update_p2m_frame_list_list(void);
 
+#endif
+
 // #define PORT_DEBUG 4
 // #define EARLY_DEBUG_EVENT
 
@@ -434,21 +437,26 @@ hypervisor_set_ipending(uint32_t iplmask
 void
 hypervisor_machdep_attach(void)
 {
+#ifdef XENPV
  	/* dom0 does not require the arch-dependent P2M translation table */
 	if (!xendomain_is_dom0()) {
 		build_p2m_frame_list_list();
 		sysctl_xen_suspend_setup();
 	}
+#endif
 }
 
 void
 hypervisor_machdep_resume(void)
 {
+#ifdef XENPV
 	/* dom0 does not require the arch-dependent P2M translation table */
 	if (!xendomain_is_dom0())
 		update_p2m_frame_list_list();
+#endif
 }
 
+#ifdef XENPV
 /*
  * Generate the p2m_frame_list_list table,
  * needed for guest save/restore
@@ -532,3 +540,4 @@ update_p2m_frame_list_list(void)
         HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 
 }
+#endif /* XENPV */

Reply via email to