coreboot-kgpe-d16/src/commonlib
Julius Werner 7778cf2d30 cbfs: Add cbfs_alloc() primitive and combine cbfs_load() and cbfs_map()
This patchs adds a new CBFS primitive that allows callers to pass in an
allocator function that will be called once the size of the file to load
is known, to decide on its final location. This can be useful for
loading a CBFS file straight into CBMEM, for example. The new primitive
is combined with cbfs_map() and cbfs_load() into a single underlying
function that can handle all operations, to reduce the amount of code
that needs to be duplicated (especially later when file verification is
added). Also add a new variation that allows restraining or querying the
CBFS type of a file as it is being loaded, and reorganize the
documentation/definition of all these accessors and variations in the
header file a little.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I5fe0645387c0e9053ad5c15744437940fc904392
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49334
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2021-03-08 22:31:43 +00:00
..
bsd cbfs: Add cbfs_alloc() primitive and combine cbfs_load() and cbfs_map() 2021-03-08 22:31:43 +00:00
include/commonlib cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core 2021-03-08 22:31:29 +00:00
storage src/commonlib: Drop unneeded empty lines 2020-09-21 15:53:25 +00:00
cbfs.c commonlib/cbfs.c: Remove unuse <console/console.h> 2021-02-15 10:51:24 +00:00
fsp_relocate.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
iobuf.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
Makefile.inc cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core 2021-03-08 22:31:29 +00:00
mem_pool.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
region.c cbfs: Pull handling of the CBFS_CACHE mem_pool into CBFS core 2021-03-08 22:31:29 +00:00
sort.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00