| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.74 2011/11/27 21:33:19 reinoud Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.75 2011/12/13 11:11:03 reinoud Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2011 Reinoud Zandijk <reinoud@NetBSD.org> | | 4 | * Copyright (c) 2011 Reinoud Zandijk <reinoud@NetBSD.org> |
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. |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
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 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.74 2011/11/27 21:33:19 reinoud Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.75 2011/12/13 11:11:03 reinoud Exp $"); |
31 | | | 31 | |
32 | #include "opt_memsize.h" | | 32 | #include "opt_memsize.h" |
33 | #include "opt_kmempages.h" | | 33 | #include "opt_kmempages.h" |
34 | | | 34 | |
35 | #include <sys/types.h> | | 35 | #include <sys/types.h> |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/mutex.h> | | 37 | #include <sys/mutex.h> |
38 | #include <sys/buf.h> | | 38 | #include <sys/buf.h> |
39 | #include <sys/malloc.h> | | 39 | #include <sys/malloc.h> |
40 | #include <sys/pool.h> | | 40 | #include <sys/pool.h> |
41 | #include <machine/thunk.h> | | 41 | #include <machine/thunk.h> |
42 | | | 42 | |
43 | #include <uvm/uvm.h> | | 43 | #include <uvm/uvm.h> |
| @@ -509,27 +509,27 @@ pmap_fault(pmap_t pmap, vaddr_t va, vm_p | | | @@ -509,27 +509,27 @@ pmap_fault(pmap_t pmap, vaddr_t va, vm_p |
509 | /* determine physical address and lookup 'root' pv_entry */ | | 509 | /* determine physical address and lookup 'root' pv_entry */ |
510 | ppn = pv->pv_ppn; | | 510 | ppn = pv->pv_ppn; |
511 | ppv = &pv_table[ppn]; | | 511 | ppv = &pv_table[ppn]; |
512 | | | 512 | |
513 | /* if unmanaged we just make sure it is there! */ | | 513 | /* if unmanaged we just make sure it is there! */ |
514 | if (ppv->pv_vflags & PV_UNMANAGED) { | | 514 | if (ppv->pv_vflags & PV_UNMANAGED) { |
515 | printf("%s: oops warning unmanaged page %"PRIiPTR" faulted\n", | | 515 | printf("%s: oops warning unmanaged page %"PRIiPTR" faulted\n", |
516 | __func__, ppn); | | 516 | __func__, ppn); |
517 | /* atype not set */ | | 517 | /* atype not set */ |
518 | pmap_page_activate(pv); | | 518 | pmap_page_activate(pv); |
519 | return true; | | 519 | return true; |
520 | } | | 520 | } |
521 | | | 521 | |
522 | /* if its not mapped in, we have a TBL fault */ | | 522 | /* if its not mapped in, we have a TLB fault */ |
523 | if ((pv->pv_vflags & PV_MAPPEDIN) == 0) { | | 523 | if ((pv->pv_vflags & PV_MAPPEDIN) == 0) { |
524 | if (pv->pv_mmap_ppl != THUNK_PROT_NONE) { | | 524 | if (pv->pv_mmap_ppl != THUNK_PROT_NONE) { |
525 | dprintf_debug("%s: tlb fault page lpn %"PRIiPTR"\n", | | 525 | dprintf_debug("%s: tlb fault page lpn %"PRIiPTR"\n", |
526 | __func__, pv->pv_lpn); | | 526 | __func__, pv->pv_lpn); |
527 | pmap_page_activate(pv); | | 527 | pmap_page_activate(pv); |
528 | return true; | | 528 | return true; |
529 | } | | 529 | } |
530 | } | | 530 | } |
531 | | | 531 | |
532 | /* determine pmap access type (mmap doesnt need to be 1:1 on VM_PROT_) */ | | 532 | /* determine pmap access type (mmap doesnt need to be 1:1 on VM_PROT_) */ |
533 | prot = pv->pv_prot; | | 533 | prot = pv->pv_prot; |
534 | cur_prot = VM_PROT_NONE; | | 534 | cur_prot = VM_PROT_NONE; |
535 | if (pv->pv_mmap_ppl & THUNK_PROT_READ) | | 535 | if (pv->pv_mmap_ppl & THUNK_PROT_READ) |