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>
Index: src/include/cbfs.h
===================================================================
--- src/include/cbfs.h	(Revision 1725)
+++ src/include/cbfs.h	(Arbeitskopie)
@@ -166,5 +166,7 @@
 void *cbfs_load_optionrom(u16 vendor, u16 device, void * dest);
 int run_address(void *f);
 
+struct cbfs_stage *cbfs_find_file(const char *name, int type);
+
 #endif
 
Index: src/boot/selfboot.c
===================================================================
--- src/boot/selfboot.c	(Revision 1725)
+++ src/boot/selfboot.c	(Arbeitskopie)
@@ -71,6 +71,24 @@
 	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
Index: src/lib/cbfs.c
===================================================================
--- src/lib/cbfs.c	(Revision 1725)
+++ src/lib/cbfs.c	(Arbeitskopie)
@@ -174,24 +174,6 @@
 	return dest;
 }
 
-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;
-}
-
 void * cbfs_load_stage(const char *name)
 {
 	struct cbfs_stage *stage = (struct cbfs_stage *)
