Skip to main content

Module vmm

Module vmm 

Source
Expand description

Virtual memory management (Runtime API).

Mirrors [baracuda_driver::vmm]. Workflow:

  1. Reserve a VA range: address_reserve.
  2. Create a physical allocation: MemHandle::new.
  3. Map the allocation onto the VA range: map.
  4. Set access rights: set_access.
  5. Use the pointer like any other device buffer.
  6. unmap, drop the MemHandle, address_free.

Structs§

MemHandle
A physical VMM allocation handle. Drop releases it.

Functions§

address_free
Release a reserved VA range.
address_reserve
Reserve a contiguous virtual-address range. Returns a device pointer.
allocation_granularity
Minimum allocation size and VA-alignment granularity for prop. option: 0 = minimum, 1 = recommended.
device_alloc_prop
Build the allocation-properties struct for a fresh device-backed VMM allocation.
get_access
Query access flags for device at ptr.
map
Map the physical allocation handle onto [ptr + offset, ptr + offset + size).
set_access
Grant the given access rights to a device for a mapped region.
unmap
Unmap [ptr, ptr + size).