Module Name:    src
Committed By:   riastradh
Date:           Fri Aug 25 08:05:19 UTC 2023

Modified Files:
        src/sys/arch/x86/acpi: acpi_wakeup.c
        src/sys/arch/x86/pci: pci_machdep.c
        src/sys/arch/x86/x86: genfb_machdep.c
        src/sys/arch/xen/include/amd64: vmparam.h
        src/sys/arch/xen/x86: xen_pmap.c

Log Message:
xen: Provide definitions or ifdefs to make drm build in XEN3_DOM0.

No idea if it works, but it builds now.

PR port-xen/49330


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/amd64/vmparam.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/x86/xen_pmap.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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.54 src/sys/arch/x86/acpi/acpi_wakeup.c:1.55
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.54	Tue Jun  1 21:29:24 2021
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.54 2021/06/01 21:29:24 riastradh Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.54 2021/06/01 21:29:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,6 +103,10 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.
 
 #include "acpi_wakecode.h"
 
+#ifdef XENPV
+#error acpi_wakeup.c (acpi_md_vesa_modenum) users must be adapted for Xen
+#endif
+
 /* Address is also hard-coded in acpi_wakecode.S */
 static paddr_t acpi_wakeup_paddr = 3 * PAGE_SIZE;
 static vaddr_t acpi_wakeup_vaddr;

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.94 src/sys/arch/x86/pci/pci_machdep.c:1.95
--- src/sys/arch/x86/pci/pci_machdep.c:1.94	Mon Aug  7 06:23:39 2023
+++ src/sys/arch/x86/pci/pci_machdep.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.94 2023/08/07 06:23:39 msaitoh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.94 2023/08/07 06:23:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -310,7 +310,7 @@ static struct pci_conf_lock cl0 = {
 
 static struct pci_conf_lock * const cl = &cl0;
 
-#if NGENFB > 0 && NACPICA > 0 && defined(VGA_POST)
+#if NGENFB > 0 && NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 extern int acpi_md_vbios_reset;
 extern int acpi_md_vesa_modenum;
 #endif
@@ -1060,13 +1060,13 @@ static bool
 x86_genfb_setmode(struct genfb_softc *sc, int newmode)
 {
 #if NGENFB > 0
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	static int curmode = WSDISPLAYIO_MODE_EMUL;
 # endif
 
 	switch (newmode) {
 	case WSDISPLAYIO_MODE_EMUL:
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 		if (curmode != newmode) {
 			if (vga_posth != NULL && acpi_md_vesa_modenum != 0) {
 				vga_post_set_vbe(vga_posth,
@@ -1077,7 +1077,7 @@ x86_genfb_setmode(struct genfb_softc *sc
 		break;
 	}
 
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	curmode = newmode;
 # endif
 #endif
@@ -1096,7 +1096,7 @@ x86_genfb_resume(device_t dev, const pmf
 #if NGENFB > 0
 	struct pci_genfb_softc *psc = device_private(dev);
 
-#if NACPICA > 0 && defined(VGA_POST)
+#if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	if (vga_posth != NULL && acpi_md_vbios_reset == 2) {
 		vga_post_call(vga_posth);
 		if (acpi_md_vesa_modenum != 0)

Index: src/sys/arch/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.19 src/sys/arch/x86/x86/genfb_machdep.c:1.20
--- src/sys/arch/x86/x86/genfb_machdep.c:1.19	Tue Sep 13 09:45:36 2022
+++ src/sys/arch/x86/x86/genfb_machdep.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.19 2022/09/13 09:45:36 riastradh Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.20 2023/08/25 08:05:18 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill <jmcne...@invisible.ca>
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.19 2022/09/13 09:45:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.20 2023/08/25 08:05:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -61,8 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 struct vcons_screen x86_genfb_console_screen;
 bool x86_genfb_use_shadowfb = true;
 
-#if NACPICA > 0
-extern int acpi_md_vesa_modenum;
+#if NACPICA > 0 && !defined(XENPV)
+extern int acpi_md_vesa_modenum; /* XXX should go in a .h file */
 #endif
 
 static device_t x86_genfb_console_dev = NULL;
@@ -131,7 +131,7 @@ x86_genfb_init(void)
 		return 0;
 	}
 
-#if NACPICA > 0
+#if NACPICA > 0 && !defined(XENPV)
 	acpi_md_vesa_modenum = fbinfo->vbemode;
 #endif
 

Index: src/sys/arch/xen/include/amd64/vmparam.h
diff -u src/sys/arch/xen/include/amd64/vmparam.h:1.3 src/sys/arch/xen/include/amd64/vmparam.h:1.4
--- src/sys/arch/xen/include/amd64/vmparam.h:1.3	Thu Feb 14 06:59:24 2019
+++ src/sys/arch/xen/include/amd64/vmparam.h	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.3 2019/02/14 06:59:24 cherry Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.4 2023/08/25 08:05:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -35,6 +35,11 @@
 
 #undef VM_NFREELIST
 #undef VM_FREELIST_FIRST16
+#undef VM_FREELIST_FIRST1T
+#undef VM_FREELIST_FIRST64G
+#undef VM_FREELIST_FIRST4G
+#undef VM_FREELIST_FIRST1G
+#undef VM_FREELIST_FIRST16
 #define	VM_NFREELIST	1
 #endif /* XENPV */
 #endif /* _VMPARAM_H_ */

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.40 src/sys/arch/xen/x86/xen_pmap.c:1.41
--- src/sys/arch/xen/x86/xen_pmap.c:1.40	Sat Aug 20 23:48:51 2022
+++ src/sys/arch/xen/x86/xen_pmap.c	Fri Aug 25 08:05:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.40 2022/08/20 23:48:51 riastradh Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.41 2023/08/25 08:05:19 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.40 2022/08/20 23:48:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.41 2023/08/25 08:05:19 riastradh Exp $");
 
 #include "opt_lockdebug.h"
 #include "opt_multiprocessor.h"
@@ -126,6 +126,7 @@ __KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v
 #include <machine/cpuvar.h>
 #include <machine/pmap_private.h>
 
+#include <x86/machdep.h>
 #include <x86/pmap_pv.h>
 
 #include <x86/i82489reg.h>
@@ -384,3 +385,9 @@ xen_kpm_sync(struct pmap *pmap, int inde
 		mutex_exit(&ci->ci_kpm_mtx);
 	}
 }
+
+int
+x86_select_freelist(uint64_t maxaddr)
+{
+	return VM_FREELIST_DEFAULT;
+}

Reply via email to