2 .\" Copyright (c) 2015 Jason A. Harmening <jah@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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
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
29 .Dt PMAP_QUICK_ENTER_PAGE 9
32 .Nm pmap_quick_enter_page ,
33 .Nm pmap_quick_remove_page
34 .Nd manage fast, single-page kernel address space mappings
40 .Fn pmap_quick_enter_page "vm_page_t m"
42 .Fn pmap_quick_remove_page "vm_offset_t kva"
45 .Fn pmap_quick_enter_page
46 function accepts a single page
48 and enters this page into a preallocated address in kernel virtual
50 This function is intended for temporary mappings that will only
51 be used for a very short period, for example a copy operation on
55 .Fn pmap_quick_remove_page
56 function removes a mapping previously created by
57 .Fn pmap_quick_enter_page
60 making the KVA frame used by
61 .Fn pmap_quick_enter_page
64 On many architectures,
65 .Fn pmap_quick_enter_page
66 uses a per-CPU pageframe.
67 In those cases, it must disable preemption on the local CPU.
68 The corresponding call to
69 .Fn pmap_quick_remove_page
70 then re-enables preemption.
71 It is therefore not safe for machine-independent code to sleep
72 or perform locking operations while holding these mappings.
73 Current implementations only guarantee the availability of a single
74 page for the calling thread, so calls to
75 .Fn pmap_quick_enter_page
78 .Fn pmap_quick_enter_page
80 .Fn pmap_quick_remove_page
82 .Fn pmap_quick_enter_page
83 always returns a valid address.
84 It is safe to use these functions under all types of locks except spin mutexes.
85 It is also safe to use them in all thread contexts except primary interrupt
90 not be swapped or otherwise reused while the mapping is active.
91 It must be either wired or held, or it must belong to an unmanaged
92 region such as I/O device memory.
95 .Fn pmap_quick_enter_page
96 function returns the kernel virtual address
97 that is mapped to the page
102 This manual page was written by
103 .An Jason A Harmening Aq Mt jah@FreeBSD.org .