Skip to content

Commit c56d43d

Browse files
committed
vmh: fix address categorisation
VMH doesn't occupy all the available SRAM address space, only a part of it. Use the correct address range to fix the categorisation. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent e0386e1 commit c56d43d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

zephyr/lib/alloc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ static void *virtual_heap_alloc(struct vmh_heap *heap, uint32_t flags, size_t by
301301
return mem;
302302
}
303303

304-
extern int _unused_ram_start_marker;
305-
306304
/**
307305
* Checks whether pointer is from virtual memory range.
308306
* @param ptr Pointer to memory being checked.
@@ -311,8 +309,9 @@ extern int _unused_ram_start_marker;
311309
static bool is_virtual_heap_pointer(void *ptr)
312310
{
313311
uintptr_t virtual_heap_start =
314-
POINTER_TO_UINT(sys_cache_cached_ptr_get(&_unused_ram_start_marker));
315-
uintptr_t virtual_heap_end = CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_SIZE;
312+
POINTER_TO_UINT(adsp_mm_get_unused_l2_start_aligned());
313+
uintptr_t virtual_heap_end = virtual_heap_start +
314+
CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE;
316315

317316
if (!sys_cache_is_ptr_cached(ptr))
318317
ptr = (__sparse_force void *)sys_cache_cached_ptr_get(ptr);

0 commit comments

Comments
 (0)