diff options
author | Aaron Durbin <adurbin@chromium.org> | 2015-03-20 16:37:12 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@google.com> | 2015-04-03 14:53:11 +0200 |
commit | ce9efe061a23bc3e3d2a4c17cf29692ce6f9eb53 (patch) | |
tree | 4c7715b3d7869bb3282751f536450e653dc83dbe /src/lib/selfboot.c | |
parent | b3847e64242228166976f425cd42331db7857551 (diff) |
program loading: unify on struct prog
Instead of having different structures for loading
ramstage and payload align to using struct prog.
This also removes arch_payload_run() in favor of
the prog_run() interface.
Change-Id: I31483096094eacc713a7433811cd69cc5621c43e
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8849
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/lib/selfboot.c')
-rw-r--r-- | src/lib/selfboot.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index 164dce90de..bd4c1690ac 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -214,13 +214,13 @@ static int relocate_segment(unsigned long buffer, struct segment *seg) static int build_self_segment_list( struct segment *head, - struct payload *payload, uintptr_t *entry) + struct prog *payload, uintptr_t *entry) { struct segment *new; struct segment *ptr; struct cbfs_payload_segment *segment, *first_segment; struct cbfs_payload *cbfs_payload; - cbfs_payload = prog_start(&payload->prog); + cbfs_payload = prog_start(payload); memset(head, 0, sizeof(*head)); head->next = head->prev = head; first_segment = segment = &cbfs_payload->segments; @@ -311,7 +311,7 @@ static int build_self_segment_list( static int load_self_segments( struct segment *head, - struct payload *payload) + struct prog *payload) { struct segment *ptr; struct segment *last_non_empty; @@ -365,10 +365,6 @@ static int load_self_segments( return 0; } - /* Update the payload's bounce buffer data used when loading. */ - payload->bounce.data = (void *)(uintptr_t)bounce_buffer; - payload->bounce.size = bounce_size; - for(ptr = head->next; ptr != head; ptr = ptr->next) { unsigned char *dest, *src; printk(BIOS_DEBUG, "Loading Segment: addr: 0x%016lx memsz: 0x%016lx filesz: 0x%016lx\n", @@ -454,10 +450,13 @@ static int load_self_segments( } } + /* Update the payload's area with the bounce buffer information. */ + prog_set_area(payload, (void *)(uintptr_t)bounce_buffer, bounce_size); + return 1; } -void *selfload(struct payload *payload) +void *selfload(struct prog *payload) { uintptr_t entry = 0; struct segment head; |