From d92d1f162af3ba24963f1026fc0a304f1a44d1f3 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 19 Jul 2021 14:09:25 -0700 Subject: [PATCH] kernel: each kheap buffer has its own section attribute This attaches a unique section attribute for each kheap buffer defined with K_HEAP_DEFINE(). This allows them to be placed as needed via linker scripts. This is useful for demand paging as developers can choose which can be pinned in memory. Signed-off-by: Daniel Leung --- include/kernel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/kernel.h b/include/kernel.h index 7183feef103..57e885503d0 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -5037,7 +5037,8 @@ void k_heap_free(struct k_heap *h, void *mem); * @param bytes Size of memory region, in bytes */ #define K_HEAP_DEFINE(name, bytes) \ - char __aligned(8) /* CHUNK_UNIT */ \ + char __noinit_named(kheap_buf_##name) \ + __aligned(8) /* CHUNK_UNIT */ \ kheap_##name[MAX(bytes, Z_HEAP_MIN_SIZE)]; \ STRUCT_SECTION_ITERABLE(k_heap, name) = { \ .heap = { \