diff options
author | Aaron Durbin <adurbin@chromium.org> | 2015-05-15 23:25:46 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2015-05-26 22:34:23 +0200 |
commit | 4e50cdd979c03a0d64cc1b4c9ada45822aa6d346 (patch) | |
tree | ea3dd5b45f7bb56d68a07ad94421e6cd7bd0b99c /src/vendorcode/google/chromeos/vboot_common.c | |
parent | 0424c95a6dafdb65070538d6c5aa394b75eb9850 (diff) | |
download | coreboot-4e50cdd979c03a0d64cc1b4c9ada45822aa6d346.tar.xz |
vboot: move to region_devices
Now that vboot is using offsets for everything remove the
pass through vboot_get_region() and use region_devices
as first class citizens.
Change-Id: I1a86f3725e5bce38e6ca31e9641b1a8f4ac50e96
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10225
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/vendorcode/google/chromeos/vboot_common.c')
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.c | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c index 1db9d96aea..2fd29b6bfe 100644 --- a/src/vendorcode/google/chromeos/vboot_common.c +++ b/src/vendorcode/google/chromeos/vboot_common.c @@ -31,34 +31,14 @@ #include "vboot_common.h" #include "vboot_handoff.h" -void vboot_locate_region(const char *name, struct region *region) +int vboot_named_region_device(const char *name, struct region_device *rdev) { - if (fmap_locate_area(name, region)) - region->size = 0; + return fmap_locate_area_as_rdev(name, rdev); } -void *vboot_get_region(size_t offset, size_t size, void *dest) +int vboot_region_device(const struct region *reg, struct region_device *rdev) { - const struct region_device *boot_dev; - struct region_device rdev; - - boot_device_init(); - boot_dev = boot_device_ro(); - - if (boot_dev == NULL) - return NULL; - - if (rdev_chain(&rdev, boot_dev, offset, size)) - return NULL; - - /* Each call will leak a mapping. */ - if (dest == NULL) - return rdev_mmap_full(&rdev); - - if (rdev_readat(&rdev, dest, 0, size) != size) - return NULL; - - return dest; + return boot_device_ro_subregion(reg, rdev); } int vboot_get_handoff_info(void **addr, uint32_t *size) @@ -75,23 +55,6 @@ int vboot_get_handoff_info(void **addr, uint32_t *size) return 0; } -/* This will leak a mapping of a fw region */ -struct vboot_components *vboot_locate_components(struct region *region) -{ - size_t req_size; - struct vboot_components *vbc; - - req_size = sizeof(*vbc); - req_size += sizeof(struct vboot_component_entry) * - MAX_PARSED_FW_COMPONENTS; - - vbc = vboot_get_region(region_offset(region), req_size, NULL); - if (vbc && vbc->num_components > MAX_PARSED_FW_COMPONENTS) - vbc = NULL; - - return vbc; -} - void vboot_reboot(void) { if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART)) |