summaryrefslogtreecommitdiffstats
path: root/common/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/command.c')
-rw-r--r--common/command.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/common/command.c b/common/command.c
index 30a9801..d47d719 100644
--- a/common/command.c
+++ b/common/command.c
@@ -160,6 +160,7 @@ int cmd_usage(cmd_tbl_t *cmdtp)
int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
{
+#if 0 /* need to reimplement */
static char tmp_buf[512];
int space;
@@ -170,7 +171,7 @@ int var_complete(int argc, char * const argv[], char last_char, int maxv, char *
if (!space && argc == 2)
return env_complete(argv[1], maxv, cmdv, sizeof(tmp_buf), tmp_buf);
-
+#endif
return 0;
}
@@ -464,3 +465,40 @@ int cmd_get_data_size(char* arg, int default_size)
return default_size;
}
#endif
+
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+DECLARE_GLOBAL_DATA_PTR;
+
+void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
+{
+ int i;
+
+ if (gd->reloc_off == 0)
+ return;
+
+ for (i = 0; i < size; i++) {
+ ulong addr;
+
+ addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
+#if DEBUG_COMMANDS
+ printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
+ cmdtp->name, (ulong) (cmdtp->cmd), addr);
+#endif
+ cmdtp->cmd =
+ (int (*)(struct cmd_tbl_s *, int, int, char * const []))addr;
+ addr = (ulong)(cmdtp->name) + gd->reloc_off;
+ cmdtp->name = (char *)addr;
+ if (cmdtp->usage) {
+ addr = (ulong)(cmdtp->usage) + gd->reloc_off;
+ cmdtp->usage = (char *)addr;
+ }
+#ifdef CONFIG_SYS_LONGHELP
+ if (cmdtp->help) {
+ addr = (ulong)(cmdtp->help) + gd->reloc_off;
+ cmdtp->help = (char *)addr;
+ }
+#endif
+ cmdtp++;
+ }
+}
+#endif