summaryrefslogtreecommitdiffstats
path: root/commands/go.c
diff options
context:
space:
mode:
authorSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-09-16 11:16:08 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-09-16 11:16:08 +0200
commitca8ae5695a417202f4e4d0f915fd7983e19b481e (patch)
tree4efb1dbf90e0459dc60b9d177ea10f87d8c31567 /commands/go.c
parent1ef73a95bedb32f82017e8891ff917d47396021e (diff)
downloadbarebox-ca8ae5695a417202f4e4d0f915fd7983e19b481e.tar.gz
barebox-ca8ae5695a417202f4e4d0f915fd7983e19b481e.tar.xz
add the possibility to have a arch specific 'go' command. Some
architectures need this (e.g. blackfin and i386)
Diffstat (limited to 'commands/go.c')
-rw-r--r--commands/go.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/commands/go.c b/commands/go.c
index accda18da1..6f0179464c 100644
--- a/commands/go.c
+++ b/commands/go.c
@@ -34,7 +34,7 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int rcode = 0;
if (argc < 2) {
- printf ("Usage:\n%s\n", cmdtp->usage);
+ u_boot_cmd_usage(cmdtp);
return 1;
}
@@ -42,26 +42,11 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("## Starting application at 0x%08lX ...\n", addr);
- /*
- * 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]);
+#ifdef ARCH_HAS_EXECUTE
+ rc = arch_execute(addr, argc, &argv[1]);
#else
- /*
- * Nios function pointers are address >> 1
- */
- rc = ((ulong (*)(int, char *[]))(addr>>1)) (--argc, &argv[1]);
+ rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
#endif
- if (rc != 0) rcode = 1;
printf ("## Application terminated, rc = 0x%lX\n", rc);
return rcode;