]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_boot.c
Merge with /home/wd/git/u-boot/master
[karo-tx-uboot.git] / common / cmd_boot.c
index fe8025d3b46f83d6d9cf7740fb2f8187ad3173b2..5b58d4e2f1ff1528ba397a10b068f805b0d37e79 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <net.h>
-#include <syscall.h>
 
 
 /* -------------------------------------------------------------------- */
 
 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;
 
@@ -50,7 +52,21 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
         * pass address parameter as argv[0] (aka command name),
         * and all remaining args
         */
+#if defined(CONFIG_I386)
+       /*
+        * x86 does not use a dedicated register to pass the pointer
+        * to the global_data
+        */
+       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);