Manage state-valid.

"go" can be done only if init-program has set state-valid to true.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@587 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Laurent Vivier
2009-09-21 22:44:21 +00:00
parent 89f31fbead
commit 428b4b807f
4 changed files with 17 additions and 6 deletions

View File

@@ -17,6 +17,9 @@
\ 7.6.2 Program download and execute
variable state-valid
0 state-valid !
variable file-size
: !load-size file-size ! ;
@@ -305,6 +308,7 @@ variable bootinfo-size
;
: go ( -- )
state-valid @ not if exit then
elf file-type @ = if
[IFDEF] CONFIG_PPC
elf-entry @ " (go)" evaluate
@@ -332,9 +336,6 @@ variable bootinfo-size
then
;
: state-valid ( -- a-addr )
;
\ 7.6.3 Abort and resume

View File

@@ -124,6 +124,8 @@ bootinfo_loader_init_program( void *dummy )
char *tmp;
char bootpath[1024];
feval("0 state-valid !");
chosen = find_dev("/chosen");
tmp = get_property(chosen, "bootpath", &proplen);
memcpy(bootpath, tmp, proplen);
@@ -179,9 +181,7 @@ bootinfo_loader_init_program( void *dummy )
DPRINTF("got bootscript %s\n",
bootscript);
/* FIXME: should initialize saved-program-state. */
push_str(bootscript);
feval("bootinfo-size ! bootinfo-entry !");
feval("-1 state-valid !");
break;
} else if (strcasecmp(tagbuf, "/chrp-boot") == 0)
@@ -230,6 +230,9 @@ bootinfo_loader_init_program( void *dummy )
bootscript[scriptlen++] = c;
}
}
/* FIXME: should initialize saved-program-state. */
push_str(bootscript);
feval("bootinfo-size ! bootinfo-entry !");
}
NODE_METHODS( bootinfo_loader ) = {

View File

@@ -50,6 +50,8 @@ elf_loader_init_program( void *dummy )
size_t size;
char *addr;
feval("0 state-valid !");
feval("load-base");
base = (char*)POP();
@@ -78,6 +80,7 @@ elf_loader_init_program( void *dummy )
/* FIXME: should initialize saved-program-state. */
PUSH(ehdr->e_entry);
feval("elf-entry !");
feval("-1 state-valid !");
}
NODE_METHODS( elf_loader ) = {

View File

@@ -47,6 +47,8 @@ xcoff_loader_init_program( void *dummy )
uint32_t offset;
int i;
feval("0 state-valid !");
feval("load-base");
base = (char*)POP();
@@ -128,6 +130,8 @@ xcoff_loader_init_program( void *dummy )
DPRINTF("XCOFF entry point: %x\n", *(uint32_t*)ahdr->entry);
PUSH(*(uint32_t*)ahdr->entry);
feval("xcoff-entry !");
feval("-1 state-valid !");
}
NODE_METHODS( xcoff_loader ) = {