#include <oskit/amm.h>int amm_modify(amm_t *amm, oskit_addr_t addr, oskit_size_t size, int flags, amm_entry_t *entry);
Creates a new map entry in amm describing the range [addr - addr+size-1] with the attributes indicated in flags.Any existing map entries wholly within the range are deleted, any that partly overlap the range are split as necessary. After adding the new entry, the AMM may attempt to join it with adjacent already-existing entries if the flag words are compatible.
If entry is zero, a standard amm_entry_t structure is allocated for the new range. If entry is non-zero, the caller must have already allocated and initialized any extra attribute data in the extended entry. In either case, the AMM will initialize the private part of the new entry, including setting its attribute flags to flags.
- amm
- A pointer to the amm_t structure representing the address map.
- addr
- Start address of the range being modified.
- size
- Size of the range being modified.
- flags
- New attributes for the range being modified.
- entry
- If non-zero, the entry structure to use in the map.
Returns zero if the modification was successful, non-zero if an entry split failed.
amm_alloc_func, amm_free_func, amm_join_func, amm_split_func