Module Name: src Committed By: riastradh Date: Sat Aug 20 23:15:37 UTC 2022
Modified Files: src/sys/arch/amd64/amd64: machdep.c src/sys/arch/amd64/include: asan.h src/sys/arch/i386/i386: machdep.c src/sys/arch/x86/include: pmap.h src/sys/arch/x86/x86: db_memrw.c patch.c pmap.c x86_machdep.c Added Files: src/sys/arch/x86/include: bootspace.h Log Message: x86: Split bootspace out of x86/pmap.h into new x86/bootspace.h. To generate a diff of this commit: cvs rdiff -u -r1.361 -r1.362 src/sys/arch/amd64/amd64/machdep.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/include/asan.h cvs rdiff -u -r1.835 -r1.836 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/include/bootspace.h cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/db_memrw.c cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/x86/patch.c cvs rdiff -u -r1.416 -r1.417 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.150 -r1.151 src/sys/arch/x86/x86/x86_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/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.361 src/sys/arch/amd64/amd64/machdep.c:1.362 --- src/sys/arch/amd64/amd64/machdep.c:1.361 Sun Dec 26 21:33:48 2021 +++ src/sys/arch/amd64/amd64/machdep.c Sat Aug 20 23:15:36 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.361 2021/12/26 21:33:48 riastradh Exp $ */ +/* $NetBSD: machdep.c,v 1.362 2022/08/20 23:15:36 riastradh Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011 @@ -110,7 +110,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.361 2021/12/26 21:33:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.362 2022/08/20 23:15:36 riastradh Exp $"); #include "opt_modular.h" #include "opt_user_ldt.h" @@ -183,6 +183,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include <machine/mtrr.h> #include <machine/mpbiosvar.h> +#include <x86/bootspace.h> #include <x86/cputypes.h> #include <x86/cpuvar.h> #include <x86/machdep.h> Index: src/sys/arch/amd64/include/asan.h diff -u src/sys/arch/amd64/include/asan.h:1.9 src/sys/arch/amd64/include/asan.h:1.10 --- src/sys/arch/amd64/include/asan.h:1.9 Thu Sep 10 14:10:46 2020 +++ src/sys/arch/amd64/include/asan.h Sat Aug 20 23:15:36 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: asan.h,v 1.9 2020/09/10 14:10:46 maxv Exp $ */ +/* $NetBSD: asan.h,v 1.10 2022/08/20 23:15:36 riastradh Exp $ */ /* * Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net @@ -35,6 +35,8 @@ #include <amd64/pmap.h> #include <amd64/vmparam.h> +#include <x86/bootspace.h> + #ifdef __HAVE_PCPU_AREA #error "PCPU area not allowed with KASAN" #endif Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.835 src/sys/arch/i386/i386/machdep.c:1.836 --- src/sys/arch/i386/i386/machdep.c:1.835 Tue May 31 18:04:11 2022 +++ src/sys/arch/i386/i386/machdep.c Sat Aug 20 23:15:36 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.835 2022/05/31 18:04:11 bouyer Exp $ */ +/* $NetBSD: machdep.c,v 1.836 2022/08/20 23:15:36 riastradh Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.835 2022/05/31 18:04:11 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.836 2022/08/20 23:15:36 riastradh Exp $"); #include "opt_beep.h" #include "opt_compat_freebsd.h" @@ -136,6 +136,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v #include <machine/mtrr.h> #include <x86/x86/tsc.h> +#include <x86/bootspace.h> #include <x86/fpu.h> #include <x86/dbregs.h> #include <x86/machdep.h> Index: src/sys/arch/x86/include/pmap.h diff -u src/sys/arch/x86/include/pmap.h:1.129 src/sys/arch/x86/include/pmap.h:1.130 --- src/sys/arch/x86/include/pmap.h:1.129 Sat Aug 20 23:13:51 2022 +++ src/sys/arch/x86/include/pmap.h Sat Aug 20 23:15:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.129 2022/08/20 23:13:51 riastradh Exp $ */ +/* $NetBSD: pmap.h,v 1.130 2022/08/20 23:15:37 riastradh Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -115,49 +115,6 @@ #include <x86/pmap_pv.h> #include <uvm/pmap/pmap_pvt.h> -#define BTSEG_NONE 0 -#define BTSEG_TEXT 1 -#define BTSEG_RODATA 2 -#define BTSEG_DATA 3 -#define BTSPACE_NSEGS 64 - -struct bootspace { - struct { - vaddr_t va; - paddr_t pa; - size_t sz; - } head; - - /* Kernel segments. */ - struct { - int type; - vaddr_t va; - paddr_t pa; - size_t sz; - } segs[BTSPACE_NSEGS]; - - /* - * The area used by the early kernel bootstrap. It contains the kernel - * symbols, the preloaded modules, the bootstrap tables, and the ISA I/O - * mem. - */ - struct { - vaddr_t va; - paddr_t pa; - size_t sz; - } boot; - - /* A magic VA usable by the bootstrap code. */ - vaddr_t spareva; - - /* Virtual address of the page directory. */ - vaddr_t pdir; - - /* Area dedicated to kernel modules (amd64 only). */ - vaddr_t smodule; - vaddr_t emodule; -}; - #define SLAREA_USER 0 #define SLAREA_PTE 1 #define SLAREA_MAIN 2 Index: src/sys/arch/x86/x86/db_memrw.c diff -u src/sys/arch/x86/x86/db_memrw.c:1.12 src/sys/arch/x86/x86/db_memrw.c:1.13 --- src/sys/arch/x86/x86/db_memrw.c:1.12 Thu Oct 7 12:52:27 2021 +++ src/sys/arch/x86/x86/db_memrw.c Sat Aug 20 23:15:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: db_memrw.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $ */ +/* $NetBSD: db_memrw.c,v 1.13 2022/08/20 23:15:37 riastradh Exp $ */ /*- * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.13 2022/08/20 23:15:37 riastradh Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v #include <machine/db_machdep.h> +#include <x86/bootspace.h> + #include <ddb/db_access.h> #include <ddb/db_output.h> Index: src/sys/arch/x86/x86/patch.c diff -u src/sys/arch/x86/x86/patch.c:1.51 src/sys/arch/x86/x86/patch.c:1.52 --- src/sys/arch/x86/x86/patch.c:1.51 Sat Jul 30 14:11:00 2022 +++ src/sys/arch/x86/x86/patch.c Sat Aug 20 23:15:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: patch.c,v 1.51 2022/07/30 14:11:00 riastradh Exp $ */ +/* $NetBSD: patch.c,v 1.52 2022/08/20 23:15:37 riastradh Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.51 2022/07/30 14:11:00 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.52 2022/08/20 23:15:37 riastradh Exp $"); #include "opt_lockdebug.h" #ifdef i386 @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: patch.c,v 1. #include <uvm/uvm.h> #include <machine/pmap.h> +#include <x86/bootspace.h> #include <x86/cpuvar.h> #include <x86/cputypes.h> Index: src/sys/arch/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.416 src/sys/arch/x86/x86/pmap.c:1.417 --- src/sys/arch/x86/x86/pmap.c:1.416 Sat Aug 20 23:13:51 2022 +++ src/sys/arch/x86/x86/pmap.c Sat Aug 20 23:15:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.416 2022/08/20 23:13:51 riastradh Exp $ */ +/* $NetBSD: pmap.c,v 1.417 2022/08/20 23:15:37 riastradh Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.416 2022/08/20 23:13:51 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.417 2022/08/20 23:15:37 riastradh Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -167,6 +167,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.4 #include <machine/cpuvar.h> #include <machine/cputypes.h> +#include <x86/bootspace.h> #include <x86/pat.h> #include <x86/pmap_pv.h> Index: src/sys/arch/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.150 src/sys/arch/x86/x86/x86_machdep.c:1.151 --- src/sys/arch/x86/x86/x86_machdep.c:1.150 Thu Oct 28 10:45:49 2021 +++ src/sys/arch/x86/x86/x86_machdep.c Sat Aug 20 23:15:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.150 2021/10/28 10:45:49 riastradh Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.151 2022/08/20 23:15:37 riastradh Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.150 2021/10/28 10:45:49 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.151 2022/08/20 23:15:37 riastradh Exp $"); #include "opt_modular.h" #include "opt_physmem.h" @@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: x86_machdep. #include <sys/extent.h> #include <sys/rnd.h> +#include <x86/bootspace.h> #include <x86/cpuvar.h> #include <x86/cputypes.h> #include <x86/efi.h> Added files: Index: src/sys/arch/x86/include/bootspace.h diff -u /dev/null src/sys/arch/x86/include/bootspace.h:1.1 --- /dev/null Sat Aug 20 23:15:37 2022 +++ src/sys/arch/x86/include/bootspace.h Sat Aug 20 23:15:37 2022 @@ -0,0 +1,111 @@ +/* $NetBSD: bootspace.h,v 1.1 2022/08/20 23:15:37 riastradh Exp $ */ + +/* + * Copyright (c) 1997 Charles D. Cranor and Washington University. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 2001 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Frank van der Linden for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _X86_BOOTSPACE_H_ +#define _X86_BOOTSPACE_H_ + +#include <sys/types.h> + +#define BTSEG_NONE 0 +#define BTSEG_TEXT 1 +#define BTSEG_RODATA 2 +#define BTSEG_DATA 3 +#define BTSPACE_NSEGS 64 + +struct bootspace { + struct { + vaddr_t va; + paddr_t pa; + size_t sz; + } head; + + /* Kernel segments. */ + struct { + int type; + vaddr_t va; + paddr_t pa; + size_t sz; + } segs[BTSPACE_NSEGS]; + + /* + * The area used by the early kernel bootstrap. It contains the kernel + * symbols, the preloaded modules, the bootstrap tables, and the ISA I/O + * mem. + */ + struct { + vaddr_t va; + paddr_t pa; + size_t sz; + } boot; + + /* A magic VA usable by the bootstrap code. */ + vaddr_t spareva; + + /* Virtual address of the page directory. */ + vaddr_t pdir; + + /* Area dedicated to kernel modules (amd64 only). */ + vaddr_t smodule; + vaddr_t emodule; +}; + +#endif /* _X86_BOOTSPACE_H_ */