diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2018-04-26 10:26:13 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2018-05-16 21:29:56 +0000 |
commit | eeb4e20b2f6d786c92fe3efb30817e90389a2bfe (patch) | |
tree | 8c6ca606c198ce6d0df80ab5db97fbb42911216c | |
parent | 71327fbad86bfb2d6ef343d465d0ce071bb6be0d (diff) |
commonlib/cbfs: Make cbfsf_file_type public
Make cbfsf_file_type public to support detecting the payload type at
runtime. To be used by the following commits.
Possible payload types are:
* simple ELF
* FIT
Change-Id: I37e9fb06f926dc71b001722a6c3b6205a2f20462
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25859
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/commonlib/cbfs.c | 2 | ||||
-rw-r--r-- | src/commonlib/include/commonlib/cbfs.h | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/commonlib/cbfs.c b/src/commonlib/cbfs.c index e14e6c5e61..0210a92202 100644 --- a/src/commonlib/cbfs.c +++ b/src/commonlib/cbfs.c @@ -156,7 +156,7 @@ int cbfsf_decompression_info(struct cbfsf *fh, uint32_t *algo, size_t *size) return 0; } -static int cbfsf_file_type(struct cbfsf *fh, uint32_t *ftype) +int cbfsf_file_type(struct cbfsf *fh, uint32_t *ftype) { const size_t sz = sizeof(*ftype); diff --git a/src/commonlib/include/commonlib/cbfs.h b/src/commonlib/include/commonlib/cbfs.h index 163bef270a..c31df51263 100644 --- a/src/commonlib/include/commonlib/cbfs.h +++ b/src/commonlib/include/commonlib/cbfs.h @@ -71,6 +71,12 @@ size_t cbfs_for_each_attr(void *metadata, size_t metadata_size, int cbfsf_decompression_info(struct cbfsf *fh, uint32_t *algo, size_t *size); /* + * Return the CBFS file type as out-parameter. + * Returns 0 on success and < 0 on error. + */ +int cbfsf_file_type(struct cbfsf *fh, uint32_t *ftype); + +/* * Perform the vb2 hash over the CBFS region skipping empty file contents. * Caller is responsible for providing the hash algorithm as well as storage * for the final digest. Return 0 on success or non-zero on error. |