Skip to content

Commit c1e2146

Browse files
committed
pmap_kextract(9): some additions
Mainly, provide a little more detail on the caller's responsibilities. Suggested by: kib, jhb Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42458
1 parent 8d6c074 commit c1e2146

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

share/man/man9/pmap_kextract.9

+15-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,21 @@ The
3131
function retrieves the underlying physical memory address corresponding to the
3232
given kernel virtual address
3333
.Fa va .
34-
The value of
34+
The caller is responsible for ensuring that
3535
.Fa va
36-
must belong to a valid mapping in the kernel address space.
36+
belongs to a valid mapping in the kernel address space.
37+
The returned physical address is only meaningful as long as the mapping remains
38+
stable, so the caller must also have some knowledge or guarantee of the
39+
mapping's lifetime.
40+
For example, it is invalid to call
41+
.Fn pmap_kextract
42+
with the address of a malloc'd object while there is a possibility for that
43+
object to be freed concurrently.
44+
.Pp
45+
Unlike
46+
.Xr pmap_extract 9 ,
47+
.Fn pmap_kextract
48+
is safe to be called from any context; it has no internal locking or sleep.
3749
.Pp
3850
.Fn vtophys
3951
is an alias for
@@ -42,7 +54,7 @@ and behaves identically.
4254
.Sh RETURN VALUES
4355
The
4456
.Fn pmap_kextract
45-
function returns the address of physical memory mapped at the kernel
57+
function returns the physical address of memory mapped at the kernel
4658
virtual address
4759
.Fa va .
4860
.Pp

0 commit comments

Comments
 (0)