summaryrefslogtreecommitdiff
path: root/common/command.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/command.c
parentb2f3e0ea3e469a759fd74832ce551e3384bc07c0 (diff)
downloadu-boot-imx-34765e88532dfe0f8210baba9f9482de470d2202.zip
u-boot-imx-34765e88532dfe0f8210baba9f9482de470d2202.tar.gz
u-boot-imx-34765e88532dfe0f8210baba9f9482de470d2202.tar.bz2
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/command.c')
-rw-r--r--common/command.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/command.c b/common/command.c
index 50c8429..305a236 100644
--- a/common/command.c
+++ b/common/command.c
@@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
- int *repeatable)
+ int *repeatable, ulong *ticks)
{
enum command_ret_t rc = CMD_RET_SUCCESS;
cmd_tbl_t *cmdtp;
@@ -543,7 +543,11 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
/* If OK so far, then do the command */
if (!rc) {
+ if (ticks)
+ *ticks = get_timer(0);
rc = cmd_call(cmdtp, flag, argc, argv);
+ if (ticks)
+ *ticks = get_timer(*ticks);
*repeatable &= cmdtp->repeatable;
}
if (rc == CMD_RET_USAGE)