coreboot-kgpe-d16/src/lib
Julius Werner 834b3ecd7c cbfs: Simplify load/map API names, remove type arguments
This patch renames cbfs_boot_map_with_leak() and cbfs_boot_load_file()
to cbfs_map() and cbfs_load() respectively. This is supposed to be the
start of a new, better organized CBFS API where the most common
operations have the most simple and straight-forward names. Less
commonly used variants of these operations (e.g. cbfs_ro_load() or
cbfs_region_load()) can be introduced later. It seems unnecessary to
keep carrying around "boot" in the names of most CBFS APIs if the vast
majority of accesses go to the boot CBFS (instead, more unusual
operations should have longer names that describe how they diverge from
the common ones).

cbfs_map() is paired with a new cbfs_unmap() to allow callers to cleanly
reap mappings when desired. A few new cbfs_unmap() calls are added to
generic code where it makes sense, but it seems unnecessary to introduce
this everywhere in platform or architecture specific code where the boot
medium is known to be memory-mapped anyway. In fact, even for
non-memory-mapped platforms, sometimes leaking a mapping to the CBFS
cache is a much cleaner solution than jumping through hoops to provide
some other storage for some long-lived file object, and it shouldn't be
outright forbidden when it makes sense.

Additionally, remove the type arguments from these function signatures.
The goal is to eventually remove type arguments for lookup from the
whole CBFS API. Filenames already uniquely identify CBFS files. The type
field is just informational, and there should be APIs to allow callers
to check it when desired, but it's not clear what we gain from forcing
this as a parameter into every single CBFS access when the vast majority
of the time it provides no additional value and is just clutter.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ib24325400815a9c3d25f66c61829a24a239bb88e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39304
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Wim Vervoorn <wvervoorn@eltan.com>
Reviewed-by: Mariusz Szafrański <mariuszx.szafranski@intel.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-12-02 22:13:17 +00:00
..
gnat lib/gnat/i-c.ads: Add uintptr_t type 2020-11-16 12:13:31 +00:00
asan.c src: Add missing 'include <console/console.h>' 2020-11-17 09:01:14 +00:00
b64_decode.c treewide: replace GPLv2 long form headers with SPDX header 2020-05-06 22:20:57 +00:00
boot_device.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
bootblock.c src/lib/bootblock.c: make bootblock_main_with_timestamp public 2020-09-22 07:00:34 +00:00
bootmem.c lib/bootmem.c: Improve bootmem_allocate_buffer algorithm 2020-07-30 17:13:28 +00:00
bootmode.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
bootsplash.c cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
cb.ads
cbfs.c cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
cbmem_common.c src: Remove unused 'include <bootstate.h>' 2020-06-02 07:40:35 +00:00
cbmem_console.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
cbmem_stage_cache.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
compute_ip_checksum.c
coreboot_table.c cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
crc_byte.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
decompressor.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
delay.c
device_tree.c treewide: replace GPLv2 long form headers with SPDX header 2020-05-06 22:20:57 +00:00
dimm_info_util.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
edid.c lib/edid: Add missing name descriptor presence flag 2020-10-26 13:28:41 +00:00
edid_fill_fb.c treewide: Convert more license headers to SPDX style 2020-05-11 19:37:19 +00:00
espi_debug.c espi_debug: Use switch case instead of if-else 2020-05-13 08:37:59 +00:00
ext_stage_cache.c src/lib: Remove unused function parameters in imd.c 2020-08-04 07:13:59 +00:00
fallback_boot.c
fit.c fit: Swap compat matching priorities for board-revX and board-skuY 2020-05-29 20:47:54 +00:00
fit_payload.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
fmap.c lib/fmap: add ENV_SMM check to setup_preram_cache 2020-09-14 16:01:42 +00:00
fw_config.c cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
gcc.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
gcov-glue.c lib/gcov: Remove assert(0) 2020-08-03 10:36:00 +00:00
gcov-io.c
gcov-io.h
gcov-iov.h
gpio.c gpio: Pull down HiZ pins after reading tristate GPIO strapping 2020-08-06 23:54:41 +00:00
halt.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
hardwaremain.c ACPI S3: Replace acpi_is_wakeup() 2020-11-19 14:48:31 +00:00
hexdump.c treewide: replace GPLv2 long form headers with SPDX header 2020-05-06 22:20:57 +00:00
hexstrtobin.c treewide: Convert more license headers to SPDX style 2020-05-11 19:37:19 +00:00
hw-time-timer.adb treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
imd.c lib/imd: move struct definitions to a new header file 2020-10-19 06:55:03 +00:00
imd_cbmem.c lib/imd_cbmem.c: Add a helper function to indicate that cbmem is ready 2020-08-17 06:22:58 +00:00
jpeg.c src/lib/jpeg.c: Drop dead code 2020-07-09 23:50:51 +00:00
jpeg.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
Kconfig cbfs: Enable CBFS mcache on most chipsets 2020-12-02 22:12:10 +00:00
libgcc.c treewide: Replace CONFIG(ARCH_xx) tests 2020-06-17 21:13:09 +00:00
libgcov.c lib/libgcov.c: Do not redefine alloca 2020-07-29 09:27:33 +00:00
list.c treewide: replace GPLv2 long form headers with SPDX header 2020-05-06 22:20:57 +00:00
lzma.c Remove MAYBE_STATIC_BSS and ENV_STAGE_HAS_BSS_SECTION 2020-05-26 15:04:08 +00:00
lzmadecode.c
lzmadecode.h
Makefile.inc trogdor: Modify DDR training to use mrc_cache 2020-10-09 19:45:40 +00:00
malloc.c lib/malloc: Drop <cpu/x86/smm.h> include 2020-06-16 08:09:13 +00:00
memchr.c
memcmp.c
memcpy.c
memmove.c
memrange.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
memset.c
nhlt.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
primitive_memtest.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
prog_loaders.c prog_loaders: Fix ramstage loading on x86 2020-07-06 09:36:15 +00:00
prog_ops.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
program.ld lib: Add ASan support to ramstage on x86 arch 2020-08-21 07:37:52 +00:00
ramdetect.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
ramtest.c treewide: Replace CONFIG(ARCH_xx) tests 2020-06-17 21:13:09 +00:00
reg_script.c lib/reg_script: Add cast to fix compilation on x86_64 2020-12-01 16:00:57 +00:00
region_file.c region_file_update_data_arr: Modify region_file with array of buffers 2020-09-16 16:02:54 +00:00
reset.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
rmodule.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
rmodule.ld
romstage_handoff.c src: Update some incorrect config options in comments 2020-11-16 12:09:58 +00:00
rtc.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
selfboot.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
spd_bin.c cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
spd_cache.c Remove new additions of "this file is part of" lines 2020-05-18 07:12:03 +00:00
stack.c
string.c lib/string: Add standard strstr() function 2020-08-03 05:12:23 +00:00
thread.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
timer.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
timer_queue.c src: Remove unused 'include <stddef.h> 2020-08-18 12:15:44 +00:00
timestamp.c symbols: Change implementation details of DECLARE_OPTIONAL_REGION() 2020-08-27 22:11:17 +00:00
trace.c src: Remove unused 'include <types.h>' 2020-07-14 16:10:17 +00:00
ubsan.c lib/ubsan.c: Remove GCC 5.x workaround 2020-10-05 16:18:24 +00:00
uuid.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
version.c
wrdd.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00