diff options
author | Julius Werner <jwerner@chromium.org> | 2024-02-20 13:42:17 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2024-02-22 21:18:39 +0000 |
commit | 1e113bc8783837fb8c2ad12d8984e33bbeab486f (patch) | |
tree | c8608a783daaa8c74c968ffca3252063e12fa124 /payloads/libpayload/libc/fmap.c | |
parent | 4ed5b1723d19c349d9a1f6be1351b8394652ea7e (diff) |
libpayload: Remove legacy CBFS API
It's been several years already since we announced the deprecation of
the legacy CBFS API for payloads. It's time to remove it completely.
Change-Id: I0ed157ac2d1376b8dff4537af9a63731064b45f6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80650
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Diffstat (limited to 'payloads/libpayload/libc/fmap.c')
-rw-r--r-- | payloads/libpayload/libc/fmap.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/payloads/libpayload/libc/fmap.c b/payloads/libpayload/libc/fmap.c index 2ee9e3eeaa..87a531a6a7 100644 --- a/payloads/libpayload/libc/fmap.c +++ b/payloads/libpayload/libc/fmap.c @@ -78,56 +78,3 @@ enum cb_err fmap_locate_area(const char *name, size_t *offset, size_t *size) return fmap_find_area(_fmap_cache, name, offset, size); } - -/*********************************************************************************************** - * LEGACY CODE * - **********************************************************************************************/ - -int fmap_region_by_name(const uint32_t fmap_offset, const char * const name, - uint32_t * const offset, uint32_t * const size) -{ - int i; - - struct fmap *fmap; - struct fmap fmap_head; - struct cbfs_media default_media; - struct cbfs_media *media = &default_media; - - if (init_default_cbfs_media(media) != 0) - return -1; - - media->open(media); - - if (!media->read(media, &fmap_head, fmap_offset, sizeof(fmap_head))) - return -1; - - if (memcmp(fmap_head.signature, FMAP_SIGNATURE, sizeof(fmap_head.signature))) { - return -1; - } - - int fmap_size = sizeof(*fmap) + - fmap_head.nareas * sizeof(struct fmap_area); - - fmap = malloc(fmap_size); - if (!fmap) - return -1; - - if (!media->read(media, fmap, fmap_offset, fmap_size)) - goto err; - - media->close(media); - - for (i = 0; i < fmap->nareas; i++) { - if (strcmp((const char *)fmap->areas[i].name, name) != 0) - continue; - if (offset) - *offset = fmap->areas[i].offset; - if (size) - *size = fmap->areas[i].size; - free(fmap); - return 0; - } -err: - free(fmap); - return -1; -} |