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>
This commit is contained in:
Aaron Durbin
2015-03-20 16:37:12 -05:00
committed by Aaron Durbin
parent b3847e6424
commit ce9efe061a
11 changed files with 62 additions and 99 deletions

View File

@ -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;