Commit 0b999c09 authored by Anas Nashif's avatar Anas Nashif Committed by Carles Cufi
Browse files

lib: move utilities into own folder



Move various utilities out of lib into own folder for better assignement
and management in the maintainer file. lib/os has become another dumping
ground for everything and it the Kconfig and contents in that folder
became difficult to manage, configure and test.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent e710c9ce
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -2066,7 +2066,7 @@ JSON Web Token:
  files:
    - subsys/jwt/
    - include/zephyr/data/
    - lib/os/json.c
    - lib/utils/json.c
    - tests/subsys/jwt/
    - tests/lib/json/
  labels:
@@ -2125,8 +2125,15 @@ Kernel:

Utilities:
  status: maintained
  maintainers:
    - andyross
    - nashif
  collaborators:
    - dcpleung
    - peter-mitsis
  files:
    - lib/crc/
    - lib/utils/
    - tests/unit/timeutil/
    - tests/unit/time_units/
    - tests/unit/rbtree/
@@ -2136,7 +2143,6 @@ Utilities:
    - tests/unit/math_extras/
    - tests/unit/list/
    - tests/unit/intmath/
    - tests/misc/print_format/
    - tests/unit/pot/
    - tests/lib/time/
    - tests/lib/onoff/
@@ -2147,6 +2153,10 @@ Utilities:
    - tests/lib/linear_range/
  labels:
    - "area: Utilities"
  tests:
    - utilities
    - libraries.ring_buffer
    - libraries.linear_range

Base OS:
  status: maintained
@@ -2159,6 +2169,9 @@ Base OS:
  files:
    - include/zephyr/sys/
    - lib/os/
    - tests/misc/print_format/
    - tests/lib/p4workq/
    - tests/lib/fdtable/
  files-exclude:
    - include/zephyr/sys/cbprintf*
    - tests/unit/cbprintf/
@@ -2171,6 +2184,8 @@ Base OS:
    - lib/os/mpsc_pbuf.c
  labels:
    - "area: Base OS"
  tests:
    - printk

Heap Management:
  status: maintained
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ add_subdirectory(hash)
add_subdirectory(heap)
add_subdirectory(mem_blocks)
add_subdirectory(os)
add_subdirectory(utils)
add_subdirectory_ifdef(CONFIG_SMF smf)
add_subdirectory_ifdef(CONFIG_OPENAMP              open-amp)
add_subdirectory_ifdef(CONFIG_ACPI acpi)
+2 −0
Original line number Diff line number Diff line
@@ -26,4 +26,6 @@ source "lib/smf/Kconfig"
source "lib/acpi/Kconfig"

source "lib/runtime/Kconfig"

source "lib/utils/Kconfig"
endmenu
+0 −17
Original line number Diff line number Diff line
@@ -4,23 +4,14 @@ zephyr_syscall_header(
  ${ZEPHYR_BASE}/include/zephyr/sys/mutex.h
)

zephyr_sources_ifdef(CONFIG_BASE64 base64.c)

zephyr_sources(
  cbprintf_packaged.c
  dec.c
  hex.c
  printk.c
  rb.c
  sem.c
  thread_entry.c
  timeutil.c
  bitarray.c
  )

zephyr_sources_ifdef(CONFIG_FDTABLE fdtable.c)
zephyr_sources_ifdef(CONFIG_ONOFF onoff.c)
zephyr_sources_ifdef(CONFIG_NOTIFY notify.c)

zephyr_sources_ifdef(CONFIG_CBPRINTF_COMPLETE cbprintf_complete.c)
zephyr_sources_ifdef(CONFIG_CBPRINTF_NANO cbprintf_nano.c)
@@ -29,10 +20,6 @@ if(NOT CONFIG_PICOLIBC)
  zephyr_sources(cbprintf.c)
endif()

zephyr_sources_ifdef(CONFIG_JSON_LIBRARY json.c)

zephyr_sources_ifdef(CONFIG_RING_BUFFER ring_buffer.c)

if (CONFIG_ASSERT OR CONFIG_ASSERT_VERBOSE)
zephyr_sources(assert.c)
endif()
@@ -47,10 +34,6 @@ zephyr_sources_ifdef(CONFIG_SCHED_DEADLINE p4wq.c)

zephyr_sources_ifdef(CONFIG_REBOOT reboot.c)

zephyr_sources_ifdef(CONFIG_UTF8 utf8.c)

zephyr_sources_ifdef(CONFIG_WINSTREAM winstream.c)

zephyr_sources_ifdef(CONFIG_POWEROFF poweroff.c)

zephyr_library_include_directories(
+0 −54
Original line number Diff line number Diff line
@@ -10,29 +10,6 @@ config FDTABLE
	  for any I/O object implementing POSIX I/O semantics (i.e. read/write +
	  aux operations).

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 "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 NOTIFY
	bool "Asynchronous Notifications"
	help
	  Use this API to support async transactions.

config BASE64
	bool "Base64 encoding and decoding"
	help
	  Enable base64 encoding and decoding functionality

config PRINTK_SYNC
	bool "Serialize printk() calls"
	default y if SMP && MP_MAX_NUM_CPUS > 1 && !(EFI_CONSOLE && LOG)
@@ -50,14 +27,6 @@ config MPSC_PBUF
	  storing variable length packets in a circular way and operate directly
	  on the buffer memory.

config ONOFF
	bool "On-Off Manager"
	select NOTIFY
	help
	  An on-off manager supports an arbitrary number of clients of a
	  service which has a binary state.  Example applications are power
	  rails, clocks, and binary device power management.

config SPSC_PBUF
	bool "Single producer, single consumer packet buffer"
	help
@@ -119,23 +88,6 @@ config SPSC_PBUF_UTILIZATION

endif # SPSC_PBUF

config WINSTREAM
	bool "Lockless shared memory window byte stream"
	help
	  Winstream is a byte stream IPC for use in shared memory
	  "windows", generally for transmit to non-Zephyr contexts that
	  can't share Zephyr APIs or data structures.

if WINSTREAM
config WINSTREAM_STDLIB_MEMCOPY
	bool "Use standard memcpy() in winstream"
	help
	  The sys_winstream utility is sometimes used in early boot
	  environments before the standard library is usable.  By
	  default it uses a simple internal bytewise memcpy().  Set
	  this to use the one from the standard library.
endif

if MPSC_PBUF
config MPSC_CLEAR_ALLOCATED
	bool "Clear allocated packet"
@@ -161,12 +113,6 @@ config POWEROFF
	help
	  Enable support for system power off.

config UTF8
	bool "UTF-8 string operation supported"
	help
	  Enable the utf8 API. The API implements functions to specifically
	  handle UTF-8 encoded strings.

rsource "Kconfig.cbprintf"

endmenu
Loading