Patrick Georgi (patrick@georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/768
-gerrit
commit aa352de0cd09bdf80f5898eefd4537400ed7cc66 Author: Stefan Reinauer reinauer@chromium.org Date: Wed Jan 11 14:07:39 2012 -0800
selfboot: drop dead code
As a left over from elfboot times, selfboot keeps the segments to load in the order in which they appeared in the original file as well as in the order they will later appear in memory. This is not needed in selfboot, so drop the code and structure members that handle the in-file order.
Change-Id: I6be7a3a1bdf717fec1ee8e5b3227c63150580b41 Signed-off-by: Stefan Reinauer reinauer@google.com --- src/boot/selfboot.c | 25 ++++--------------------- 1 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/src/boot/selfboot.c b/src/boot/selfboot.c index fe56653..c45fa63 100644 --- a/src/boot/selfboot.c +++ b/src/boot/selfboot.c @@ -45,8 +45,6 @@ static const unsigned long lb_end = (unsigned long)&_eram_seg; struct segment { struct segment *next; struct segment *prev; - struct segment *phdr_next; - struct segment *phdr_prev; unsigned long s_dstaddr; unsigned long s_srcaddr; unsigned long s_memsz; @@ -226,11 +224,6 @@ static int relocate_segment(unsigned long buffer, struct segment *seg) new->prev = seg->prev; seg->prev->next = new; seg->prev = new; - /* Order by original program header order */ - new->phdr_next = seg; - new->phdr_prev = seg->phdr_prev; - seg->phdr_prev->phdr_next = new; - seg->phdr_prev = new;
/* compute the new value of start */ start = seg->s_dstaddr; @@ -266,11 +259,6 @@ static int relocate_segment(unsigned long buffer, struct segment *seg) new->prev = seg; seg->next->prev = new; seg->next = new; - /* Order by original program header order */ - new->phdr_next = seg->phdr_next; - new->phdr_prev = seg; - seg->phdr_next->phdr_prev = new; - seg->phdr_next = new;
printk(BIOS_SPEW, " late: [0x%016lx, 0x%016lx, 0x%016lx)\n", new->s_dstaddr, @@ -304,7 +292,6 @@ static int build_self_segment_list( struct segment *ptr; struct cbfs_payload_segment *segment, *first_segment; memset(head, 0, sizeof(*head)); - head->phdr_next = head->phdr_prev = head; head->next = head->prev = head; first_segment = segment = &payload->segments;
@@ -367,9 +354,10 @@ static int build_self_segment_list( return -1; }
+ /* We have found another CODE, DATA or BSS segment */ segment++;
- // FIXME: Explain what this is + /* Find place where to insert our segment */ for(ptr = head->next; ptr != head; ptr = ptr->next) { if (new->s_srcaddr < ntohll(segment->load_addr)) break; @@ -380,12 +368,6 @@ static int build_self_segment_list( new->prev = ptr->prev; ptr->prev->next = new; ptr->prev = new; - - /* Order by original program header order */ - new->phdr_next = head; - new->phdr_prev = head->phdr_prev; - head->phdr_prev->phdr_next = new; - head->phdr_prev = new; }
return 1; @@ -400,7 +382,8 @@ static int load_self_segments(
unsigned long bounce_high = lb_end; for(ptr = head->next; ptr != head; ptr = ptr->next) { - if (!overlaps_coreboot(ptr)) continue; + if (!overlaps_coreboot(ptr)) + continue; if (ptr->s_dstaddr + ptr->s_memsz > bounce_high) bounce_high = ptr->s_dstaddr + ptr->s_memsz; }