zephyr: align non-cached allocs to PLATFORM_DCACHE_ALIGN

The XTOS allocator aligns non-cachec allocations to the platform
cacheline size. Test results indicate some SOF application code
relies on this behaviour, so align Zephyr's rmalloc implementation
to match the behaviour.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2021-10-11 17:37:08 +03:00 committed by Liam Girdwood
parent 9567c97fb3
commit ba4406e2b7
1 changed files with 5 additions and 1 deletions

View File

@ -184,7 +184,11 @@ void *rmalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes)
if (zone_is_cached(zone))
return heap_alloc_aligned_cached(&sof_heap, 0, bytes);
return heap_alloc_aligned(&sof_heap, 8, bytes);
/*
* XTOS alloc implementation has used dcache alignment,
* so SOF application code is expecting this behaviour.
*/
return heap_alloc_aligned(&sof_heap, PLATFORM_DCACHE_ALIGN, bytes);
}
/* Use SOF_MEM_ZONE_BUFFER at the moment */