memory manager: add region calculation for virtual memory

Add region calculations and implementation of
sys_mm_drv_query_memory_regions to pass calculated regions down
the line.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
This commit is contained in:
Jakub Dabek 2022-11-28 19:07:01 +01:00 committed by Anas Nashif
commit 72f626046d
5 changed files with 105 additions and 3 deletions

View file

@ -589,6 +589,10 @@ static int sys_mm_drv_mm_init(const struct device *dev)
L2_PHYS_SRAM_REGION.num_blocks = avalible_memory_size / CONFIG_MM_DRV_PAGE_SIZE;
ret = calculate_memory_regions(UNUSED_L2_START_ALIGNED);
CHECKIF(ret != 0) {
return ret;
}
/*
* Initialize memblocks that will store physical
* page usage. Initially all physical pages are
@ -619,6 +623,7 @@ static int sys_mm_drv_mm_init(const struct device *dev)
*/
if (L2_SRAM_BASE + L2_SRAM_SIZE < UNUSED_L2_START_ALIGNED ||
L2_SRAM_BASE > UNUSED_L2_START_ALIGNED) {
__ASSERT(false,
"unused l2 pointer is outside of l2 sram range %p\n",
UNUSED_L2_START_ALIGNED);