diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 12:08:42 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 13:52:19 +0200 |
commit | e0dd8a5ad830798bc8082b03b8c42c32fb9660e0 (patch) | |
tree | d147bfc4d670fcdfbd2e2d2e75eb209f92e07df1 /c/src/lib/libbsp/arm/gumstix | |
parent | bsps: Move startup files to bsps (diff) | |
download | rtems-e0dd8a5ad830798bc8082b03b8c42c32fb9660e0.tar.bz2 |
bsps: Move benchmark timer to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/arm/gumstix')
-rw-r--r-- | c/src/lib/libbsp/arm/gumstix/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gumstix/timer/timer.c | 75 |
2 files changed, 1 insertions, 76 deletions
diff --git a/c/src/lib/libbsp/arm/gumstix/Makefile.am b/c/src/lib/libbsp/arm/gumstix/Makefile.am index 4f36cded13..6eac30b7c9 100644 --- a/c/src/lib/libbsp/arm/gumstix/Makefile.am +++ b/c/src/lib/libbsp/arm/gumstix/Makefile.am @@ -27,7 +27,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gumstix/start/memmap.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterread.c librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/cpucounter/cpucounterdiff.c librtemsbsp_a_SOURCES +=../../../../../../bsps/arm/gumstix/clock/clock.c -librtemsbsp_a_SOURCES += timer/timer.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/gumstix/btimer/btimer.c #console librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/legacy-console.c diff --git a/c/src/lib/libbsp/arm/gumstix/timer/timer.c b/c/src/lib/libbsp/arm/gumstix/timer/timer.c deleted file mode 100644 index 7eb3d5b811..0000000000 --- a/c/src/lib/libbsp/arm/gumstix/timer/timer.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * @brief PXA255 timer - */ - -/* - * PXA255 timer by Yang Xi <hiyangxi@gmail.com> - * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include <bsp.h> -#include <rtems.h> -#include <rtems/btimer.h> -#include <pxa255.h> - -uint32_t tstart; -static uint32_t tick_time; -bool benchmark_timer_find_average_overhead; - -bool benchmark_timer_is_initialized = false; - -/* - * Use the timer count register to measure. - * The frequency of it is 3.4864MHZ - * The longest period we are able to capture is 4G/3.4864MHZ - */ -void benchmark_timer_initialize(void) -{ - tick_time = XSCALE_OS_TIMER_TCR; -} - -/* - * The following controls the behavior of Read_timer(). - * - * AVG_OVEREHAD is the overhead for starting and stopping the timer. It - * is usually deducted from the number returned. - * - * LEAST_VALID is the lowest number this routine should trust. Numbers - * below this are "noise" and zero is returned. - */ - -#define AVG_OVERHEAD 0 /* It typically takes X.X microseconds */ - /* (Y countdowns) to start/stop the timer. */ - /* This value is in microseconds. */ -#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ - -benchmark_timer_t benchmark_timer_read(void) -{ - - uint32_t total; - total = XSCALE_OS_TIMER_TCR; - if(total>=tick_time) - total -= tick_time; - else - total += 0xffffffff - tick_time; /*Round up but not overflow*/ - - if ( benchmark_timer_find_average_overhead == true ) - return total; /*Counter cycles*/ - - if ( total < LEAST_VALID ) - return 0; /* below timer resolution */ - - return total; -} - -void benchmark_timer_disable_subtracting_average_overhead( - bool find_flag -) -{ - benchmark_timer_find_average_overhead = find_flag; -} |