2 .\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3 .\" Copyright (c) 2014 The FreeBSD Foundation
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd insert a virtual page into a physical map
41 .Fa "pmap_t pmap" "vm_offset_t va" "vm_page_t m" "vm_prot_t prot"
42 .Fa "u_int flags" "int8_t psind"
47 function creates a mapping in the physical map
49 from the virtual address
55 Any previous mapping at the virtual address
61 argument may have the following values:
62 .Bl -tag -width ".Dv PMAP_ENTER_NOSLEEP"
64 A read access to the given virtual address triggered the call.
66 A write access to the given virtual address triggered the call.
67 .It Dv VM_PROT_EXECUTE
68 An execute access to the given virtual address triggered the call.
69 .It Dv PMAP_ENTER_WIRED
70 The mapping should be marked as wired.
71 .It Dv PMAP_ENTER_NOSLEEP
72 This function may not sleep during creation of the mapping.
73 If the mapping cannot be created without sleeping, an appropriate
74 Mach VM error is returned.
77 .Dv PMAP_ENTER_NOSLEEP
78 flag is not specified, this function must create the requested mapping
81 In order to create the requested mapping, this function may destroy
82 any non-wired mapping in any pmap.
86 parameter specifies the page size that should be used by the mapping.
87 The supported page sizes are described by the global array
89 The desired page size is specified by passing the index of the array
90 element that equals the desired page size.
94 function destroys or updates a managed mapping, including an existing
95 mapping at virtual address
99 structure corresponding to the previously mapped physical page.
100 If the physical page was accessed through the managed mapping,
106 If the physical page was modified through the managed mapping, then the
108 function is called on the
114 aflag must be set for the page
116 if the new mapping is managed and writeable.
117 It is advised to clear
119 for destroyed mappings if the implementation can ensure
120 that no other writeable managed mappings for the previously
125 is managed, the page must be busied by the caller
126 or the owning object must be locked.
127 In the later case, the
128 .Dv PMAP_ENTER_NOSLEEP
129 must be specified by the caller.
133 function must handle the multiprocessor TLB consistency for the
136 On amd64, arm and i386 architectures the existing implementation
139 function is incomplete, only value 0 for
142 Other supported architectures have
151 .Dv PMAP_ENTER_NOSLEEP
152 flag was specified and the resources required for the mapping cannot
153 be acquired without sleeping,
154 .Dv KERN_RESOURCE_SHORTAGE
159 This manual page was first written by
160 .An Bruce M Simpson Aq Mt bms@spc.org
161 and then rewritten by
162 .An Alan Cox Aq Mt alc@FreeBSD.org
164 .An Konstantin Belousov Aq Mt kib@FreeBSD.org .