| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.299 2015/09/08 13:18:06 nakayama Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.300 2015/11/27 13:51:24 joerg Exp $ */ |
2 | /* | | 2 | /* |
3 | * | | 3 | * |
4 | * Copyright (C) 1996-1999 Eduardo Horvath. | | 4 | * Copyright (C) 1996-1999 Eduardo Horvath. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * | | 13 | * |
14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND | | 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND |
| @@ -16,27 +16,27 @@ | | | @@ -16,27 +16,27 @@ |
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE | | 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE |
18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
24 | * SUCH DAMAGE. | | 24 | * SUCH DAMAGE. |
25 | * | | 25 | * |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | #include <sys/cdefs.h> | | 28 | #include <sys/cdefs.h> |
29 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2015/09/08 13:18:06 nakayama Exp $"); | | 29 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2015/11/27 13:51:24 joerg Exp $"); |
30 | | | 30 | |
31 | #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ | | 31 | #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ |
32 | #define HWREF | | 32 | #define HWREF |
33 | | | 33 | |
34 | #include "opt_ddb.h" | | 34 | #include "opt_ddb.h" |
35 | #include "opt_multiprocessor.h" | | 35 | #include "opt_multiprocessor.h" |
36 | #include "opt_modular.h" | | 36 | #include "opt_modular.h" |
37 | | | 37 | |
38 | #include <sys/param.h> | | 38 | #include <sys/param.h> |
39 | #include <sys/malloc.h> | | 39 | #include <sys/malloc.h> |
40 | #include <sys/queue.h> | | 40 | #include <sys/queue.h> |
41 | #include <sys/systm.h> | | 41 | #include <sys/systm.h> |
42 | #include <sys/msgbuf.h> | | 42 | #include <sys/msgbuf.h> |
| @@ -1408,27 +1408,27 @@ pmap_virtual_space(vaddr_t *start, vaddr | | | @@ -1408,27 +1408,27 @@ pmap_virtual_space(vaddr_t *start, vaddr |
1408 | vaddr_t | | 1408 | vaddr_t |
1409 | pmap_growkernel(vaddr_t maxkvaddr) | | 1409 | pmap_growkernel(vaddr_t maxkvaddr) |
1410 | { | | 1410 | { |
1411 | struct pmap *pm = pmap_kernel(); | | 1411 | struct pmap *pm = pmap_kernel(); |
1412 | paddr_t pa; | | 1412 | paddr_t pa; |
1413 | | | 1413 | |
1414 | if (maxkvaddr >= VM_MAX_KERNEL_ADDRESS) { | | 1414 | if (maxkvaddr >= VM_MAX_KERNEL_ADDRESS) { |
1415 | printf("WARNING: cannot extend kernel pmap beyond %p to %p\n", | | 1415 | printf("WARNING: cannot extend kernel pmap beyond %p to %p\n", |
1416 | (void *)VM_MAX_KERNEL_ADDRESS, (void *)maxkvaddr); | | 1416 | (void *)VM_MAX_KERNEL_ADDRESS, (void *)maxkvaddr); |
1417 | return (kbreak); | | 1417 | return (kbreak); |
1418 | } | | 1418 | } |
1419 | DPRINTF(PDB_GROW, ("pmap_growkernel(%lx...%lx)\n", kbreak, maxkvaddr)); | | 1419 | DPRINTF(PDB_GROW, ("pmap_growkernel(%lx...%lx)\n", kbreak, maxkvaddr)); |
1420 | /* Align with the start of a page table */ | | 1420 | /* Align with the start of a page table */ |
1421 | for (kbreak &= (-1 << PDSHIFT); kbreak < maxkvaddr; | | 1421 | for (kbreak &= ((~0ULL) << PDSHIFT); kbreak < maxkvaddr; |
1422 | kbreak += (1 << PDSHIFT)) { | | 1422 | kbreak += (1 << PDSHIFT)) { |
1423 | if (pseg_get(pm, kbreak) & TLB_V) | | 1423 | if (pseg_get(pm, kbreak) & TLB_V) |
1424 | continue; | | 1424 | continue; |
1425 | | | 1425 | |
1426 | pa = 0; | | 1426 | pa = 0; |
1427 | while (pseg_set(pm, kbreak, 0, pa) & 1) { | | 1427 | while (pseg_set(pm, kbreak, 0, pa) & 1) { |
1428 | DPRINTF(PDB_GROW, | | 1428 | DPRINTF(PDB_GROW, |
1429 | ("pmap_growkernel: extending %lx\n", kbreak)); | | 1429 | ("pmap_growkernel: extending %lx\n", kbreak)); |
1430 | pa = 0; | | 1430 | pa = 0; |
1431 | if (!pmap_get_page(&pa)) | | 1431 | if (!pmap_get_page(&pa)) |
1432 | panic("pmap_growkernel: no pages"); | | 1432 | panic("pmap_growkernel: no pages"); |
1433 | ENTER_STAT(ptpneeded); | | 1433 | ENTER_STAT(ptpneeded); |
1434 | } | | 1434 | } |