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:
Joel Sherrill
2008-08-31 17:42:00 +00:00
parent 35eb543d87
commit e511e12626
8 changed files with 53 additions and 53 deletions

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -22,24 +22,24 @@
#include <bsp.h> #include <bsp.h>
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_boolean benchmark_timeris_initialized = FALSE; rtems_boolean benchmark_timer_is_initialized = FALSE;
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
/* /*
* Timer runs long and accurate enough not to require an interrupt. * Timer runs long and accurate enough not to require an interrupt.
*/ */
if ( benchmark_timeris_initialized == FALSE ) { if ( benchmark_timer_is_initialized == FALSE ) {
/* approximately 1 us per countdown */ /* approximately 1 us per countdown */
ERC32_MEC.General_Purpose_Timer_Scalar = CLOCK_SPEED - 1; ERC32_MEC.General_Purpose_Timer_Scalar = CLOCK_SPEED - 1;
ERC32_MEC.General_Purpose_Timer_Counter = 0xffffffff; ERC32_MEC.General_Purpose_Timer_Counter = 0xffffffff;
} else { } else {
benchmark_timeris_initialized = TRUE; benchmark_timer_is_initialized = TRUE;
} }
ERC32_MEC_Set_General_Purpose_Timer_Control( ERC32_MEC_Set_General_Purpose_Timer_Control(
@@ -63,7 +63,7 @@ void benchmark_timerinitialize(void)
#define LEAST_VALID 13 /* Don't trust a value lower than this */ #define LEAST_VALID 13 /* Don't trust a value lower than this */
#endif #endif
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
uint32_t total; uint32_t total;
@@ -71,7 +71,7 @@ int benchmark_timerread(void)
total = 0xffffffff - total; total = 0xffffffff - total;
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in one microsecond units */ return total; /* in one microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -80,14 +80,9 @@ int benchmark_timerread(void)
return total - AVG_OVERHEAD; return total - AVG_OVERHEAD;
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -22,24 +22,24 @@
#include <bsp.h> #include <bsp.h>
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_boolean benchmark_timeris_initialized = FALSE; rtems_boolean benchmark_timer_is_initialized = FALSE;
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
/* /*
* Timer runs long and accurate enough not to require an interrupt. * Timer runs long and accurate enough not to require an interrupt.
*/ */
if ( benchmark_timeris_initialized == FALSE ) { if ( benchmark_timer_is_initialized == FALSE ) {
/* approximately 1 us per countdown */ /* approximately 1 us per countdown */
LEON_REG.Timer_Counter_2 = 0xffffff; LEON_REG.Timer_Counter_2 = 0xffffff;
LEON_REG.Timer_Reload_2 = 0xffffff; LEON_REG.Timer_Reload_2 = 0xffffff;
} else { } else {
benchmark_timeris_initialized = TRUE; benchmark_timer_is_initialized = TRUE;
} }
LEON_REG.Timer_Control_2 = ( LEON_REG.Timer_Control_2 = (
@@ -53,7 +53,7 @@ void benchmark_timerinitialize(void)
/* to start/stop the timer. */ /* to start/stop the timer. */
#define LEAST_VALID 2 /* Don't trust a value lower than this */ #define LEAST_VALID 2 /* Don't trust a value lower than this */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
uint32_t total; uint32_t total;
@@ -61,7 +61,7 @@ int benchmark_timerread(void)
total = 0xffffff - total; total = 0xffffff - total;
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in one microsecond units */ return total; /* in one microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -70,14 +70,9 @@ int benchmark_timerread(void)
return total - AVG_OVERHEAD; return total - AVG_OVERHEAD;
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -30,24 +30,24 @@
#define LEON3_TIMER_INDEX 0 #define LEON3_TIMER_INDEX 0
#endif #endif
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_boolean benchmark_timeris_initialized = FALSE; rtems_boolean benchmark_timer_is_initialized = FALSE;
extern volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs; extern volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs;
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
/* /*
* Timer runs long and accurate enough not to require an interrupt. * Timer runs long and accurate enough not to require an interrupt.
*/ */
if (LEON3_Timer_Regs) { if (LEON3_Timer_Regs) {
if ( benchmark_timeris_initialized == FALSE ) { if ( benchmark_timer_is_initialized == FALSE ) {
/* approximately 1 us per countdown */ /* approximately 1 us per countdown */
LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].reload = 0xffffff; LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].reload = 0xffffff;
LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].value = 0xffffff; LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].value = 0xffffff;
} else { } else {
benchmark_timeris_initialized = TRUE; benchmark_timer_is_initialized = TRUE;
} }
LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].conf = LEON3_GPTIMER_EN | LEON3_GPTIMER_LD; LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].conf = LEON3_GPTIMER_EN | LEON3_GPTIMER_LD;
} }
@@ -57,7 +57,7 @@ void benchmark_timerinitialize(void)
/* to start/stop the timer. */ /* to start/stop the timer. */
#define LEAST_VALID 2 /* Don't trust a value lower than this */ #define LEAST_VALID 2 /* Don't trust a value lower than this */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
uint32_t total; uint32_t total;
@@ -66,7 +66,7 @@ int benchmark_timerread(void)
total = 0xffffff - total; total = 0xffffff - total;
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in one microsecond units */ return total; /* in one microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -77,14 +77,9 @@ int benchmark_timerread(void)
return 0; return 0;
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -23,9 +23,9 @@ struct timeval Timer_start;
struct timeval Timer_stop; struct timeval Timer_stop;
struct timezone Time_zone; struct timezone Time_zone;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
void benchmark_timerinitialize() void benchmark_timer_initialize()
{ {
gettimeofday( &Timer_start, &Time_zone ); gettimeofday( &Timer_start, &Time_zone );
} }
@@ -34,7 +34,7 @@ void benchmark_timerinitialize()
/* (XX countdowns) to start/stop the timer. */ /* (XX countdowns) to start/stop the timer. */
#define LEAST_VALID 10 /* Don't trust a value lower than this */ #define LEAST_VALID 10 /* Don't trust a value lower than this */
int benchmark_timerread() int benchmark_timer_read()
{ {
int total; int total;
@@ -48,7 +48,7 @@ int benchmark_timerread()
total += Timer_stop.tv_usec; total += Timer_stop.tv_usec;
} }
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in countdown units */ return total; /* in countdown units */
else { else {
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -57,14 +57,9 @@ int benchmark_timerread()
} }
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }