File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 */
4545#define DEFAULT_CONFIG_ALOCATORS_COUNT 5
4646
47- /** @struct vmh_heap
48- *
49- * @brief This structure holds all information about virtual memory heap
50- * it aggregates information about its allocations and
51- * physical mappings.
52- *
53- * @var node generic list member used for list operations
54- * @var virtual_region pointer to virtual region information, it holds its
55- * attributes size and beginning ptr provided by zephyr.
56- * @var physical_blocks_allocators[] a table of block allocators
57- * each representing a virtual regions part in blocks of a given size
58- * governed by sys_mem_blocks API.
59- * @var allocation_sizes[] a table of bit arrays representing sizes of allocations
60- * made in physical_blocks_allocators directly related to physical_blocks_allocators
61- * @var core_id id of the core that heap was created on
62- * @var allocating_continuously configuration value deciding if heap allocations
63- * will be contiguous or single block.
64- */
65- struct vmh_heap {
66- struct list_item node ;
67- const struct sys_mm_drv_region * virtual_region ;
68- struct sys_mem_blocks * physical_blocks_allocators [MAX_MEMORY_ALLOCATORS_COUNT ];
69- struct sys_bitarray * allocation_sizes [MAX_MEMORY_ALLOCATORS_COUNT ];
70- int core_id ;
71- bool allocating_continuously ;
72- };
73-
7447/** @struct vmh_block_bundle_descriptor
7548 *
7649 * @brief This is a struct describing one bundle of blocks
Original file line number Diff line number Diff line change 2121#if CONFIG_VIRTUAL_HEAP
2222#include <sof/lib/regions_mm.h>
2323
24+ struct vmh_heap ;
2425struct vmh_heap * virtual_buffers_heap [CONFIG_MP_MAX_NUM_CPUS ];
2526struct k_spinlock vmh_lock ;
2627
Original file line number Diff line number Diff line change 1313/* list of vmh_heap objects created */
1414static struct list_item vmh_list = LIST_INIT (vmh_list );
1515
16+ /** @struct vmh_heap
17+ *
18+ * @brief This structure holds all information about virtual memory heap
19+ * it aggregates information about its allocations and
20+ * physical mappings.
21+ *
22+ * @var node generic list member used for list operations
23+ * @var virtual_region pointer to virtual region information, it holds its
24+ * attributes size and beginning ptr provided by zephyr.
25+ * @var physical_blocks_allocators[] a table of block allocators
26+ * each representing a virtual regions part in blocks of a given size
27+ * governed by sys_mem_blocks API.
28+ * @var allocation_sizes[] a table of bit arrays representing sizes of allocations
29+ * made in physical_blocks_allocators directly related to physical_blocks_allocators
30+ * @var core_id id of the core that heap was created on
31+ * @var allocating_continuously configuration value deciding if heap allocations
32+ * will be contiguous or single block.
33+ */
34+ struct vmh_heap {
35+ struct list_item node ;
36+ const struct sys_mm_drv_region * virtual_region ;
37+ struct sys_mem_blocks * physical_blocks_allocators [MAX_MEMORY_ALLOCATORS_COUNT ];
38+ struct sys_bitarray * allocation_sizes [MAX_MEMORY_ALLOCATORS_COUNT ];
39+ int core_id ;
40+ bool allocating_continuously ;
41+ };
42+
1643/**
1744 * @brief Initialize new heap
1845 *
Original file line number Diff line number Diff line change 1717#include <zephyr/ztest.h>
1818
1919LOG_MODULE_DECLARE (sof_boot_test , CONFIG_SOF_LOG_LEVEL );
20+ struct vmh_heap ;
2021
2122/* Test creating and freeing a virtual memory heap */
2223static void test_vmh_init_and_free_heap (int memory_region_attribute ,
You can’t perform that action at this time.
0 commit comments