summaryrefslogtreecommitdiff
path: root/src/lib/selfboot.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-05-20 12:08:55 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-06-02 14:10:08 +0200
commitac12c66cf91343153ea90a6f33977a13e10b21d0 (patch)
tree2864de25bb12ed2d5c7ec8d691ec753f146c5e57 /src/lib/selfboot.c
parent6a452eff90411176f9f2cad0ca0c665a31c032ee (diff)
assets: abstract away the firmware assets used for booting
As there can be more than one source of firmware assets this patch generalizes the notion of locating a particular asset. struct asset is added along with some helper functions for working on assets as a first class citizen. Change-Id: I2ce575d1e5259aed4c34c3dcfd438abe9db1d7b9 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10264 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/lib/selfboot.c')
-rw-r--r--src/lib/selfboot.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index 3f8cc6fb18..94a75bef2e 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -454,7 +454,7 @@ void *selfload(struct prog *payload)
struct segment head;
void *data;
- data = rdev_mmap_full(&payload->rdev);
+ data = rdev_mmap_full(prog_rdev(payload));
if (data == NULL)
return NULL;
@@ -469,7 +469,10 @@ void *selfload(struct prog *payload)
printk(BIOS_SPEW, "Loaded segments\n");
- rdev_munmap(&payload->rdev, data);
+ rdev_munmap(prog_rdev(payload), data);
+
+ /* Update the payload's area with the bounce buffer information. */
+ prog_set_area(payload, (void *)(uintptr_t)bounce_buffer, bounce_size);
/* Update the payload's area with the bounce buffer information. */
prog_set_area(payload, (void *)(uintptr_t)bounce_buffer, bounce_size);
@@ -477,6 +480,6 @@ void *selfload(struct prog *payload)
return (void *)entry;
out:
- rdev_munmap(&payload->rdev, data);
+ rdev_munmap(prog_rdev(payload), data);
return NULL;
}