coreboot/src/commonlib
Yu-Ping Wu e50f7e8b49 commonlib/list: Add list_length() and more to API
In a follow-up patch (CB:90962), the list will be changed to a circular
one, and list_node fields 'next' and 'prev' will become private to the
implementation.

To allow smooth transition to circular lists for all call sites, add the
following functions to the list API:

- list_is_empty()
- list_next()
- list_prev()
- list_first()
- list_last()
- list_length()

All list API call sites are expected to use the public API instead of
the raw 'next' and 'prev' pointers.

Change-Id: Ib1040f5caab8550ea52db9b55a074d7d79c591e5
Signed-off-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90961
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub "Kuba" Czapiga <czapiga@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2026-02-01 02:25:52 +00:00
..
bsd drivers/amd/ftpm: Add fTPM driver for PSP emulated CRB TPMs 2026-01-14 17:02:47 +00:00
include/commonlib commonlib/list: Add list_length() and more to API 2026-02-01 02:25:52 +00:00
mipi commonlib/mipi/cmd: Remove unnecessary 'const void *' cast 2026-01-19 08:27:06 +00:00
storage commonlib/storage: Avoid build error when CONFIG_PCI is disabled 2025-04-03 03:11:05 +00:00
device_tree.c commonlib/device_tree: Add dt_add_reserved_memory_region helper 2026-01-13 00:46:32 +00:00
fsp_relocate.c commonlib/fsp_relocate: Add PE32+ support 2024-06-21 15:49:38 +00:00
iobuf.c src/commonlib: Clean up includes 2022-10-26 16:27:10 +00:00
list.c commonlib/list: Add list_length() and more to API 2026-02-01 02:25:52 +00:00
Makefile.mk treewide: Move mipi_panel_parse_commands() to commonlib 2026-01-14 09:38:36 +00:00
mem_pool.c commonlib/mem_pool: Allow configuring the alignment 2021-11-04 10:33:52 +00:00
rational.c commonlib: Add support for rational number approximation 2022-08-03 03:26:13 +00:00
region.c region: Turn region_end() into an inclusive region_last() 2024-08-23 01:08:16 +00:00
sort.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00