diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cbfs.c | 4 | ||||
-rw-r--r-- | src/lib/fmap.c | 14 | ||||
-rw-r--r-- | src/lib/prog_loaders.c | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 23e8f41db1..32ebfafbf6 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -89,7 +89,7 @@ int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type) return -1; size_t msize = be32toh(fh->mdata.h.offset); - if (rdev_chain(&fh->metadata, &addrspace_32bit.rdev, (uintptr_t)&fh->mdata, msize)) + if (rdev_chain_mem(&fh->metadata, &fh->mdata, msize)) return -1; if (type) { @@ -436,7 +436,7 @@ cb_err_t cbfs_prog_stage_load(struct prog *pstage) void *compr_start = prog_start(pstage) + prog_size(pstage) - in_size; if (rdev_readat(&rdev, compr_start, 0, in_size) != in_size) return CB_ERR; - rdev_chain(&rdev, &addrspace_32bit.rdev, (uintptr_t)compr_start, in_size); + rdev_chain_mem(&rdev, compr_start, in_size); } size_t fsize = cbfs_load_and_decompress(&rdev, prog_start(pstage), prog_size(pstage), diff --git a/src/lib/fmap.c b/src/lib/fmap.c index 418e715b3e..254d7877f6 100644 --- a/src/lib/fmap.c +++ b/src/lib/fmap.c @@ -16,7 +16,7 @@ */ static int fmap_print_once; -static struct mem_region_device fmap_cache; +static struct region_device fmap_cache; #define print_once(...) do { \ if (!fmap_print_once) \ @@ -53,7 +53,7 @@ static void report(const struct fmap *fmap) fmap_print_once = 1; } -static void setup_preram_cache(struct mem_region_device *cache_mrdev) +static void setup_preram_cache(struct region_device *cache_rdev) { if (CONFIG(NO_FMAP_CACHE)) return; @@ -99,7 +99,7 @@ static void setup_preram_cache(struct mem_region_device *cache_mrdev) report(fmap); register_cache: - mem_region_device_ro_init(cache_mrdev, fmap, FMAP_SIZE); + rdev_chain_mem(cache_rdev, fmap, FMAP_SIZE); } static int find_fmap_directory(struct region_device *fmrd) @@ -109,10 +109,10 @@ static int find_fmap_directory(struct region_device *fmrd) size_t offset = FMAP_OFFSET; /* Try FMAP cache first */ - if (!region_device_sz(&fmap_cache.rdev)) + if (!region_device_sz(&fmap_cache)) setup_preram_cache(&fmap_cache); - if (region_device_sz(&fmap_cache.rdev)) - return rdev_chain_full(fmrd, &fmap_cache.rdev); + if (region_device_sz(&fmap_cache)) + return rdev_chain_full(fmrd, &fmap_cache); boot_device_init(); boot = boot_device_ro(); @@ -281,7 +281,7 @@ static void fmap_register_cbmem_cache(int unused) if (!e) return; - mem_region_device_ro_init(&fmap_cache, cbmem_entry_start(e), cbmem_entry_size(e)); + rdev_chain_mem(&fmap_cache, cbmem_entry_start(e), cbmem_entry_size(e)); } /* diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c index 28c6bf7978..40f51ebf48 100644 --- a/src/lib/prog_loaders.c +++ b/src/lib/prog_loaders.c @@ -16,10 +16,6 @@ #include <timestamp.h> #include <security/vboot/vboot_common.h> -/* Only can represent up to 1 byte less than size_t. */ -const struct mem_region_device addrspace_32bit = - MEM_REGION_DEV_RO_INIT(0, ~0UL); - void run_romstage(void) { struct prog romstage = |