gram_find_free()

Find a free memory space from a guest system's RAM/ROM regions

Synopsis:

#include <qvm/gasp.h>
static uint64_t gram_find_free(struct guest_system *const gsp,
                               uint64_t const size,
                               uint64_t const align,
                               unsigned const flags)

Arguments:

gsp
A pointer to the system where we want to find the free space.
size
The number of bytes of free space that we need.
align
The requested alignment of the space.
flags
A GRAM_HINT_* combination

Library:

Provided by qvm; no external library is required.

Description:

This function calls gram_reserve() on the region it returns, so you don't need to do that.

Returns:

The location of the free space, or QSL_NO_LOCATION if no space is available.