]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/cmd_boot.c
Merge with /home/wd/git/u-boot/custodian/u-boot-mpc83xx
[people/ms/u-boot.git] / common / cmd_boot.c
index b2f0331dc925c5ea72b935f0e7adde94983fb93b..e68f16f9da022aa805d5e5f79fec0fa7f9f229d2 100644 (file)
 #include <command.h>
 #include <net.h>
 
-
-/* -------------------------------------------------------------------- */
+#if defined(CONFIG_I386)
+DECLARE_GLOBAL_DATA_PTR;
+#endif
 
 int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_I386)
-       DECLARE_GLOBAL_DATA_PTR;
-#endif
        ulong   addr, rc;
        int     rcode = 0;
 
@@ -59,7 +57,14 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
         */
        argv[0] = (char *)gd;
 #endif
+#if !defined(CONFIG_NIOS)
        rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
+#else
+       /*
+        * Nios function pointers are address >> 1
+        */
+       rc = ((ulong (*)(int, char *[]))(addr>>1)) (--argc, &argv[1]);
+#endif
        if (rc != 0) rcode = 1;
 
        printf ("## Application terminated, rc = 0x%lX\n", rc);