libpayload/libcbfs: Add unverified_area APIs
This patch introduces equivalents of unverified_area CBFS access functions added to the main coreboot tree in CB:59678 Change-Id: Ibadfd2a5cb6ad037ef1222b0a4301f90a79a127b Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60714 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
committed by
Felix Held
parent
b3398ba562
commit
ad45f681aa
@@ -17,9 +17,13 @@
|
||||
|
||||
static inline size_t cbfs_load(const char *name, void *buf, size_t size);
|
||||
static inline size_t cbfs_ro_load(const char *name, void *buf, size_t size);
|
||||
static inline size_t cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t size);
|
||||
|
||||
static inline void *cbfs_map(const char *name, size_t *size_out);
|
||||
static inline void *cbfs_ro_map(const char *name, size_t *size_out);
|
||||
static inline void *cbfs_unverified_area_map(const char *area, const char *name,
|
||||
size_t *size_out);
|
||||
|
||||
void cbfs_unmap(void *mapping);
|
||||
|
||||
@@ -39,6 +43,9 @@ ssize_t _cbfs_boot_lookup(const char *name, bool force_ro, union cbfs_mdata *mda
|
||||
|
||||
void *_cbfs_load(const char *name, void *buf, size_t *size_inout, bool force_ro);
|
||||
|
||||
void *_cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t *size_inout);
|
||||
|
||||
/**********************************************************************************************
|
||||
* INLINE IMPLEMENTATIONS *
|
||||
**********************************************************************************************/
|
||||
@@ -53,6 +60,12 @@ static inline void *cbfs_ro_map(const char *name, size_t *size_out)
|
||||
return _cbfs_load(name, NULL, size_out, true);
|
||||
}
|
||||
|
||||
static inline void *cbfs_unverified_area_map(const char *area, const char *name,
|
||||
size_t *size_out)
|
||||
{
|
||||
return _cbfs_unverified_area_load(area, name, NULL, size_out);
|
||||
}
|
||||
|
||||
static inline size_t cbfs_load(const char *name, void *buf, size_t size)
|
||||
{
|
||||
if (_cbfs_load(name, buf, &size, false))
|
||||
@@ -69,6 +82,15 @@ static inline size_t cbfs_ro_load(const char *name, void *buf, size_t size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline size_t cbfs_unverified_area_load(const char *area, const char *name, void *buf,
|
||||
size_t size)
|
||||
{
|
||||
if (_cbfs_unverified_area_load(area, name, buf, &size))
|
||||
return size;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline size_t cbfs_get_size(const char *name)
|
||||
{
|
||||
union cbfs_mdata mdata;
|
||||
|
Reference in New Issue
Block a user