summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-01-30 19:58:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-01-30 19:59:18 +0100
commit0f9822d2ab9881ebb601b25ab3f381bbb6197b05 (patch)
tree23c0dd493b6ac33b17032b416e5b3a76c605940b /doc
parent366954d50be00d085d44a8c461a80f2d0b663224 (diff)
Add vm_pages_phys
For rumpdisk to efficiently determine the physical address, both for checking whether it is below 4GiB, and for giving it to the disk driver, we need a gnumach primitive (and that is not conditioned by MACH_VM_DEBUG like mach_vm_region_info and mach_vm_object_pages_phys are).
Diffstat (limited to 'doc')
-rw-r--r--doc/mach.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/mach.texi b/doc/mach.texi
index 76bf68f7..f35fc6bb 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -3010,6 +3010,7 @@ the kernel.
* Memory Attributes:: Tweaking memory regions.
* Mapping Memory Objects:: How to map memory objects.
* Memory Statistics:: How to get statistics about memory usage.
+* Memory physical addresses:: How to get physical addresses of memory.
@end menu
@node Memory Allocation
@@ -3514,6 +3515,22 @@ constant for the life of the task.
@end deftypefun
+@node Memory physical addresses
+@section Memory physical addresses
+
+@deftypefun kern_return_t vm_pages_phys (@w{host_t @var{host}}, @w{vm_task_t @var{target_task}}, @w{vm_address_t @var{address}}, @w{vm_size_t @var{size}}, @w{rpc_phys_addr_array_t *@var{pages}, @w{mach_msg_type_number_t *@var{pagesCnt}}})
+The function @code{vm_pages_phys} retrieves the physical addresses of the
+specified region (@var{size} bytes starting from @var{address}) of
+@var{target_task}'s virtual address space.
+
+Both @var{address} and @var{size} have to be aligned on @code{vm_page_size}.
+
+@var{pages} is an array of @code{rpc_phys_addr_array_t} that is supplied by the
+caller and returned filled with the physical page numbers. @var{pagesCnt} is
+supplied as the maximum number of elements in the @var{pages} array. On
+return, it contains the actual number of integers in @var{pages}.
+
+
@node External Memory Management
@chapter External Memory Management