kernel: each mem slab buffer has its own section attribute
This attaches a unique section attribute for each mem slab buffer defined with K_MEM_SLAB_DEFINE(). This allows them to be placed as needed via linker scripts. This is useful for demand paging as developers can choose which memory slab buffer is pinned in memory. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
d92d1f162a
commit
e6f168c1bc
1 changed files with 2 additions and 1 deletions
|
@ -4812,7 +4812,8 @@ struct k_mem_slab {
|
|||
* @param slab_align Alignment of the memory slab's buffer (power of 2).
|
||||
*/
|
||||
#define K_MEM_SLAB_DEFINE(name, slab_block_size, slab_num_blocks, slab_align) \
|
||||
char __noinit __aligned(WB_UP(slab_align)) \
|
||||
char __noinit_named(k_mem_slab_buf_##name) \
|
||||
__aligned(WB_UP(slab_align)) \
|
||||
_k_mem_slab_buf_##name[(slab_num_blocks) * WB_UP(slab_block_size)]; \
|
||||
STRUCT_SECTION_ITERABLE(k_mem_slab, name) = \
|
||||
Z_MEM_SLAB_INITIALIZER(name, _k_mem_slab_buf_##name, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue