class VmarReservation

Defined at line 32 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 34 of file ../../sdk/lib/ld/include/lib/ld/vmar.h

void VmarReservation (VmarReservation && )

Defined at line 35 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 39 of file ../../sdk/lib/ld/include/lib/ld/vmar.h

void ~VmarReservation ()

Defined at line 49 of file ../../sdk/lib/ld/include/lib/ld/vmar.h

zx::result<> Init (zx::unowned_vmar parent, zx_info_vmar_t parent_info, zx_info_vmar_t reserve_info)

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 58 of file ../../sdk/lib/ld/include/lib/ld/vmar.h

const zx::vmar & vmar ()

Defined at line 66 of file ../../sdk/lib/ld/include/lib/ld/vmar.h

bool operator bool ()

Defined at line 68 of file ../../sdk/lib/ld/include/lib/ld/vmar.h