forked from Imagelibrary/rtems
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Eliminate empty function from every benchmark timer driver. Fix spelling.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Eliminate empty function from every benchmark timer
|
||||
driver. Fix spelling.
|
||||
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
uint32_t tstart;
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
asm volatile ("mfc0 %0, $9\n" : "=r" (tstart));
|
||||
/* tick time in picooseconds */
|
||||
@@ -30,7 +30,7 @@ void benchmark_timerinitialize(void)
|
||||
#define LEAST_VALID 1 /* Don't trust a value lower than this */
|
||||
/* tx39 simulator can count instructions. :) */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
uint32_t cnt;
|
||||
@@ -41,7 +41,7 @@ int benchmark_timerread(void)
|
||||
total = (total * 1000) / 396; /* convert to nanoseconds */
|
||||
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -50,14 +50,9 @@ int benchmark_timerread(void)
|
||||
return total - AVG_OVERHEAD;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Eliminate empty function from every benchmark timer
|
||||
driver. Fix spelling.
|
||||
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
#if defined(USE_TIMER2_FOR_CLOCK)
|
||||
#define TIMER_BASE MONGOOSEV_TIMER1_BASE
|
||||
@@ -25,7 +25,7 @@ rtems_boolean benchmark_timerfind_average_overhead;
|
||||
#define TIMER_VECTOR MONGOOSEV_IRQ_TIMER2
|
||||
#endif
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
/*
|
||||
* Programming the compare register as the maximum value should let
|
||||
@@ -56,7 +56,7 @@ void benchmark_timerinitialize(void)
|
||||
/* mongoose-v can count cycles. :) */
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t total;
|
||||
@@ -75,7 +75,7 @@ int benchmark_timerread(void)
|
||||
if ( tcr & MONGOOSEV_TIMER_CONTROL_TIMEOUT )
|
||||
printk( "MG5 timer overran\n" );
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in cycle units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -84,16 +84,11 @@ int benchmark_timerread(void)
|
||||
return (total - AVG_OVERHEAD) / CPU_CLOCK_RATE_MHZ;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Eliminate empty function from every benchmark timer
|
||||
driver. Fix spelling.
|
||||
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
/*
|
||||
* Programming the compare register as the maximum value should let
|
||||
@@ -45,13 +45,13 @@ void benchmark_timerinitialize(void)
|
||||
#define LEAST_VALID 1 /* Don't trust a value lower than this */
|
||||
/* tx39 simulator can count instructions. :) */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
|
||||
total = TX3904_TIMER_READ( TX3904_TIMER1_BASE, TX3904_TIMER_TRR );
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -60,14 +60,9 @@ int benchmark_timerread(void)
|
||||
return total - AVG_OVERHEAD;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user