class VmarReservation
Defined at line 33 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
Helper class to manage a VMAR reservation handle with strict ownership and RAII cleanup.
Example usage:
zx_info_vmar_t info;
parent_vmar->get_info(ZX_INFO_VMAR,
&info
, sizeof(info), nullptr, nullptr);
ld::VmarReservation reservation;
// reserve_info specifies the bounds of the reservation VMAR.
if (auto res = reservation.Init(parent_vmar, info, reserve_info);
res.is_error()) {
return res;
}
// The reservation VMAR is cleanly destroyed automatically when reservation goes out of scope.
Public Methods
void VmarReservation ()
Defined at line 35 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
void VmarReservation (VmarReservation && )
Defined at line 36 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
VmarReservation & operator= (VmarReservation && other)
If we would take ownership of another vmar while this one has a valid vmar, we must explicitly
destroy it since the normal dtor of a zx::vmar won't destroy it.
Defined at line 40 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
void ~VmarReservation ()
Defined at line 50 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
zx::result<> Init (zx::unowned_vmarparent,zx_info_vmar_tparent_info,zx_info_vmar_treserve_info,zx_vm_option_tallocate_flags)
Initialize the reservation by allocating a child VMAR in the parent
covering the specified bounds. The offset is computed from the absolute
bases of the parent and the requested child VMAR.
Defined at line 59 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
const zx::vmar & vmar ()
Defined at line 72 of file ../../sdk/lib/ld/include/lib/ld/vmar.h
bool operator bool ()
Defined at line 74 of file ../../sdk/lib/ld/include/lib/ld/vmar.h