This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] redboot: reset entry address before load


Hi,

Redboot's do_load() doesn't reset the entry address if an upload
fails, so go/exec happily tries to jump to the incomplete code if you
do something like:

load file1; fis create file1; load file2; go

The following patch fixes that.

Index: redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.251
diff -u -r1.251 ChangeLog
--- redboot/current/ChangeLog	19 Dec 2006 03:11:41 -0000	1.251
+++ redboot/current/ChangeLog	22 Jan 2007 09:42:21 -0000
@@ -1,3 +1,8 @@
+2007-01-22  Peter Korsgaard  <peter.korsgaard@barco.com>
+
+	* src/load.c (do_load): Reset entry address before load so
+	go/exec commands will fail after an incomplete upload.
+
 2006-11-28  David Fernandez  <dfernandez@cct.co.uk>
 
 	* cdl/redboot.cdl: Modified to change the option
Index: redboot/current/src/load.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/load.c,v
retrieving revision 1.48
diff -u -r1.48 load.c
--- redboot/current/src/load.c	30 Nov 2006 17:03:52 -0000	1.48
+++ redboot/current/src/load.c	22 Jan 2007 09:42:21 -0000
@@ -720,6 +720,10 @@
                    (void *)&filename, OPTION_ARG_TYPE_STR, "file name")) {
         return;
     }
+
+    /* make sure any future go/exec's will fail until a successful upload */
+    entry_address = (unsigned long)NO_MEMORY;
+
 #ifdef CYGPKG_REDBOOT_NETWORKING
     if (hostname_set) {
         ip_route_t rt;

-- 
Bye, Peter Korsgaard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]