#include <oskit/amm.h>void amm_init(amm_t *amm, oskit_addr_t lo, oskit_addr_t hi);
This function initializes an address map as it would be used in most ``simple'' applications. The caller must provide a pointer to an amm_t structure; the AMM system uses this structure to keep track of the state of the address map. In subsequent AMM operations, the caller must pass a pointer to the same amm_t structure, which acts as a handle for the address map.The address range [lo - hi-1] forms the valid area of the map. A single map entry is created for that range with attribute AMM_FREE so that all addresses within the range are eligible for allocation with amm_allocate. If necessary, entries are created for the ranges [AMM_MINADDR - lo-1] and [hi - AMM_MAXADDR] with attribute AMM_RESERVED so that addresses within those ranges are ignored by other simple interface routines.
Amm_Init is a simplified interface to amm_init_gen intended to be used with amm_allocate, amm_deallocate, amm_protect and amm_reserve.
- amm
- A pointer to an uninitialized structure of type amm_t which is to be used to represent the address map.
- lo
- The first address to be marked AMM_FREE.
- hi
- The last address + 1 to be marked AMM_FREE.
amm_allocate, amm_deallocate, amm_modify, amm_protect, amm_reserve