diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 6fe18f63992..ceba13bc2af 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -10,6 +10,7 @@ add_subdirectory(posix) endif() add_subdirectory_ifdef(CONFIG_CPP cpp) add_subdirectory(hash) +add_subdirectory(heap) add_subdirectory(os) add_subdirectory_ifdef(CONFIG_SMF smf) add_subdirectory_ifdef(CONFIG_OPENAMP open-amp) diff --git a/lib/Kconfig b/lib/Kconfig index 97ee3f6002d..9b6eb56d275 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -11,6 +11,8 @@ menu "Additional libraries" source "lib/hash/Kconfig" +source "lib/heap/Kconfig" + source "lib/os/Kconfig" source "lib/posix/Kconfig" diff --git a/lib/heap/CMakeLists.txt b/lib/heap/CMakeLists.txt new file mode 100644 index 00000000000..bc5f30b4841 --- /dev/null +++ b/lib/heap/CMakeLists.txt @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: Apache-2.0 + +zephyr_sources( + heap.c + heap-validate.c + multi_heap.c + ) + +zephyr_sources_ifdef(CONFIG_SHARED_MULTI_HEAP shared_multi_heap.c) + +zephyr_sources_ifdef(CONFIG_HEAP_LISTENER heap_listener.c) diff --git a/lib/os/Kconfig.heap b/lib/heap/Kconfig similarity index 100% rename from lib/os/Kconfig.heap rename to lib/heap/Kconfig diff --git a/lib/os/heap-validate.c b/lib/heap/heap-validate.c similarity index 100% rename from lib/os/heap-validate.c rename to lib/heap/heap-validate.c diff --git a/lib/os/heap.c b/lib/heap/heap.c similarity index 100% rename from lib/os/heap.c rename to lib/heap/heap.c diff --git a/lib/os/heap.h b/lib/heap/heap.h similarity index 100% rename from lib/os/heap.h rename to lib/heap/heap.h diff --git a/lib/os/heap_listener.c b/lib/heap/heap_listener.c similarity index 100% rename from lib/os/heap_listener.c rename to lib/heap/heap_listener.c diff --git a/lib/os/multi_heap.c b/lib/heap/multi_heap.c similarity index 100% rename from lib/os/multi_heap.c rename to lib/heap/multi_heap.c diff --git a/lib/os/shared_multi_heap.c b/lib/heap/shared_multi_heap.c similarity index 100% rename from lib/os/shared_multi_heap.c rename to lib/heap/shared_multi_heap.c diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index 4f082716c48..4f403c2a289 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -15,10 +15,7 @@ zephyr_sources( sem.c thread_entry.c timeutil.c - heap.c - heap-validate.c bitarray.c - multi_heap.c ) zephyr_sources_ifdef(CONFIG_FDTABLE fdtable.c) @@ -50,10 +47,6 @@ zephyr_sources_ifdef(CONFIG_SCHED_DEADLINE p4wq.c) zephyr_sources_ifdef(CONFIG_REBOOT reboot.c) -zephyr_sources_ifdef(CONFIG_SHARED_MULTI_HEAP shared_multi_heap.c) - -zephyr_sources_ifdef(CONFIG_HEAP_LISTENER heap_listener.c) - zephyr_sources_ifdef(CONFIG_UTF8 utf8.c) zephyr_sources_ifdef(CONFIG_SYS_MEM_BLOCKS mem_blocks.c) diff --git a/lib/os/Kconfig b/lib/os/Kconfig index e6b25ade5a5..8b41f92f5b2 100644 --- a/lib/os/Kconfig +++ b/lib/os/Kconfig @@ -119,14 +119,6 @@ config SPSC_PBUF_UTILIZATION endif # SPSC_PBUF -config SHARED_MULTI_HEAP - bool "Shared multi-heap manager" - help - Enable support for a shared multi-heap manager that uses the - multi-heap allocator to manage a set of reserved memory regions with - different capabilities / attributes (cacheable, non-cacheable, - etc...) defined in the DT. - config WINSTREAM bool "Lockless shared memory window byte stream" help @@ -177,6 +169,5 @@ config UTF8 rsource "Kconfig.cbprintf" -rsource "Kconfig.heap" endmenu