take target and entry from load_address and entry_address instead of compiled in...
authorlothar <lothar>
Wed, 8 Jul 2009 10:47:19 +0000 (10:47 +0000)
committerlothar <lothar>
Wed, 8 Jul 2009 10:47:19 +0000 (10:47 +0000)
packages/hal/arm/arch/v2_0/src/redboot_linux_exec.c

index abb99e1..2e7bd82 100644 (file)
@@ -333,10 +333,14 @@ do_exec(int argc, char *argv[])
                diag_printf("Can't execute Linux - invalid entry address\n");
                return;
        }
+#if 1
+       target = load_address;
+       entry = entry_address;
+#else
        // Default physical entry point for Linux is kernel base.
        entry = (unsigned long)CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS;
        target = (unsigned long)CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS;
-
+#endif
        base_addr = load_address;
        length = load_address_end - load_address;
        // Round length up to the next quad word
@@ -360,7 +364,7 @@ do_exec(int argc, char *argv[])
        num_opts = 7;
 #ifdef CYGHWR_REDBOOT_LINUX_EXEC_X_SWITCH
        init_opts(&opts[num_opts], 'x', false, OPTION_ARG_TYPE_FLG, 
-                         &swap_endian, 0, "swap endianess");
+                         &swap_endian, 0, "swap endianness");
        ++num_opts;
 #endif
        if (!scan_opts(argc, argv, 1, opts, num_opts, &entry,
@@ -485,7 +489,7 @@ do_exec(int argc, char *argv[])
                                          "r"(CYGARC_PHYSICAL_ADDRESS(base_addr)),
                                          "r"(length),
                                          "r"(CYGHWR_REDBOOT_ARM_MACHINE_TYPE),
-                                         "r"(CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS),
+                                         "r"(target),
                                          "r"(CYGARC_PHYSICAL_ADDRESS(CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS)),
                                          "r"(CYGARC_PHYSICAL_ADDRESS(CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS))
                                          : "r0", "r1"