Since the original boot code had been previously refactored to make use of saved-program-state, we can take the existing code

and with only slight modification use it as a C implementation of the go word.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@727 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-04-02 13:29:12 +00:00
committed by Mark Cave-Ayland
parent 1b273803c2
commit a025a2e653
6 changed files with 47 additions and 20 deletions

View File

@@ -23,8 +23,7 @@ struct sys_info sys_info;
static int try_path(const char *path, char *param)
{
void *boot_notes = NULL;
ucell valid, address, type, size;
int image_retval = 0;;
ucell valid;
#ifdef CONFIG_LOADER_ELF
/* ELF Boot loader */
@@ -69,6 +68,16 @@ static int try_path(const char *path, char *param)
start_image:
go();
return -1;
}
void go(void)
{
ucell address, type, size;
int image_retval = 0;
/* Get the entry point and the type (see forth/debugging/client.fs) */
feval("saved-program-state >sps.entry @");
address = POP();
@@ -109,10 +118,9 @@ start_image:
}
printk("Image returned with return value %#x\n", image_retval);
return -1;
}
void boot(void)
{
char *path=pop_fstr_copy(), *param;

View File

@@ -15,4 +15,5 @@ unsigned int start_elf(unsigned long entry_point, unsigned long param);
/* boot.c */
extern struct sys_info sys_info;
void boot(void);
extern void boot(void);
extern void go(void);