Skip to content

Commit 6aa71dd

Browse files
LaurentiuM1234dbaluta
authored andcommitted
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 <laurentiu.mihalcea@nxp.com>
1 parent 9483c19 commit 6aa71dd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

zephyr/lib/alloc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ __section(".heap_mem") static uint8_t __aligned(PLATFORM_DCACHE_ALIGN) heapmem[H
8181
#define HEAPMEM_SIZE (256 * 1024)
8282
char __aligned(8) heapmem[HEAPMEM_SIZE];
8383

84+
#elif defined(CONFIG_ARM64)
85+
/* for ARM64 the heap is placed inside the .bss section.
86+
*
87+
* This is because we want to avoid introducing new sections in
88+
* the arm64 linker script. Also, is there really a need to place
89+
* it inside a special section?
90+
*
91+
* i.MX93 is the only ARM64-based platform so defining the heap this way
92+
* for all ARM64-based platforms should be safe.
93+
*/
94+
static uint8_t __aligned(PLATFORM_DCACHE_ALIGN) heapmem[HEAPMEM_SIZE];
95+
8496
#else
8597

8698
extern char _end[], _heap_sentry[];

0 commit comments

Comments
 (0)