Pull up following revision(s) (requested by bouyer in ticket #432): sys/arch/x86/x86/genfb_machdep.c: revision 1.23 (patch) sys/arch/x86/acpi/acpi_wakeup.c: revision 1.57 (patch) Move definition of acpi_md_vesa_modenum to acpi_wakeup.c; allows building kernels without framebuffer devices. Problem reported by John D. Baker on current-users@diff -r1.54.12.1 -r1.54.12.2 src/sys/arch/x86/acpi/acpi_wakeup.c
(martin)
--- src/sys/arch/x86/acpi/acpi_wakeup.c 2023/10/18 15:14:24 1.54.12.1
+++ src/sys/arch/x86/acpi/acpi_wakeup.c 2023/10/20 18:35:54 1.54.12.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_wakeup.c,v 1.54.12.1 2023/10/18 15:14:24 martin Exp $ */ | 1 | /* $NetBSD: acpi_wakeup.c,v 1.54.12.2 2023/10/20 18:35:54 martin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Takuya SHIOZAKI. | 8 | * by Takuya SHIOZAKI. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -49,27 +49,27 @@ | @@ -49,27 +49,27 @@ | |||
49 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 49 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
50 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 50 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
51 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 51 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
52 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 52 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
56 | * SUCH DAMAGE. | 56 | * SUCH DAMAGE. | |
57 | * | 57 | * | |
58 | * FreeBSD: src/sys/i386/acpica/acpi_wakeup.c,v 1.9 2002/01/10 03:26:46 wes Exp | 58 | * FreeBSD: src/sys/i386/acpica/acpi_wakeup.c,v 1.9 2002/01/10 03:26:46 wes Exp | |
59 | */ | 59 | */ | |
60 | 60 | |||
61 | #include <sys/cdefs.h> | 61 | #include <sys/cdefs.h> | |
62 | __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.54.12.1 2023/10/18 15:14:24 martin Exp $"); | 62 | __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.54.12.2 2023/10/20 18:35:54 martin Exp $"); | |
63 | 63 | |||
64 | #include <sys/param.h> | 64 | #include <sys/param.h> | |
65 | #include <sys/systm.h> | 65 | #include <sys/systm.h> | |
66 | #include <sys/kernel.h> | 66 | #include <sys/kernel.h> | |
67 | #include <sys/bus.h> | 67 | #include <sys/bus.h> | |
68 | #include <sys/cpu.h> | 68 | #include <sys/cpu.h> | |
69 | #include <sys/kcpuset.h> | 69 | #include <sys/kcpuset.h> | |
70 | #include <sys/sysctl.h> | 70 | #include <sys/sysctl.h> | |
71 | 71 | |||
72 | #include <uvm/uvm_extern.h> | 72 | #include <uvm/uvm_extern.h> | |
73 | 73 | |||
74 | #ifdef __i386__ | 74 | #ifdef __i386__ | |
75 | #include "opt_mtrr.h" | 75 | #include "opt_mtrr.h" | |
@@ -94,26 +94,32 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup. | @@ -94,26 +94,32 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup. | |||
94 | #include <machine/acpi_machdep.h> | 94 | #include <machine/acpi_machdep.h> | |
95 | #include <machine/cpu.h> | 95 | #include <machine/cpu.h> | |
96 | #include <machine/mtrr.h> | 96 | #include <machine/mtrr.h> | |
97 | 97 | |||
98 | #include <x86/cpuvar.h> | 98 | #include <x86/cpuvar.h> | |
99 | #include <x86/x86/tsc.h> | 99 | #include <x86/x86/tsc.h> | |
100 | #include <x86/fpu.h> | 100 | #include <x86/fpu.h> | |
101 | #include <arch/x86/include/genfb_machdep.h> | 101 | #include <arch/x86/include/genfb_machdep.h> | |
102 | 102 | |||
103 | #include "opt_vga.h" | 103 | #include "opt_vga.h" | |
104 | 104 | |||
105 | #include "acpi_wakecode.h" | 105 | #include "acpi_wakecode.h" | |
106 | 106 | |||
107 | #ifdef XENPV | |||
108 | #error acpi_wakeup.c (acpi_md_vesa_modenum) users must be adapted for Xen | |||
109 | #else | |||
110 | int acpi_md_vesa_modenum = 0; | |||
111 | #endif | |||
112 | ||||
107 | /* Address is also hard-coded in acpi_wakecode.S */ | 113 | /* Address is also hard-coded in acpi_wakecode.S */ | |
108 | static paddr_t acpi_wakeup_paddr = 3 * PAGE_SIZE; | 114 | static paddr_t acpi_wakeup_paddr = 3 * PAGE_SIZE; | |
109 | static vaddr_t acpi_wakeup_vaddr; | 115 | static vaddr_t acpi_wakeup_vaddr; | |
110 | 116 | |||
111 | static int acpi_md_beep_on_reset = 0; | 117 | static int acpi_md_beep_on_reset = 0; | |
112 | 118 | |||
113 | static int acpi_md_s4bios(void); | 119 | static int acpi_md_s4bios(void); | |
114 | static int sysctl_md_acpi_vbios_reset(SYSCTLFN_ARGS); | 120 | static int sysctl_md_acpi_vbios_reset(SYSCTLFN_ARGS); | |
115 | static int sysctl_md_acpi_beep_on_reset(SYSCTLFN_ARGS); | 121 | static int sysctl_md_acpi_beep_on_reset(SYSCTLFN_ARGS); | |
116 | 122 | |||
117 | /* Implemented in acpi_wakeup_low.S. */ | 123 | /* Implemented in acpi_wakeup_low.S. */ | |
118 | int acpi_md_sleep_prepare(int); | 124 | int acpi_md_sleep_prepare(int); | |
119 | int acpi_md_sleep_exit(int); | 125 | int acpi_md_sleep_exit(int); |
--- src/sys/arch/x86/x86/genfb_machdep.c 2023/10/18 16:53:03 1.19.4.2
+++ src/sys/arch/x86/x86/genfb_machdep.c 2023/10/20 18:35:54 1.19.4.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: genfb_machdep.c,v 1.19.4.2 2023/10/18 16:53:03 martin Exp $ */ | 1 | /* $NetBSD: genfb_machdep.c,v 1.19.4.3 2023/10/20 18:35:54 martin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * Early attach support for raster consoles | 30 | * Early attach support for raster consoles | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.19.4.2 2023/10/18 16:53:03 martin Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.19.4.3 2023/10/20 18:35:54 martin Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/conf.h> | 37 | #include <sys/conf.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/ioctl.h> | 39 | #include <sys/ioctl.h> | |
40 | #include <sys/kernel.h> | 40 | #include <sys/kernel.h> | |
41 | #include <sys/kmem.h> | 41 | #include <sys/kmem.h> | |
42 | #include <sys/lwp.h> | 42 | #include <sys/lwp.h> | |
43 | 43 | |||
44 | #include <sys/bus.h> | 44 | #include <sys/bus.h> | |
45 | #include <machine/bootinfo.h> | 45 | #include <machine/bootinfo.h> | |
46 | 46 | |||
47 | #include <dev/wscons/wsconsio.h> | 47 | #include <dev/wscons/wsconsio.h> | |
@@ -54,30 +54,26 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde | @@ -54,30 +54,26 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde | |||
54 | #include <arch/x86/include/genfb_machdep.h> | 54 | #include <arch/x86/include/genfb_machdep.h> | |
55 | #include <arch/xen/include/hypervisor.h> | 55 | #include <arch/xen/include/hypervisor.h> | |
56 | #include <arch/xen/include/xen.h> | 56 | #include <arch/xen/include/xen.h> | |
57 | 57 | |||
58 | #include "wsdisplay.h" | 58 | #include "wsdisplay.h" | |
59 | #include "genfb.h" | 59 | #include "genfb.h" | |
60 | #include "acpica.h" | 60 | #include "acpica.h" | |
61 | #include "opt_xen.h" | 61 | #include "opt_xen.h" | |
62 | 62 | |||
63 | #if NWSDISPLAY > 0 && NGENFB > 0 | 63 | #if NWSDISPLAY > 0 && NGENFB > 0 | |
64 | struct vcons_screen x86_genfb_console_screen; | 64 | struct vcons_screen x86_genfb_console_screen; | |
65 | bool x86_genfb_use_shadowfb = true; | 65 | bool x86_genfb_use_shadowfb = true; | |
66 | 66 | |||
67 | #if NACPICA > 0 | |||
68 | int acpi_md_vesa_modenum = 0; | |||
69 | #endif | |||
70 | ||||
71 | static device_t x86_genfb_console_dev = NULL; | 67 | static device_t x86_genfb_console_dev = NULL; | |
72 | 68 | |||
73 | static struct wsscreen_descr x86_genfb_stdscreen = { | 69 | static struct wsscreen_descr x86_genfb_stdscreen = { | |
74 | "std", | 70 | "std", | |
75 | 0, 0, | 71 | 0, 0, | |
76 | 0, | 72 | 0, | |
77 | 0, 0, | 73 | 0, 0, | |
78 | 0, | 74 | 0, | |
79 | NULL | 75 | NULL | |
80 | }; | 76 | }; | |
81 | 77 | |||
82 | void | 78 | void | |
83 | x86_genfb_set_console_dev(device_t dev) | 79 | x86_genfb_set_console_dev(device_t dev) |