summaryrefslogtreecommitdiffstats
path: root/common/cmd_time.c
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2012-12-03 06:28:28 +0000
committerTom Rini <trini@ti.com>2013-02-04 09:14:02 -0500
commit34765e88532dfe0f8210baba9f9482de470d2202 (patch)
tree0cfee1c2441fe9f491eaaa377cd481936fc9a004 /common/cmd_time.c
parentb2f3e0ea3e469a759fd74832ce551e3384bc07c0 (diff)
downloadtalos-obmc-uboot-34765e88532dfe0f8210baba9f9482de470d2202.tar.gz
talos-obmc-uboot-34765e88532dfe0f8210baba9f9482de470d2202.zip
cmd_time: merge run_command_and_time_it with cmd_process
As far as every arch has a get_timer function, run_command_and_time_it code can now disappear. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Acked-By: Che-Liang Chiou <clchiou@chromium.org> [trini: s/ulong/unsigned long/ in command.h portion] Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'common/cmd_time.c')
-rw-r--r--common/cmd_time.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/common/cmd_time.c b/common/cmd_time.c
index 6dbdbbfbe7..9808cd6699 100644
--- a/common/cmd_time.c
+++ b/common/cmd_time.c
@@ -22,36 +22,6 @@
#include <common.h>
#include <command.h>
-/*
- * TODO(clchiou): This function actually minics the bottom-half of the
- * run_command() function. Since this function has ARM-dependent timer
- * codes, we cannot merge it with the run_command() for now.
- */
-static int run_command_and_time_it(int flag, int argc, char * const argv[],
- ulong *cycles)
-{
- cmd_tbl_t *cmdtp = find_cmd(argv[0]);
- int retval = 0;
-
- if (!cmdtp) {
- printf("%s: command not found\n", argv[0]);
- return 1;
- }
- if (argc > cmdtp->maxargs)
- return CMD_RET_USAGE;
-
- /*
- * TODO(clchiou): get_timer_masked() is only defined in certain ARM
- * boards. We could use the new timer API that Graeme is proposing
- * so that this piece of code would be arch-independent.
- */
- *cycles = get_timer_masked();
- retval = cmdtp->cmd(cmdtp, flag, argc, argv);
- *cycles = get_timer_masked() - *cycles;
-
- return retval;
-}
-
static void report_time(ulong cycles)
{
ulong minutes, seconds, milliseconds;
@@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong cycles = 0;
int retval = 0;
+ int repeatable;
if (argc == 1)
return CMD_RET_USAGE;
- retval = run_command_and_time_it(0, argc - 1, argv + 1, &cycles);
+ retval = cmd_process(0, argc - 1, argv + 1, &repeatable, &cycles);
report_time(cycles);
return retval;
OpenPOWER on IntegriCloud