diff options
Diffstat (limited to 'c/src/lib/libcpu/powerpc/mpc505')
-rw-r--r-- | c/src/lib/libcpu/powerpc/mpc505/timer/timer.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c index df668c57cb..4bee060364 100644 --- a/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c +++ b/c/src/lib/libcpu/powerpc/mpc505/timer/timer.c @@ -2,8 +2,8 @@ * * This file manages the benchmark timer used by the RTEMS Timing Test * Suite. Each measured time period is demarcated by calls to - * Timer_initialize() and Read_timer(). Read_timer() usually returns - * the number of microseconds since Timer_initialize() exitted. + * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns + * the number of microseconds since benchmark_timer_initialize() exitted. * * NOTE: It is important that the timer start/stop overhead be * determined when porting or modifying this code. @@ -16,17 +16,17 @@ #include <rtems.h> -rtems_boolean Timer_driver_Find_average_overhead; +rtems_boolean benchmark_timer_find_average_overhead; static unsigned int volatile lastInitValue; -void Timer_initialize( void ) +void benchmark_timer_initialize( void ) { asm volatile( " mftb %0": "=r" (lastInitValue) ); } /* - * The following controls the behavior of Read_timer(). + * The following controls the behavior of benchmark_timer_read(). * * AVG_OVEREHAD is the overhead for starting and stopping the timer. It * is usually deducted from the number returned. @@ -40,26 +40,16 @@ void Timer_initialize( void ) /* This value is in microseconds. */ #define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ -int Read_timer( void ) +int benchmark_timer_read( void ) { uint32_t value; asm volatile ( " mftb %0": "=r" (value) ); return value - lastInitValue; } -/* - * Empty function call used in loops to measure basic cost of looping - * in Timing Test Suite. - */ - -rtems_status_code Empty_function( void ) -{ - return RTEMS_SUCCESSFUL; -} - -void Set_find_average_overhead( +void benchmark_timer_disable_subtracting_average_overhead( rtems_boolean find_flag ) { - Timer_driver_Find_average_overhead = find_flag; + benchmark_timer_find_average_overhead = find_flag; } |