]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_time.c
Unified codebase for TX28, TX48, TX51, TX53
[karo-tx-uboot.git] / common / cmd_time.c
index 6dbdbbfbe7a3eeeef03d1880d53817d76b901a62..76683ad7aa63b7a0a156cb4bc563ced0468ba437 100644 (file)
  * 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[],
+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;
+       unsigned long start;
 
        if (!cmdtp) {
                printf("%s: command not found\n", argv[0]);
@@ -40,14 +41,9 @@ static int run_command_and_time_it(int flag, int argc, char * const argv[],
        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();
+       start = get_timer(0);
        retval = cmdtp->cmd(cmdtp, flag, argc, argv);
-       *cycles = get_timer_masked() - *cycles;
+       *cycles = get_timer(start);
 
        return retval;
 }