[Concept,00/15] ulib: Provide test programs and documentation

Message ID 20250905170132.182249-1-sjg@u-boot.org
Headers
Series ulib: Provide test programs and documentation |

Message

Simon Glass Sept. 5, 2025, 5:01 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

This series completes the implementation of a basic U-Boot library:

- ensure that no output is written during init
- provide a static library to match the existing shared library
- add test programs for both, to ensure they continue to build correctly
- provide documentation to describe how to use the libraries

This is still very early in the implementation, but this series provides
enough for some initial experimentation.


Simon Glass (15):
  sandbox: Add a function to read a line from a file
  ulib: Disable environment setup
  ulib: Disable console messages
  ulib: Disable network setup
  ulib: Disable the main loop
  ulib: Move struct bd_info into its own header
  ulib: sandbox: Move the linker-script name into config.mk
  ulib: Add static-library build support
  ulib: Provide an init function for sandbox
  ulib: Provide a generic init function
  ulib: Provide a test program for the static library
  ulib: Drop unnecessary pieces in test/ulib/Makefile
  ulib: Provide a bit more info in the library-test program
  ulib: Allow building of the libraries to be disabled
  doc: Add ulib documentation for shared and static libraries

 Makefile                                  |  38 +++-
 arch/sandbox/config.mk                    |   4 +
 arch/sandbox/cpu/os.c                     |  32 +++
 arch/sandbox/cpu/start.c                  |  30 ++-
 arch/sandbox/cpu/ulib-test-static.lds     |  19 ++
 arch/sandbox/include/asm/u-boot-sandbox.h |   9 +
 common/board_r.c                          |  14 ++
 common/console.c                          |   2 +-
 doc/develop/index.rst                     |   1 +
 doc/develop/ulib.rst                      | 253 ++++++++++++++++++++++
 include/asm-generic/u-boot.h              |  52 +----
 include/bd.h                              |  70 ++++++
 include/init.h                            |   4 +
 include/os.h                              |  14 ++
 include/u-boot-lib.h                      |  34 +++
 lib/Makefile                              |   2 +
 lib/ulib.c                                |  36 +++
 test/ulib/Makefile                        |   7 -
 test/ulib/ulib_test.c                     |  53 +++--
 19 files changed, 593 insertions(+), 81 deletions(-)
 create mode 100644 arch/sandbox/cpu/ulib-test-static.lds
 create mode 100644 doc/develop/ulib.rst
 create mode 100644 include/bd.h
 create mode 100644 include/u-boot-lib.h
 create mode 100644 lib/ulib.c