From 634533773a70af9484ec8b3ff4227c9d37b2e6b9 Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Mon, 10 Apr 2023 13:17:59 +0300 Subject: [PATCH] zephyr: lib: alloc.c: Add heap for ARM64 platforms This commit places the heap inside the .bss section for all ARM64 platforms. Signed-off-by: Laurentiu Mihalcea --- zephyr/lib/alloc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zephyr/lib/alloc.c b/zephyr/lib/alloc.c index 881f3d936a1d..3c41db278509 100644 --- a/zephyr/lib/alloc.c +++ b/zephyr/lib/alloc.c @@ -81,6 +81,18 @@ __section(".heap_mem") static uint8_t __aligned(PLATFORM_DCACHE_ALIGN) heapmem[H #define HEAPMEM_SIZE (256 * 1024) char __aligned(8) heapmem[HEAPMEM_SIZE]; +#elif defined(CONFIG_ARM64) +/* for ARM64 the heap is placed inside the .bss section. + * + * This is because we want to avoid introducing new sections in + * the arm64 linker script. Also, is there really a need to place + * it inside a special section? + * + * i.MX93 is the only ARM64-based platform so defining the heap this way + * for all ARM64-based platforms should be safe. + */ +static uint8_t __aligned(PLATFORM_DCACHE_ALIGN) heapmem[HEAPMEM_SIZE]; + #else extern char _end[], _heap_sentry[];