#include <oskit/amm.h>int amm_allocate(amm_t *amm, [in/out] oskit_addr_t *addrp, oskit_size_t size, int prot);
Looks for a range of the indicated size with flags AMM_FREE and modifies it to have the attributes AMM_ALLOCATED|prot.On call, *addrp specifies a hint address at which to start searching for a range of the desired size. The search will progress toward higher addresses from that point. If no range is found before the maximum possible address the search ``wraps around,'' starting from the lowest address and searching forward until it reaches the original hint address. If no free range of sufficient size is found, ENOMEM is returned.
Amm_allocate is a simplified interface to amm_modify intended to be used with amm_init, amm_deallocate, amm_protect, and amm_reserve.
- amm
- A pointer to the amm_t structure representing the address map.
- addrp
- On call, a pointer to the address at which to start searching. On return, the address chosen.
- size
- Size of the desired range.
- prot
- Additional attribute flags to associate with the range.
Returns zero if successful, an error code otherwise.
amm_deallocate, amm_init, amm_modify, amm_protect, amm_reserve