Updated: October 28, 2024 |
Map a guest-physical address range into the qvm process address space for virtual hardware access
#include <qvm/gasp.h>
void* gasp_map_vdma(const vdev_t *vdev, int prot, uint64_t guest_paddr, size_t length)
Use this function to map a guest-physical address range into the qvm process (guest-physical) address space to provide virtual hardware access for vdevs that will make DMA-like transactions. Use this function if your vdev argument is not NULL. If your vdev argument is NULL, use gasp_map_sys().
If you need to obtain information about the host-physical addresses, use gasp_map_contig().
The above are guidelines, and your design may require that you use the function not recommended here. If you don't follow the guidelines, though, be sure that you can justify your decision, and understand the implications of not following them.
Call gasp_unmap() to unmap the address range.
A qvm process pointer that maps the guest-physical address range, or NULL if unsuccessful.