lib: mem_block: move to own folder

Move mem_block into own folder and seperate from lib/os and heap
configuration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-11-18 04:24:45 -05:00
parent 740d0c3b50
commit d4c881da04
8 changed files with 60 additions and 50 deletions

View file

@ -11,6 +11,7 @@ endif()
add_subdirectory_ifdef(CONFIG_CPP cpp)
add_subdirectory(hash)
add_subdirectory(heap)
add_subdirectory(mem_blocks)
add_subdirectory(os)
add_subdirectory_ifdef(CONFIG_SMF smf)
add_subdirectory_ifdef(CONFIG_OPENAMP open-amp)

View file

@ -13,6 +13,8 @@ source "lib/hash/Kconfig"
source "lib/heap/Kconfig"
source "lib/mem_blocks/Kconfig"
source "lib/os/Kconfig"
source "lib/posix/Kconfig"

View file

@ -132,51 +132,4 @@ config SHARED_MULTI_HEAP
different capabilities / attributes (cacheable, non-cacheable,
etc...) defined in the DT.
config SYS_MEM_BLOCKS
bool "(Yet Another) Memory Blocks Allocator"
help
This enables support for memory block allocator where:
() All memory blocks have a single fixed size.
() Multiple blocks can be allocated or freed at the same time.
() A group of blocks allocated together may not be contiguous.
This is useful for operations such as scatter-gather DMA
transfers.
() Bookkeeping of allocated blocks is done outside of
the associated buffer (unlike memory slab). This allows
the buffer to reside in memory regions where these can be
powered down to conserve energy.
config SYS_MEM_BLOCKS_LISTENER
bool "Memory Blocks Allocator event notifications"
depends on SYS_MEM_BLOCKS
select HEAP_LISTENER
help
This allows application to listen for memory blocks allocator
events, such as memory allocation and de-allocation.
config SYS_MEM_BLOCKS_RUNTIME_STATS
bool "Memory blocks runtime statistics"
depends on SYS_MEM_BLOCKS
help
This option enables the tracking and reporting of the memory
blocks statistics related to the current and maximum number
of allocations in a given memory block.
config OBJ_CORE_SYS_MEM_BLOCKS
bool "Kernel object for memory blocks"
depends on SYS_MEM_BLOCKS && OBJ_CORE
default y if SYS_MEM_BLOCKS && OBJ_CORE
help
This option allows object cores to be integrated into memory block
objects.
config OBJ_CORE_STATS_SYS_MEM_BLOCKS
bool "Object core statistics for memory blocks"
depends on SYS_MEM_BLOCKS && OBJ_CORE_STATS
default y if SYS_MEM_BLOCKS && OBJ_CORE_STATS
select SYS_MEM_BLOCKS_RUNTIME_STATS
help
This option integrates the object core statistics framework into
the memory blocks.
endmenu

View file

@ -0,0 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(CONFIG_SYS_MEM_BLOCKS mem_blocks.c)

54
lib/mem_blocks/Kconfig Normal file
View file

@ -0,0 +1,54 @@
# Copyright (c) 2021,2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
menu "Memory Blocks"
config SYS_MEM_BLOCKS
bool "(Yet Another) Memory Blocks Allocator"
help
This enables support for memory block allocator where:
() All memory blocks have a single fixed size.
() Multiple blocks can be allocated or freed at the same time.
() A group of blocks allocated together may not be contiguous.
This is useful for operations such as scatter-gather DMA
transfers.
() Bookkeeping of allocated blocks is done outside of
the associated buffer (unlike memory slab). This allows
the buffer to reside in memory regions where these can be
powered down to conserve energy.
config SYS_MEM_BLOCKS_LISTENER
bool "Memory Blocks Allocator event notifications"
depends on SYS_MEM_BLOCKS
select HEAP_LISTENER
help
This allows application to listen for memory blocks allocator
events, such as memory allocation and de-allocation.
config SYS_MEM_BLOCKS_RUNTIME_STATS
bool "Memory blocks runtime statistics"
depends on SYS_MEM_BLOCKS
help
This option enables the tracking and reporting of the memory
blocks statistics related to the current and maximum number
of allocations in a given memory block.
config OBJ_CORE_SYS_MEM_BLOCKS
bool "Kernel object for memory blocks"
depends on SYS_MEM_BLOCKS && OBJ_CORE
default y if SYS_MEM_BLOCKS && OBJ_CORE
help
This option allows object cores to be integrated into memory block
objects.
config OBJ_CORE_STATS_SYS_MEM_BLOCKS
bool "Object core statistics for memory blocks"
depends on SYS_MEM_BLOCKS && OBJ_CORE_STATS
default y if SYS_MEM_BLOCKS && OBJ_CORE_STATS
select SYS_MEM_BLOCKS_RUNTIME_STATS
help
This option integrates the object core statistics framework into
the memory blocks.
endmenu

View file

@ -49,8 +49,6 @@ zephyr_sources_ifdef(CONFIG_REBOOT reboot.c)
zephyr_sources_ifdef(CONFIG_UTF8 utf8.c)
zephyr_sources_ifdef(CONFIG_SYS_MEM_BLOCKS mem_blocks.c)
zephyr_sources_ifdef(CONFIG_WINSTREAM winstream.c)
zephyr_sources_ifdef(CONFIG_POWEROFF poweroff.c)

View file

@ -169,5 +169,4 @@ config UTF8
rsource "Kconfig.cbprintf"
endmenu