| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Matthew Fredette. | | 8 | * by Matthew Fredette. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -55,27 +55,27 @@ | | | @@ -55,27 +55,27 @@ |
55 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | | 55 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
56 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | | 56 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
57 | * THE POSSIBILITY OF SUCH DAMAGE. | | 57 | * THE POSSIBILITY OF SUCH DAMAGE. |
58 | */ | | 58 | */ |
59 | /* | | 59 | /* |
60 | * References: | | 60 | * References: |
61 | * 1. PA7100LC ERS, Hewlett-Packard, March 30 1999, Public version 1.0 | | 61 | * 1. PA7100LC ERS, Hewlett-Packard, March 30 1999, Public version 1.0 |
62 | * 2. PA7300LC ERS, Hewlett-Packard, March 18 1996, Version 1.0 | | 62 | * 2. PA7300LC ERS, Hewlett-Packard, March 18 1996, Version 1.0 |
63 | * 3. PA-RISC 1.1 Architecture and Instruction Set Reference Manual, | | 63 | * 3. PA-RISC 1.1 Architecture and Instruction Set Reference Manual, |
64 | * Hewlett-Packard, February 1994, Third Edition | | 64 | * Hewlett-Packard, February 1994, Third Edition |
65 | */ | | 65 | */ |
66 | | | 66 | |
67 | #include <sys/cdefs.h> | | 67 | #include <sys/cdefs.h> |
68 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.84 2011/12/23 16:35:00 skrll Exp $"); | | 68 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.85 2011/12/23 16:38:50 skrll Exp $"); |
69 | | | 69 | |
70 | #include "opt_cputype.h" | | 70 | #include "opt_cputype.h" |
71 | | | 71 | |
72 | #include <sys/param.h> | | 72 | #include <sys/param.h> |
73 | #include <sys/systm.h> | | 73 | #include <sys/systm.h> |
74 | #include <sys/malloc.h> | | 74 | #include <sys/malloc.h> |
75 | #include <sys/proc.h> | | 75 | #include <sys/proc.h> |
76 | #include <sys/mutex.h> | | 76 | #include <sys/mutex.h> |
77 | | | 77 | |
78 | #include <uvm/uvm.h> | | 78 | #include <uvm/uvm.h> |
79 | | | 79 | |
80 | #include <machine/reg.h> | | 80 | #include <machine/reg.h> |
81 | #include <machine/psl.h> | | 81 | #include <machine/psl.h> |
| @@ -1586,27 +1586,26 @@ pmap_activate(struct lwp *l) | | | @@ -1586,27 +1586,26 @@ pmap_activate(struct lwp *l) |
1586 | if (p == curproc) | | 1586 | if (p == curproc) |
1587 | mtctl(pmap->pm_pid, CR_PIDR2); | | 1587 | mtctl(pmap->pm_pid, CR_PIDR2); |
1588 | } | | 1588 | } |
1589 | | | 1589 | |
1590 | void | | 1590 | void |
1591 | pmap_procwr(struct proc *p, vaddr_t va, size_t len) | | 1591 | pmap_procwr(struct proc *p, vaddr_t va, size_t len) |
1592 | { | | 1592 | { |
1593 | pmap_t pmap = p->p_vmspace->vm_map.pmap; | | 1593 | pmap_t pmap = p->p_vmspace->vm_map.pmap; |
1594 | | | 1594 | |
1595 | fdcache(pmap->pm_space, va, len); | | 1595 | fdcache(pmap->pm_space, va, len); |
1596 | sync_caches(); | | 1596 | sync_caches(); |
1597 | ficache(pmap->pm_space, va, len); | | 1597 | ficache(pmap->pm_space, va, len); |
1598 | sync_caches(); | | 1598 | sync_caches(); |
1599 | | | | |
1600 | } | | 1599 | } |
1601 | | | 1600 | |
1602 | static inline void | | 1601 | static inline void |
1603 | pmap_flush_page(struct vm_page *pg, bool purge) | | 1602 | pmap_flush_page(struct vm_page *pg, bool purge) |
1604 | { | | 1603 | { |
1605 | struct vm_page_md * const md = VM_PAGE_TO_MD(pg); | | 1604 | struct vm_page_md * const md = VM_PAGE_TO_MD(pg); |
1606 | struct pv_entry *pve; | | 1605 | struct pv_entry *pve; |
1607 | | | 1606 | |
1608 | DPRINTF(PDB_FOLLOW|PDB_CACHE, ("%s(%p, %d)\n", __func__, pg, purge)); | | 1607 | DPRINTF(PDB_FOLLOW|PDB_CACHE, ("%s(%p, %d)\n", __func__, pg, purge)); |
1609 | | | 1608 | |
1610 | /* purge cache for all possible mappings for the pa */ | | 1609 | /* purge cache for all possible mappings for the pa */ |
1611 | for (pve = md->pvh_list; pve; pve = pve->pv_next) { | | 1610 | for (pve = md->pvh_list; pve; pve = pve->pv_next) { |
1612 | vaddr_t va = pve->pv_va & PV_VAMASK; | | 1611 | vaddr_t va = pve->pv_va & PV_VAMASK; |