[OpenBIOS] r587 - in trunk/openbios-devel: forth/debugging modules

svn at openbios.org svn at openbios.org
Tue Sep 22 00:44:21 CEST 2009


Author: laurent
Date: 2009-09-22 00:44:21 +0200 (Tue, 22 Sep 2009)
New Revision: 587

Modified:
   trunk/openbios-devel/forth/debugging/client.fs
   trunk/openbios-devel/modules/bootinfo-loader.c
   trunk/openbios-devel/modules/elf-loader.c
   trunk/openbios-devel/modules/xcoff-loader.c
Log:
Manage state-valid.
"go" can be done only if init-program has set state-valid to true.

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



Modified: trunk/openbios-devel/forth/debugging/client.fs
===================================================================
--- trunk/openbios-devel/forth/debugging/client.fs	2009-09-21 15:30:50 UTC (rev 586)
+++ trunk/openbios-devel/forth/debugging/client.fs	2009-09-21 22:44:21 UTC (rev 587)
@@ -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 @@
   ;
 
 : go    ( -- )
+  state-valid @ not if exit then
   elf file-type @ = if
 [IFDEF] CONFIG_PPC
     elf-entry @ " (go)" evaluate
@@ -332,10 +336,7 @@
   then
   ;
 
-: state-valid    ( -- a-addr )
-  ;
 
-
 \ 7.6.3    Abort and resume
 
 \ already defined !?

Modified: trunk/openbios-devel/modules/bootinfo-loader.c
===================================================================
--- trunk/openbios-devel/modules/bootinfo-loader.c	2009-09-21 15:30:50 UTC (rev 586)
+++ trunk/openbios-devel/modules/bootinfo-loader.c	2009-09-21 22:44:21 UTC (rev 587)
@@ -124,6 +124,8 @@
         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 @@
 					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 @@
 			bootscript[scriptlen++] = c;
 		}
 	}
+	/* FIXME: should initialize saved-program-state. */
+	push_str(bootscript);
+	feval("bootinfo-size ! bootinfo-entry !");
 }
 
 NODE_METHODS( bootinfo_loader ) = {

Modified: trunk/openbios-devel/modules/elf-loader.c
===================================================================
--- trunk/openbios-devel/modules/elf-loader.c	2009-09-21 15:30:50 UTC (rev 586)
+++ trunk/openbios-devel/modules/elf-loader.c	2009-09-21 22:44:21 UTC (rev 587)
@@ -50,6 +50,8 @@
 	size_t size;
 	char *addr;
 
+	feval("0 state-valid !");
+
 	feval("load-base");
 	base = (char*)POP();
 
@@ -78,6 +80,7 @@
 	/* FIXME: should initialize saved-program-state. */
 	PUSH(ehdr->e_entry);
 	feval("elf-entry !");
+	feval("-1 state-valid !");
 }
 
 NODE_METHODS( elf_loader ) = {

Modified: trunk/openbios-devel/modules/xcoff-loader.c
===================================================================
--- trunk/openbios-devel/modules/xcoff-loader.c	2009-09-21 15:30:50 UTC (rev 586)
+++ trunk/openbios-devel/modules/xcoff-loader.c	2009-09-21 22:44:21 UTC (rev 587)
@@ -47,6 +47,8 @@
 	uint32_t offset;
 	int i;
 
+	feval("0 state-valid !");
+
 	feval("load-base");
 	base = (char*)POP();
 
@@ -128,6 +130,8 @@
 	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 ) = {




More information about the OpenBIOS mailing list