]> www.infradead.org Git - users/rw/armboot.git/commitdiff
Fixed bugs in ramdisk image relocation, thanks to Mladen Barjaktarevic
authorrobertkaiser <robertkaiser>
Fri, 14 Mar 2003 17:59:25 +0000 (17:59 +0000)
committerrobertkaiser <robertkaiser>
Fri, 14 Mar 2003 17:59:25 +0000 (17:59 +0000)
<mladen.barjaktarevic@hermes.si> for spotting this

common/armlinux.c

index cd9d31912c8aade7c121625f96b107e91a10d856..8878889f68a7a625021ac0705c911fa075ac91c6 100644 (file)
@@ -61,6 +61,12 @@ void boot_linux(cmd_tbl_t *cmdtp,
     void (*theKernel)(int zero, int arch);
     image_header_t *hdr = &header;
 
+    /*
+     * get the kernel entry address *before* we possibly
+     * clobber the header buffer when verifying a ramdisk image
+     */
+    theKernel = (void (*)(int, int))SWAP32(hdr->ih_ep);
+   
     /*
      * Check if there is an initrd image
      */
@@ -146,7 +152,7 @@ void boot_linux(cmd_tbl_t *cmdtp,
 #endif
     
     if (data) {
-       initrd_start = data;
+       initrd_start = SWAP32(hdr->ih_load);
        initrd_end   = initrd_start + len;
        printf ("   Loading Ramdisk to %08lx, end %08lx ... ",
                initrd_start, initrd_end);
@@ -157,8 +163,6 @@ void boot_linux(cmd_tbl_t *cmdtp,
        initrd_end = 0;
     }
     
-    theKernel = (void (*)(int, int))SWAP32(hdr->ih_ep);
-   
 #ifdef DEBUG
     printf ("## Transferring control to Linux (at address %08lx) ...\n",
            (ulong)theKernel);