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 <daniel.leung@intel.com>
This commit is contained in:
parent
99290f7fef
commit
d92d1f162a
1 changed files with 2 additions and 1 deletions
|
@ -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 = { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue