Sound Open Firmware
Loading...
Searching...
No Matches
regions_mm.h File Reference
Include dependency graph for regions_mm.h:

Go to the source code of this file.

Data Structures

struct  vmh_block_bundle_descriptor
struct  vmh_heap_config
 This is a struct that aggregates vmh_block_bundle_descriptor to create one cfg that can be passed to heap initiation. More...

Macros

#define VIRTUAL_REGION_SHARED_HEAP_ATTR   1U /*< region for shared virtual heap */
#define VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR   2U /*< region for LLEXT libraries */
#define VIRTUAL_REGION_VPAGES_ATTR   3U /*< region for virtual page allocator */
#define MAX_MEMORY_ALLOCATORS_COUNT   10
#define DEFAULT_CONFIG_ALOCATORS_COUNT   5

Functions

struct vmh_heap * vmh_init_heap (const struct vmh_heap_config *cfg, bool allocating_continuously)
void * vmh_alloc (struct vmh_heap *heap, uint32_t alloc_size)
int vmh_free_heap (struct vmh_heap *heap)
int vmh_free (struct vmh_heap *heap, void *ptr)
void vmh_get_default_heap_config (const struct sys_mm_drv_region *region, struct vmh_heap_config *cfg)
static bool vmh_is_ptr_in_memory_range (uintptr_t ptr, uintptr_t range_start, size_t range_size)
 Checks if ptr is in range of given memory range.

Macro Definition Documentation

◆ DEFAULT_CONFIG_ALOCATORS_COUNT

#define DEFAULT_CONFIG_ALOCATORS_COUNT   5

◆ MAX_MEMORY_ALLOCATORS_COUNT

#define MAX_MEMORY_ALLOCATORS_COUNT   10

◆ VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR

#define VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR   2U /*< region for LLEXT libraries */

◆ VIRTUAL_REGION_SHARED_HEAP_ATTR

#define VIRTUAL_REGION_SHARED_HEAP_ATTR   1U /*< region for shared virtual heap */

◆ VIRTUAL_REGION_VPAGES_ATTR

#define VIRTUAL_REGION_VPAGES_ATTR   3U /*< region for virtual page allocator */

Function Documentation

◆ vmh_alloc()

void * vmh_alloc ( struct vmh_heap * heap,
uint32_t alloc_size )

◆ vmh_free()

int vmh_free ( struct vmh_heap * heap,
void * ptr )

◆ vmh_free_heap()

int vmh_free_heap ( struct vmh_heap * heap)

◆ vmh_get_default_heap_config()

void vmh_get_default_heap_config ( const struct sys_mm_drv_region * region,
struct vmh_heap_config * cfg )

◆ vmh_init_heap()

struct vmh_heap * vmh_init_heap ( const struct vmh_heap_config * cfg,
bool allocating_continuously )

◆ vmh_is_ptr_in_memory_range()

bool vmh_is_ptr_in_memory_range ( uintptr_t ptr,
uintptr_t range_start,
size_t range_size )
inlinestatic

Checks if ptr is in range of given memory range.

Parameters
ptrchecked ptr
range_startstart of checked memory range
range_sizesize of checked memory range.
Return values
falseif no overlap detected.
trueif any overlap detected.