Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch x86: Split bootspace out of x86/pmap.h into new x86...



details:   https://anonhg.NetBSD.org/src/rev/fe1410119d9f
branches:  trunk
changeset: 369526:fe1410119d9f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 20 23:15:36 2022 +0000

description:
x86: Split bootspace out of x86/pmap.h into new x86/bootspace.h.

diffstat:

 sys/arch/amd64/amd64/machdep.c   |    5 +-
 sys/arch/amd64/include/asan.h    |    4 +-
 sys/arch/i386/i386/machdep.c     |    5 +-
 sys/arch/x86/include/bootspace.h |  111 +++++++++++++++++++++++++++++++++++++++
 sys/arch/x86/include/pmap.h      |   45 +---------------
 sys/arch/x86/x86/db_memrw.c      |    6 +-
 sys/arch/x86/x86/patch.c         |    5 +-
 sys/arch/x86/x86/pmap.c          |    5 +-
 sys/arch/x86/x86/x86_machdep.c   |    5 +-
 9 files changed, 134 insertions(+), 57 deletions(-)

diffs (truncated from 349 to 300 lines):

diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Sat Aug 20 23:15:36 2022 +0000
@@ -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 @@
 #include <machine/mtrr.h>
 #include <machine/mpbiosvar.h>
 
+#include <x86/bootspace.h>
 #include <x86/cputypes.h>
 #include <x86/cpuvar.h>
 #include <x86/machdep.h>
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/amd64/include/asan.h
--- a/sys/arch/amd64/include/asan.h     Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/amd64/include/asan.h     Sat Aug 20 23:15:36 2022 +0000
@@ -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
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/i386/i386/machdep.c      Sat Aug 20 23:15:36 2022 +0000
@@ -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 @@
 #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>
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/x86/include/bootspace.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/x86/include/bootspace.h  Sat Aug 20 23:15:36 2022 +0000
@@ -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_ */
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h       Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/x86/include/pmap.h       Sat Aug 20 23:15:36 2022 +0000
@@ -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
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/x86/x86/db_memrw.c
--- a/sys/arch/x86/x86/db_memrw.c       Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/x86/x86/db_memrw.c       Sat Aug 20 23:15:36 2022 +0000
@@ -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 @@
 
 #include <machine/db_machdep.h>
 
+#include <x86/bootspace.h>
+
 #include <ddb/db_access.h>
 #include <ddb/db_output.h>
 
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/x86/x86/patch.c
--- a/sys/arch/x86/x86/patch.c  Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/x86/x86/patch.c  Sat Aug 20 23:15:36 2022 +0000
@@ -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 @@
 #include <uvm/uvm.h>
 #include <machine/pmap.h>
 
+#include <x86/bootspace.h>
 #include <x86/cpuvar.h>
 #include <x86/cputypes.h>
 
diff -r f9ce9e64a5a8 -r fe1410119d9f sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Sat Aug 20 23:13:51 2022 +0000
+++ b/sys/arch/x86/x86/pmap.c   Sat Aug 20 23:15:36 2022 +0000



Home | Main Index | Thread Index | Old Index