gram_find_free_range()

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

Synopsis:

#include <qvm/gasp.h>
uint64_t gram_find_free_range(struct guest_system *gsp,
                              uint64_t size,
                              uint64_t align,
                              unsigned flags,
                              uint64_t range_start,
                              uint64_t range_end)

Arguments:

gsp
A pointer to the guest system where we want to find the free space.
size
The number of bytes needed for the space.
align
The requested alignment of the space.
flags
A GRAM_HINT_* combination.
range_start
The minimum allowable address for the requested memory space.
range_end
The maximum allowable address for the requested memory space.

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 address of the free space, or QSL_NO_LOCATION if no space is available.