| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.79 2024/05/03 07:06:18 skrll Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.80 2024/05/06 07:18:19 skrll Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2001 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 Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
9 | * NASA Ames Research Center and by Chris G. Demetriou. | | 9 | * NASA Ames Research Center and by Chris G. Demetriou. |
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 |
| @@ -57,27 +57,27 @@ | | | @@ -57,27 +57,27 @@ |
57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 57 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 58 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 59 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 60 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 61 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 62 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
63 | * SUCH DAMAGE. | | 63 | * SUCH DAMAGE. |
64 | * | | 64 | * |
65 | * @(#)pmap.c 8.4 (Berkeley) 1/26/94 | | 65 | * @(#)pmap.c 8.4 (Berkeley) 1/26/94 |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | | | 69 | |
70 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.79 2024/05/03 07:06:18 skrll Exp $"); | | 70 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.80 2024/05/06 07:18:19 skrll Exp $"); |
71 | | | 71 | |
72 | /* | | 72 | /* |
73 | * Manages physical address maps. | | 73 | * Manages physical address maps. |
74 | * | | 74 | * |
75 | * In addition to hardware address maps, this | | 75 | * In addition to hardware address maps, this |
76 | * module is called upon to provide software-use-only | | 76 | * module is called upon to provide software-use-only |
77 | * maps which may or may not be stored in the same | | 77 | * maps which may or may not be stored in the same |
78 | * form as hardware maps. These pseudo-maps are | | 78 | * form as hardware maps. These pseudo-maps are |
79 | * used to store intermediate results from copy | | 79 | * used to store intermediate results from copy |
80 | * operations to and from address spaces. | | 80 | * operations to and from address spaces. |
81 | * | | 81 | * |
82 | * Since the information managed by this module is | | 82 | * Since the information managed by this module is |
83 | * also stored by the logical address mapping module, | | 83 | * also stored by the logical address mapping module, |
| @@ -1820,27 +1820,27 @@ done: | | | @@ -1820,27 +1820,27 @@ done: |
1820 | /* | | 1820 | /* |
1821 | * Copy the range specified by src_addr/len | | 1821 | * Copy the range specified by src_addr/len |
1822 | * from the source map to the range dst_addr/len | | 1822 | * from the source map to the range dst_addr/len |
1823 | * in the destination map. | | 1823 | * in the destination map. |
1824 | * | | 1824 | * |
1825 | * This routine is only advisory and need not do anything. | | 1825 | * This routine is only advisory and need not do anything. |
1826 | */ | | 1826 | */ |
1827 | void | | 1827 | void |
1828 | pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vaddr_t dst_addr, vsize_t len, | | 1828 | pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vaddr_t dst_addr, vsize_t len, |
1829 | vaddr_t src_addr) | | 1829 | vaddr_t src_addr) |
1830 | { | | 1830 | { |
1831 | UVMHIST_FUNC(__func__); | | 1831 | UVMHIST_FUNC(__func__); |
1832 | UVMHIST_CALLARGS(pmaphist, "(dpm=#%jx spm=%#jx dva=%#jx sva=%#jx", | | 1832 | UVMHIST_CALLARGS(pmaphist, "(dpm=#%jx spm=%#jx dva=%#jx sva=%#jx", |
1833 | dst_pmap, src_pmap, dst_addr, src_addr); | | 1833 | (uintptr_t)dst_pmap, (uintptr_t)src_pmap, dst_addr, src_addr); |
1834 | UVMHIST_LOG(pmaphist, "... len=%#jx)", len, 0, 0, 0); | | 1834 | UVMHIST_LOG(pmaphist, "... len=%#jx)", len, 0, 0, 0); |
1835 | PMAP_COUNT(copy); | | 1835 | PMAP_COUNT(copy); |
1836 | } | | 1836 | } |
1837 | | | 1837 | |
1838 | /* | | 1838 | /* |
1839 | * pmap_clear_reference: | | 1839 | * pmap_clear_reference: |
1840 | * | | 1840 | * |
1841 | * Clear the reference bit on the specified physical page. | | 1841 | * Clear the reference bit on the specified physical page. |
1842 | */ | | 1842 | */ |
1843 | bool | | 1843 | bool |
1844 | pmap_clear_reference(struct vm_page *pg) | | 1844 | pmap_clear_reference(struct vm_page *pg) |
1845 | { | | 1845 | { |
1846 | struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg); | | 1846 | struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg); |