#include <oskit/amm.h>amm_entry_t *amm_alloc_func(amm_t *amm, oskit_addr_t addr, oskit_size_t size, int flags);
User-provided function called whenever an AMM entry needs to be allocated in the given map amm. The allocation function for an AMM is set at initialization time by passing a pointer to it as a parameter to amm_init_gen.The parameters to amm_alloc_func provide information about the entry being created; i.e., the entry will cover the range [addr - addr+size-1] and have the attributes specified in flags.
If the map is using extended map entries, this routine should initialize the extended portion of the entry. No initialization of the AMM-private portion is necessary.
- amm
- A pointer to the amm_t structure representing the address map.
- addr
- Start address of the range being created.
- size
- Size of the range being created.
- flags
- Attributes of the range being created.
Returns a pointer to the uninitialized, AMM-private part of the allocated entry, or zero if no memory can be allocated.
amm_init_gen