From 69966dd452e5ebf9f057b393b1e5cdac9ea2034b Mon Sep 17 00:00:00 2001 From: Joshua Lilly Date: Fri, 24 Feb 2023 16:09:42 -0500 Subject: [PATCH] lib: hashmap: Move hash table files lib/hashmap Moves the hashmap related files into their own directory Signed-off-by: Joshua Lilly --- lib/CMakeLists.txt | 1 + lib/Kconfig | 2 ++ lib/hash/CMakeLists.txt | 9 +++++++++ lib/hash/Kconfig | 5 +++++ lib/{os => hash}/Kconfig.hash_func | 0 lib/{os => hash}/Kconfig.hash_map | 0 lib/{os => hash}/hash_func32_djb2.c | 0 lib/{os => hash}/hash_func32_murmur3.c | 0 lib/{os => hash}/hash_map_cxx.cpp | 0 lib/{os => hash}/hash_map_oa_lp.c | 0 lib/{os => hash}/hash_map_sc.c | 0 lib/os/CMakeLists.txt | 7 ------- lib/os/Kconfig | 3 --- 13 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 lib/hash/CMakeLists.txt create mode 100644 lib/hash/Kconfig rename lib/{os => hash}/Kconfig.hash_func (100%) rename lib/{os => hash}/Kconfig.hash_map (100%) rename lib/{os => hash}/hash_func32_djb2.c (100%) rename lib/{os => hash}/hash_func32_murmur3.c (100%) rename lib/{os => hash}/hash_map_cxx.cpp (100%) rename lib/{os => hash}/hash_map_oa_lp.c (100%) rename lib/{os => hash}/hash_map_sc.c (100%) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 454309cad04..f70f85d6071 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory(libc) add_subdirectory(posix) endif() add_subdirectory_ifdef(CONFIG_CPP cpp) +add_subdirectory(hash) add_subdirectory(os) add_subdirectory(util) add_subdirectory_ifdef(CONFIG_SMF smf) diff --git a/lib/Kconfig b/lib/Kconfig index 982d4f7a559..ac4f468e813 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -7,6 +7,8 @@ source "lib/cpp/Kconfig" menu "Additional libraries" +source "lib/hash/Kconfig" + source "lib/os/Kconfig" source "lib/posix/Kconfig" diff --git a/lib/hash/CMakeLists.txt b/lib/hash/CMakeLists.txt new file mode 100644 index 00000000000..1dfe117e390 --- /dev/null +++ b/lib/hash/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2022 Meta +# +# SPDX-License-Identifier: Apache-2.0 +zephyr_sources_ifdef(CONFIG_SYS_HASH_FUNC32_DJB2 hash_func32_djb2.c) +zephyr_sources_ifdef(CONFIG_SYS_HASH_FUNC32_MURMUR3 hash_func32_murmur3.c) + +zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_SC hash_map_sc.c) +zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_OA_LP hash_map_oa_lp.c) +zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_CXX hash_map_cxx.cpp) diff --git a/lib/hash/Kconfig b/lib/hash/Kconfig new file mode 100644 index 00000000000..4ab246ae276 --- /dev/null +++ b/lib/hash/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2022 Meta +# +# SPDX-License-Identifier: Apache-2.0 +rsource "Kconfig.hash_func" +rsource "Kconfig.hash_map" diff --git a/lib/os/Kconfig.hash_func b/lib/hash/Kconfig.hash_func similarity index 100% rename from lib/os/Kconfig.hash_func rename to lib/hash/Kconfig.hash_func diff --git a/lib/os/Kconfig.hash_map b/lib/hash/Kconfig.hash_map similarity index 100% rename from lib/os/Kconfig.hash_map rename to lib/hash/Kconfig.hash_map diff --git a/lib/os/hash_func32_djb2.c b/lib/hash/hash_func32_djb2.c similarity index 100% rename from lib/os/hash_func32_djb2.c rename to lib/hash/hash_func32_djb2.c diff --git a/lib/os/hash_func32_murmur3.c b/lib/hash/hash_func32_murmur3.c similarity index 100% rename from lib/os/hash_func32_murmur3.c rename to lib/hash/hash_func32_murmur3.c diff --git a/lib/os/hash_map_cxx.cpp b/lib/hash/hash_map_cxx.cpp similarity index 100% rename from lib/os/hash_map_cxx.cpp rename to lib/hash/hash_map_cxx.cpp diff --git a/lib/os/hash_map_oa_lp.c b/lib/hash/hash_map_oa_lp.c similarity index 100% rename from lib/os/hash_map_oa_lp.c rename to lib/hash/hash_map_oa_lp.c diff --git a/lib/os/hash_map_sc.c b/lib/hash/hash_map_sc.c similarity index 100% rename from lib/os/hash_map_sc.c rename to lib/hash/hash_map_sc.c diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt index f0f9c490dce..df75c47c00f 100644 --- a/lib/os/CMakeLists.txt +++ b/lib/os/CMakeLists.txt @@ -64,13 +64,6 @@ zephyr_sources_ifdef(CONFIG_SYS_MEM_BLOCKS mem_blocks.c) zephyr_sources_ifdef(CONFIG_WINSTREAM winstream.c) -zephyr_sources_ifdef(CONFIG_SYS_HASH_FUNC32_DJB2 hash_func32_djb2.c) -zephyr_sources_ifdef(CONFIG_SYS_HASH_FUNC32_MURMUR3 hash_func32_murmur3.c) - -zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_SC hash_map_sc.c) -zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_OA_LP hash_map_oa_lp.c) -zephyr_sources_ifdef(CONFIG_SYS_HASH_MAP_CXX hash_map_cxx.cpp) - zephyr_library_include_directories( ${ZEPHYR_BASE}/kernel/include ${ZEPHYR_BASE}/arch/${ARCH}/include diff --git a/lib/os/Kconfig b/lib/os/Kconfig index e209566124d..adb67a51070 100644 --- a/lib/os/Kconfig +++ b/lib/os/Kconfig @@ -176,7 +176,4 @@ rsource "Kconfig.cbprintf" rsource "Kconfig.heap" -rsource "Kconfig.hash_func" -rsource "Kconfig.hash_map" - endmenu