lib: crc: move from lib/os to lib/crc

Move crc implementation to own directory and reduce clutter in lib/os.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-08-16 13:04:12 +00:00 committed by Johan Hedberg
parent 65e97fb03a
commit e6885a4515
12 changed files with 29 additions and 22 deletions

View file

@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_subdirectory(crc)
if(NOT CONFIG_EXTERNAL_LIBC) if(NOT CONFIG_EXTERNAL_LIBC)
add_subdirectory(libc) add_subdirectory(libc)
add_subdirectory(posix) add_subdirectory(posix)

View file

@ -5,6 +5,8 @@ source "lib/libc/Kconfig"
source "lib/cpp/Kconfig" source "lib/cpp/Kconfig"
source "lib/crc/Kconfig"
menu "Additional libraries" menu "Additional libraries"
source "lib/hash/Kconfig" source "lib/hash/Kconfig"

10
lib/crc/CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources_ifdef(CONFIG_CRC
crc32c_sw.c
crc32_sw.c
crc16_sw.c
crc8_sw.c
crc7_sw.c
)
zephyr_sources_ifdef(CONFIG_CRC_SHELL crc_shell.c)

16
lib/crc/Kconfig Normal file
View file

@ -0,0 +1,16 @@
# Copyright (c) 2016,2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
config CRC
bool "Cyclic redundancy check (CRC) Support"
help
Enable use of CRC.
if CRC
config CRC_SHELL
bool "CRC Shell"
depends on SHELL
select GETOPT
help
Enable CRC checking for memory regions from the shell.
endif # CRC

View file

@ -24,14 +24,6 @@ zephyr_sources(
zephyr_sources_ifdef(CONFIG_ONOFF onoff.c) zephyr_sources_ifdef(CONFIG_ONOFF onoff.c)
zephyr_sources_ifdef(CONFIG_NOTIFY notify.c) zephyr_sources_ifdef(CONFIG_NOTIFY notify.c)
zephyr_sources_ifdef(CONFIG_CRC
crc32c_sw.c
crc32_sw.c
crc16_sw.c
crc8_sw.c
crc7_sw.c
)
zephyr_sources_ifdef(CONFIG_CRC_SHELL crc_shell.c)
zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c)
zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c) zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c)

View file

@ -26,20 +26,6 @@ config BASE64
help help
Enable base64 encoding and decoding functionality Enable base64 encoding and decoding functionality
config CRC
bool "Cyclic redundancy check (CRC) Support"
help
Enable use of CRC.
if CRC
config CRC_SHELL
bool "CRC Shell"
depends on SHELL
select GETOPT
help
Enable CRC checking for memory regions from the shell.
endif # CRC
config PRINTK_SYNC config PRINTK_SYNC
bool "Serialize printk() calls" bool "Serialize printk() calls"
default y if SMP && MP_NUM_CPUS > 1 && !(EFI_CONSOLE && LOG) default y if SMP && MP_NUM_CPUS > 1 && !(EFI_CONSOLE && LOG)