Introduce a set of CONFIG_LOADER_* configuration options to allow each architecture to specify the loaders that are to be used.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@717 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-03-28 20:18:30 +00:00
committed by Mark Cave-Ayland
parent 63db85036b
commit f78fec5713
16 changed files with 169 additions and 23 deletions

View File

@@ -11,6 +11,8 @@
#include "libopenbios/sys_info.h"
#include "libopenbios/elf_load.h"
#include "libopenbios/aout_load.h"
#include "libopenbios/fcode_load.h"
#include "libopenbios/forth_load.h"
#include "openprom.h"
#include "boot.h"
@@ -33,22 +35,44 @@ static int try_path(const char *path, char *param, const void *romvec)
bootpath = pop_fstr_copy();
printk("Trying %s (%s)\n", path, bootpath);
#ifdef CONFIG_LOADER_ELF
/* ELF Boot loader */
elf_load(&sys_info, path, param, &boot_notes);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
/* Linux loader (not using Forth) */
linux_load(&sys_info, path, param);
#ifdef CONFIG_LOADER_AOUT
/* a.out loader */
aout_load(&sys_info, path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
#ifdef CONFIG_LOADER_FCODE
/* Fcode loader */
fcode_load(path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
#ifdef CONFIG_LOADER_FORTH
/* Forth loader */
forth_load(path);
feval("state-valid @");
valid = POP();
if (valid)
goto start_image;
#endif
return 0;
@@ -78,6 +102,23 @@ start_image:
image_retval = entry(romvec, 0, 0, 0, 0);
break;
case 0x10:
/* Start Fcode image */
printk("Evaluating FCode...\n");
PUSH(address);
PUSH(1);
fword("byte-load");
image_retval = 0;
break;
case 0x11:
/* Start Forth image */
PUSH(address);
PUSH(size);
fword("eval2");
image_retval = 0;
break;
}
printk("Image returned with return value %#x\n", image_retval);