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>
Reviewed-on: http://review.coreboot.org/768
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Stefan Reinauer 2012-01-11 14:07:39 -08:00 committed by Patrick Georgi
parent 5ec21580f6
commit c44de4999f
1 changed files with 4 additions and 21 deletions

View File

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