next up previous contents index
Next: 16.8.2 amm_allocate: Allocate an Up: 16.8 API reference Previous: 16.8 API reference

16.8.1 amm_alloc_func: Allocate an AMM map entry (user-provided callout)

 

SYNOPSIS

#include <oskit/amm.h>

amm_entry_t *amm_alloc_func(amm_t *amm, oskit_addr_t addr, oskit_size_t size, int flags);

DESCRIPTION

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.

PARAMETERS

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

Returns a pointer to the uninitialized, AMM-private part of the allocated entry, or zero if no memory can be allocated.

RELATED INFORMATION

amm_init_gen



University of Utah Flux Research Group