summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2009-05-26 14:00:49 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2009-05-26 14:00:49 +0000
commitd1185bfd358fa3d72d94255961926162eff9f609 (patch)
tree2d7ab877d4899526ce195b5f24a0f85e8faf04cc /src/boot
parent58bb497f89aecd57f3e6b66e4b1e35f4af22225b (diff)
downloadcoreboot-d1185bfd358fa3d72d94255961926162eff9f609.tar.xz
Attached patch moves the CBFS payload loader to selfboot.c as it's
the only selfboot user in CBFS. This way, CBFS can be used without importing selfboot.c, as long as no payloads are loaded. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4304 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/selfboot.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/boot/selfboot.c b/src/boot/selfboot.c
index d87fe50c82..faeadba0f0 100644
--- a/src/boot/selfboot.c
+++ b/src/boot/selfboot.c
@@ -71,6 +71,24 @@ struct ip_checksum_vcb {
unsigned short ip_checksum;
};
+void * cbfs_load_payload(struct lb_memory *lb_mem, const char *name)
+{
+ int selfboot(struct lb_memory *mem, struct cbfs_payload *payload);
+ struct cbfs_payload *payload = (struct cbfs_payload *)
+ cbfs_find_file(name, CBFS_TYPE_PAYLOAD);
+
+ struct cbfs_payload_segment *segment, *first_segment;
+
+ if (payload == NULL)
+ return (void *) -1;
+ printk_debug("Got a payload\n");
+ first_segment = segment = &payload->segments;
+ selfboot(lb_mem, payload);
+ printk_emerg("SELFBOOT RETURNED!\n");
+
+ return (void *) -1;
+}
+
/* The problem:
* Static executables all want to share the same addresses
* in memory because only a few addresses are reliably present on