This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
ARM - fix 'exec' command test for valid data
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Wed, 07 Jul 2004 09:45:23 -0600
- Subject: ARM - fix 'exec' command test for valid data
- Organization: MLB Associates
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.98
diff -u -5 -p -r1.98 ChangeLog
--- hal/arm/arch/current/ChangeLog 27 May 2004 13:22:05 -0000 1.98
+++ hal/arm/arch/current/ChangeLog 7 Jul 2004 15:43:59 -0000
@@ -1,5 +1,10 @@
+2004-07-07 Gary Thomas <gary@mlbassoc.com>
+
+ * src/redboot_linux_exec.c (do_exec): Fix test for valid entry
+ (was being overwritten by command line parameter)
+
2004-05-27 Gary Thomas <gary@mlbassoc.com>
* src/redboot_linux_exec.c (do_exec): Be sensitive to value in
"entry_address" as this can indicate if the image to be executed
is valid (the "load" functions set it to "NO_MEMORY" when invalid)
Index: hal/arm/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.11
diff -u -5 -p -r1.11 redboot_linux_exec.c
--- hal/arm/arch/current/src/redboot_linux_exec.c 27 May 2004 13:22:07 -0000 1.11
+++ hal/arm/arch/current/src/redboot_linux_exec.c 7 Jul 2004 13:55:13 -0000
@@ -289,10 +289,15 @@ do_exec(int argc, char *argv[])
char line[8];
char *cmd_line;
struct tag *params = (struct tag *)CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS;
extern char __tramp_start__[], __tramp_end__[];
+ // Check to see if a valid image has been loaded
+ if (entry_address == (unsigned long)NO_MEMORY) {
+ diag_printf("Can't execute Linux - invalid entry address\n");
+ return;
+ }
// Default physical entry point for Linux is kernel base.
entry = (unsigned long)CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS;
base_addr = load_address;
length = load_address_end - load_address;
@@ -312,14 +317,10 @@ do_exec(int argc, char *argv[])
(void **)&ramdisk_addr, (bool *)&ramdisk_addr_set, "ramdisk_addr");
init_opts(&opts[5], 's', true, OPTION_ARG_TYPE_NUM,
(void **)&ramdisk_size, (bool *)&ramdisk_size_set, "ramdisk_size");
if (!scan_opts(argc, argv, 1, opts, 6, (void *)&entry, OPTION_ARG_TYPE_NUM, "[physical] starting address"))
{
- return;
- }
- if (entry == (unsigned long)NO_MEMORY) {
- diag_printf("Can't execute Linux - invalid entry address\n");
return;
}
// Set up parameters to pass to kernel