gram_find_free_range()

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

Synopsis:

#include <qvm/gasp.h>
uint64_t gram_find_free_range(uint64_t size,
                              uint64_t align,
                              gram_hint_flags_t flags,
                              uint64_t range_start,
                              uint64_t range_end)

Arguments:

size
The number of bytes of free space needed.
align
The requested alignment of the space.
flags
A combination of GRAM_HINT_* flags.
range_start
The minimum allowable address for the requested memory space.
range_end
The maximum allowable address for the requested memory space.

Description:

This function finds a free memory space with the given size and alignment and within the specified range (i.e., the provided start and end addresses) from a guest system's RAM or ROM regions. The 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.

Page updated: