Areas: Addressable Physical Memories

group aml_area

Area High-Level API.

AML areas represent places where data can be stored. In shared memory systems, locality is a major concern for performance. Being able to query memory from specific places is of major interest to achieve this goal. AML areas provide low-level mmap() / munmap() functions to query memory from specific places materialized as areas. Available area implementations dictate the way such places can be arranged and their properties. It is important to note that the functions provided through the Area API are low-level and are not optimized for performance as allocators are.

../_images/area.png

See also

aml_area_linux

Functions

void *aml_area_mmap(const struct aml_area *area, size_t size, struct aml_area_mmap_options *opts)

Low-level function for obtaining memory from an area.

Parameters:
  • area[in] a valid area implementing access to the target memory.

  • size[in] the usable size of memory to obtain.

  • opts[inout] opaque handle to pass additional options to the area.

Returns:

a pointer to the memory range of the requested size allocated within the area ; NULL on failure, with aml_errno set to the appropriate error code.

int aml_area_munmap(const struct aml_area *area, void *ptr, size_t size)

Release memory region obtained with aml_area_mmap().

See also

aml_area_mmap()

Parameters:
  • area[in] a valid area implementing access to the target memory.

  • ptr[inout] a pointer to the memory obtained with aml_area_mmap() using the same “area” and “size” parameters.

  • size[in] the size of the memory region pointed to by “ptr”.

Returns:

0 if successful, an error code otherwise.

int aml_area_fprintf(FILE *stream, const char *prefix, const struct aml_area *area)

Print on the file handle the metadata associated with this area.

Parameters:
  • stream[in] the stream to print on

  • prefix[in] prefix to use on all lines

  • area[in] area to print

Returns:

0 if successful, an error code otherwise.

struct aml_area_ops
#include <aml.h>

aml_area_ops is a structure containing implementations of area operations. Users may create or modify implementations by assembling appropriate operations in such a structure.

struct aml_area
#include <aml.h>

An AML area is an implementation of memory operations for several types of devices through a consistent abstraction. This abstraction is meant to be implemented for several kinds of devices, i.e., the same function calls allocate different kinds of devices depending on the area implementation provided.

Implementations