Julius Werner uploaded patch set #3 to this change.

View Change

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
---
M src/arch/x86/acpi.c
M src/arch/x86/bootblock_normal.c
M src/cpu/amd/pi/00730F01/microcode_fam16h.c
M src/cpu/intel/microcode/microcode.c
M src/drivers/amd/agesa/def_callouts.c
M src/drivers/amd/agesa/state_machine.c
M src/drivers/intel/fsp1_1/logo.c
M src/drivers/intel/fsp2_0/logo.c
M src/drivers/intel/gma/opregion.c
M src/drivers/pc80/rtc/option.c
M src/include/cbfs.h
M src/lib/bootsplash.c
M src/lib/cbfs.c
M src/lib/coreboot_table.c
M src/lib/spd_bin.c
M src/mainboard/apple/macbookair4_2/early_init.c
M src/mainboard/google/auron/variants/auron_paine/spd/spd.c
M src/mainboard/google/auron/variants/auron_yuna/spd/spd.c
M src/mainboard/google/auron/variants/buddy/variant.c
M src/mainboard/google/auron/variants/gandof/spd/spd.c
M src/mainboard/google/auron/variants/lulu/spd/spd.c
M src/mainboard/google/auron/variants/samus/spd/spd.c
M src/mainboard/google/beltino/lan.c
M src/mainboard/google/butterfly/mainboard.c
M src/mainboard/google/cyan/spd/spd.c
M src/mainboard/google/dragonegg/romstage_fsp_params.c
M src/mainboard/google/eve/spd/spd.c
M src/mainboard/google/glados/spd/spd.c
M src/mainboard/google/gru/sdram_configs.c
M src/mainboard/google/jecht/lan.c
M src/mainboard/google/kahlee/variants/baseboard/mainboard.c
M src/mainboard/google/kahlee/variants/treeya/mainboard.c
M src/mainboard/google/kukui/mainboard.c
M src/mainboard/google/kukui/sdram_configs.c
M src/mainboard/google/link/early_init.c
M src/mainboard/google/poppy/romstage.c
M src/mainboard/google/poppy/variants/nami/mainboard.c
M src/mainboard/google/rambi/romstage.c
M src/mainboard/google/rambi/variants/ninja/lan.c
M src/mainboard/google/rambi/variants/sumo/lan.c
M src/mainboard/google/slippy/variants/falco/romstage.c
M src/mainboard/google/slippy/variants/leon/romstage.c
M src/mainboard/google/slippy/variants/peppy/romstage.c
M src/mainboard/google/slippy/variants/wolf/romstage.c
M src/mainboard/hp/snb_ivb_laptops/variants/revolve_810_g1/early_init.c
M src/mainboard/intel/harcuvar/spd/spd.c
M src/mainboard/intel/kunimitsu/spd/spd_util.c
M src/mainboard/lenovo/s230u/early_init.c
M src/mainboard/lenovo/t430s/variants/t431s/romstage.c
M src/mainboard/lenovo/x1_carbon_gen1/early_init.c
M src/mainboard/samsung/lumpy/early_init.c
M src/mainboard/sifive/hifive-unleashed/fixup_fdt.c
M src/northbridge/intel/sandybridge/raminit_mrc.c
M src/security/intel/stm/StmPlatformSmm.c
M src/security/vboot/ec_sync.c
M src/soc/amd/common/block/pi/def_callouts.c
M src/soc/cavium/cn81xx/soc.c
M src/soc/intel/baytrail/romstage/raminit.c
M src/soc/intel/common/mma.c
M src/soc/intel/denverton_ns/chip.c
M src/soc/mediatek/mt8183/spm.c
M src/soc/mediatek/mt8183/sspm.c
M src/soc/qualcomm/ipq40xx/blobs_init.c
M src/soc/qualcomm/ipq806x/blobs_init.c
M src/soc/qualcomm/sc7180/qclib.c
M src/soc/qualcomm/sdm845/qclib.c
M src/vendorcode/eltan/security/mboot/mboot.c
M src/vendorcode/eltan/security/verified_boot/vboot_check.c
M src/vendorcode/google/chromeos/sar.c
M src/vendorcode/siemens/hwilib/hwilib.c
70 files changed, 112 insertions(+), 164 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/39304/3

To view, visit change 39304. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib24325400815a9c3d25f66c61829a24a239bb88e
Gerrit-Change-Number: 39304
Gerrit-PatchSet: 3
Gerrit-Owner: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Alexander Couzens <lynxis@fe80.eu>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov@gmail.com>
Gerrit-Reviewer: David Guckian <david.guckian@intel.com>
Gerrit-Reviewer: Evgeny Zinoviev <me@ch1p.io>
Gerrit-Reviewer: Huang Jin <huang.jin@intel.com>
Gerrit-Reviewer: Lee Leahy <leroy.p.leahy@intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Hug <philipp@hug.cx>
Gerrit-Reviewer: Vanessa Eusebio <vanessa.f.eusebio@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich@gmail.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: newpatchset