| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap_bootstrap.c,v 1.3 2024/01/02 07:43:29 thorpej Exp $ */ | | 1 | /* $NetBSD: pmap_bootstrap.c,v 1.4 2024/01/02 07:46:49 thorpej Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1991, 1993 | | 4 | * Copyright (c) 1991, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * the Systems Programming Group of the University of Utah Computer | | 8 | * the Systems Programming Group of the University of Utah Computer |
9 | * Science Department. | | 9 | * Science Department. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
33 | * SUCH DAMAGE. | | 33 | * SUCH DAMAGE. |
34 | * | | 34 | * |
35 | * @(#)pmap_bootstrap.c 8.1 (Berkeley) 6/10/93 | | 35 | * @(#)pmap_bootstrap.c 8.1 (Berkeley) 6/10/93 |
36 | */ | | 36 | */ |
37 | | | 37 | |
38 | #include <sys/cdefs.h> | | 38 | #include <sys/cdefs.h> |
39 | __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.3 2024/01/02 07:43:29 thorpej Exp $"); | | 39 | __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.4 2024/01/02 07:46:49 thorpej Exp $"); |
40 | | | 40 | |
41 | #include "opt_m68k_arch.h" | | 41 | #include "opt_m68k_arch.h" |
42 | | | 42 | |
43 | #include <sys/param.h> | | 43 | #include <sys/param.h> |
44 | #include <sys/kcore.h> | | 44 | #include <sys/kcore.h> |
45 | #include <uvm/uvm_extern.h> | | 45 | #include <uvm/uvm_extern.h> |
46 | | | 46 | |
47 | #include <machine/bootinfo.h> | | 47 | #include <machine/bootinfo.h> |
48 | #include <machine/cpu.h> | | 48 | #include <machine/cpu.h> |
49 | #include <machine/pte.h> | | 49 | #include <machine/pte.h> |
50 | #include <machine/vmparam.h> | | 50 | #include <machine/vmparam.h> |
51 | | | 51 | |
52 | #define RELOC(v, t) *((t*)((uintptr_t)&(v) + firstpa)) | | 52 | #define RELOC(v, t) *((t*)((uintptr_t)&(v) + firstpa)) |
| @@ -126,27 +126,26 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f | | | @@ -126,27 +126,26 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f |
126 | if (RELOC(mmutype, int) == MMU_68040) | | 126 | if (RELOC(mmutype, int) == MMU_68040) |
127 | kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE); | | 127 | kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE); |
128 | else | | 128 | else |
129 | #endif | | 129 | #endif |
130 | kstsize = 1; | | 130 | kstsize = 1; |
131 | kstpa = nextpa; | | 131 | kstpa = nextpa; |
132 | nextpa += kstsize * PAGE_SIZE; | | 132 | nextpa += kstsize * PAGE_SIZE; |
133 | | | 133 | |
134 | kptmpa = nextpa; | | 134 | kptmpa = nextpa; |
135 | nextpa += PAGE_SIZE; | | 135 | nextpa += PAGE_SIZE; |
136 | | | 136 | |
137 | kptpa = nextpa; | | 137 | kptpa = nextpa; |
138 | nptpages = RELOC(Sysptsize, int) + howmany(RELOC(physmem, int), NPTEPG); | | 138 | nptpages = RELOC(Sysptsize, int) + howmany(RELOC(physmem, int), NPTEPG); |
139 | nptpages <<= 1; | | | |
140 | nextpa += nptpages * PAGE_SIZE; | | 139 | nextpa += nptpages * PAGE_SIZE; |
141 | | | 140 | |
142 | /* | | 141 | /* |
143 | * Clear all PTEs to zero | | 142 | * Clear all PTEs to zero |
144 | */ | | 143 | */ |
145 | for (pte = (pt_entry_t *)kstpa; pte < (pt_entry_t *)nextpa; pte++) | | 144 | for (pte = (pt_entry_t *)kstpa; pte < (pt_entry_t *)nextpa; pte++) |
146 | *pte = 0; | | 145 | *pte = 0; |
147 | | | 146 | |
148 | /* | | 147 | /* |
149 | * Initialize segment table and kernel page table map. | | 148 | * Initialize segment table and kernel page table map. |
150 | * | | 149 | * |
151 | * On 68030s and earlier MMUs the two are identical except for | | 150 | * On 68030s and earlier MMUs the two are identical except for |
152 | * the valid bits so both are initialized with essentially the | | 151 | * the valid bits so both are initialized with essentially the |