8#ifndef ZEPHYR_LIB_REGIONS_MM_H_
9#define ZEPHYR_LIB_REGIONS_MM_H_
11#include <adsp_memory.h>
12#include <adsp_memory_regions.h>
13#include <ipc/topology.h>
16#include <zephyr/drivers/mm/system_mm.h>
17#include <zephyr/init.h>
18#include <zephyr/sys/mem_blocks.h>
21#define VIRTUAL_REGION_SHARED_HEAP_ATTR 1U
22#define VIRTUAL_REGION_LLEXT_LIBRARIES_ATTR 2U
23#define VIRTUAL_REGION_VPAGES_ATTR 3U
44#define MAX_MEMORY_ALLOCATORS_COUNT 10
50#define DEFAULT_CONFIG_ALOCATORS_COUNT 5
76void *
vmh_alloc(
struct vmh_heap *heap, uint32_t alloc_size);
81#ifdef CONFIG_SYS_MEM_BLOCKS_RUNTIME_STATS
82void vmh_log_stats(
struct vmh_heap *heap);
97 return ptr >= range_start && ptr < range_start + range_size;
#define MAX_MEMORY_ALLOCATORS_COUNT
Definition regions_mm.h:44
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.
Definition regions_mm.h:94
void vmh_get_default_heap_config(const struct sys_mm_drv_region *region, struct vmh_heap_config *cfg)
int vmh_free_heap(struct vmh_heap *heap)
void * vmh_alloc(struct vmh_heap *heap, uint32_t alloc_size)
struct vmh_heap * vmh_init_heap(const struct vmh_heap_config *cfg, bool allocating_continuously)
int vmh_free(struct vmh_heap *heap, void *ptr)
Definition regions_mm.h:52
size_t number_of_blocks
number of memory blocks.
Definition regions_mm.h:54
size_t block_size
size of memory block.
Definition regions_mm.h:53
This is a struct that aggregates vmh_block_bundle_descriptor to create one cfg that can be passed to ...
Definition regions_mm.h:71
struct vmh_block_bundle_descriptor block_bundles_table[MAX_MEMORY_ALLOCATORS_COUNT]
Definition regions_mm.h:72