diff options
Diffstat (limited to 'payloads/libpayload/libc')
-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; -} |