summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-01-11 14:07:39 -0800
committerPatrick Georgi <patrick@georgi-clan.de>2012-03-07 14:20:08 +0100
commitc44de4999fbd15b6ea87dc723af49e8035a82476 (patch)
tree58841384ca800dee00dd9e083f3f3170db922620
parent5ec21580f63180551bae762249c24a1888b625bb (diff)
downloadcoreboot-c44de4999fbd15b6ea87dc723af49e8035a82476.tar.xz
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>
-rw-r--r--src/boot/selfboot.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/boot/selfboot.c b/src/boot/selfboot.c
index fe56653923..c45fa63652 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;
}