diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 2e42a6323f7..3101afc9f89 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,15 +1,8 @@ -zephyr_sources(thread_entry.c work_q.c) -zephyr_sources(fdtable.c) -add_subdirectory(crc) -add_subdirectory_ifdef(CONFIG_JSON_LIBRARY json) if(NOT CONFIG_NATIVE_APPLICATION) add_subdirectory(libc) endif() -add_subdirectory_if_kconfig(ring_buffer) -add_subdirectory_if_kconfig(base64) -add_subdirectory(mempool) add_subdirectory_ifdef(CONFIG_POSIX_API posix) add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V1 cmsis_rtos_v1) add_subdirectory_ifdef(CONFIG_CMSIS_RTOS_V2 cmsis_rtos_v2) -add_subdirectory(rbtree) add_subdirectory(gui) +add_subdirectory(os) diff --git a/lib/Kconfig b/lib/Kconfig index 6861a2ccbd8..1f83cc97913 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -8,29 +8,14 @@ source "lib/libc/Kconfig" menu "Additional libraries" -config JSON_LIBRARY - bool "Build JSON library" - help - Build a minimal JSON parsing/encoding library. Used by sample - applications such as the NATS client. - -config RING_BUFFER - bool "Enable ring buffers" - help - Enable usage of ring buffers. This is similar to kernel FIFOs but ring - buffers manage their own buffer memory and can store arbitrary data. - For optimal performance, use buffer sizes that are a power of 2. - -config BASE64 - bool "Enable base64 encoding and decoding" - help - Enable base64 encoding and decoding functionality - -source "lib/posix/Kconfig" - source "lib/cmsis_rtos_v1/Kconfig" + source "lib/cmsis_rtos_v2/Kconfig" source "lib/gui/Kconfig" +source "lib/os/Kconfig" + +source "lib/posix/Kconfig" + endmenu diff --git a/lib/base64/CMakeLists.txt b/lib/base64/CMakeLists.txt deleted file mode 100644 index e3c4aaf46f6..00000000000 --- a/lib/base64/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -zephyr_sources(base64.c) diff --git a/lib/crc/CMakeLists.txt b/lib/crc/CMakeLists.txt deleted file mode 100644 index 29ae1e4093e..00000000000 --- a/lib/crc/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -zephyr_sources(crc32_sw.c crc16_sw.c crc8_sw.c crc7_sw.c) diff --git a/lib/json/CMakeLists.txt b/lib/json/CMakeLists.txt deleted file mode 100644 index da12bb12385..00000000000 --- a/lib/json/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -zephyr_library() -zephyr_library_sources(json.c) diff --git a/lib/mempool/CMakeLists.txt b/lib/mempool/CMakeLists.txt deleted file mode 100644 index b3cb3c16e25..00000000000 --- a/lib/mempool/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -zephyr_sources(mempool.c) diff --git a/lib/os/CMakeLists.txt b/lib/os/CMakeLists.txt new file mode 100644 index 00000000000..bd820968d84 --- /dev/null +++ b/lib/os/CMakeLists.txt @@ -0,0 +1,17 @@ +zephyr_sources_if_kconfig(base64.c) + +zephyr_sources( + crc32_sw.c + crc16_sw.c + crc8_sw.c + crc7_sw.c + fdtable.c + mempool.c + rb.c + thread_entry.c + work_q.c + ) + +zephyr_sources_ifdef(CONFIG_JSON_LIBRARY json.c) + +zephyr_sources_if_kconfig(ring_buffer.c) diff --git a/lib/os/Kconfig b/lib/os/Kconfig new file mode 100644 index 00000000000..b89ddd1e2ee --- /dev/null +++ b/lib/os/Kconfig @@ -0,0 +1,27 @@ +# +# Copyright (c) 2016 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +menu "OS Support Library" + +config JSON_LIBRARY + bool "Build JSON library" + help + Build a minimal JSON parsing/encoding library. Used by sample + applications such as the NATS client. + +config RING_BUFFER + bool "Enable ring buffers" + help + Enable usage of ring buffers. This is similar to kernel FIFOs but ring + buffers manage their own buffer memory and can store arbitrary data. + For optimal performance, use buffer sizes that are a power of 2. + +config BASE64 + bool "Enable base64 encoding and decoding" + help + Enable base64 encoding and decoding functionality + +endmenu diff --git a/lib/base64/base64.c b/lib/os/base64.c similarity index 100% rename from lib/base64/base64.c rename to lib/os/base64.c diff --git a/lib/crc/crc16_sw.c b/lib/os/crc16_sw.c similarity index 100% rename from lib/crc/crc16_sw.c rename to lib/os/crc16_sw.c diff --git a/lib/crc/crc32_sw.c b/lib/os/crc32_sw.c similarity index 100% rename from lib/crc/crc32_sw.c rename to lib/os/crc32_sw.c diff --git a/lib/crc/crc7_sw.c b/lib/os/crc7_sw.c similarity index 100% rename from lib/crc/crc7_sw.c rename to lib/os/crc7_sw.c diff --git a/lib/crc/crc8_sw.c b/lib/os/crc8_sw.c similarity index 100% rename from lib/crc/crc8_sw.c rename to lib/os/crc8_sw.c diff --git a/lib/fdtable.c b/lib/os/fdtable.c similarity index 100% rename from lib/fdtable.c rename to lib/os/fdtable.c diff --git a/lib/json/json.c b/lib/os/json.c similarity index 100% rename from lib/json/json.c rename to lib/os/json.c diff --git a/lib/mempool/mempool.c b/lib/os/mempool.c similarity index 100% rename from lib/mempool/mempool.c rename to lib/os/mempool.c diff --git a/lib/rbtree/rb.c b/lib/os/rb.c similarity index 100% rename from lib/rbtree/rb.c rename to lib/os/rb.c diff --git a/lib/ring_buffer/ring_buffer.c b/lib/os/ring_buffer.c similarity index 100% rename from lib/ring_buffer/ring_buffer.c rename to lib/os/ring_buffer.c diff --git a/lib/thread_entry.c b/lib/os/thread_entry.c similarity index 100% rename from lib/thread_entry.c rename to lib/os/thread_entry.c diff --git a/lib/work_q.c b/lib/os/work_q.c similarity index 100% rename from lib/work_q.c rename to lib/os/work_q.c diff --git a/lib/rbtree/CMakeLists.txt b/lib/rbtree/CMakeLists.txt deleted file mode 100644 index 04156c6ff36..00000000000 --- a/lib/rbtree/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -zephyr_sources(rb.c) diff --git a/lib/ring_buffer/CMakeLists.txt b/lib/ring_buffer/CMakeLists.txt deleted file mode 100644 index 25e8ce08b7b..00000000000 --- a/lib/ring_buffer/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -zephyr_sources(ring_buffer.c) diff --git a/tests/unit/lib/crc/main.c b/tests/unit/lib/crc/main.c index f6bf0cb42a5..7a2f05b04e7 100644 --- a/tests/unit/lib/crc/main.c +++ b/tests/unit/lib/crc/main.c @@ -6,10 +6,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include void test_crc32_ieee(void) {