2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>

* timer/timer.c: Rename timer driver methods to follow RTEMS
	programming conventions.
This commit is contained in:
Joel Sherrill
2008-08-31 16:47:17 +00:00
parent 674a980f1c
commit 424ee2ba6a
12 changed files with 83 additions and 53 deletions

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
* console/console.c: Eliminate copies of switches to convert termios

View File

@@ -17,7 +17,7 @@
#include <bsp.h>
void
Timer_initialize(void)
benchmark_timerinitialize(void)
{
int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
int div = MCF5282_TIMER_DTMR_CLK_DIV1;
@@ -35,7 +35,7 @@ Timer_initialize(void)
* Return timer value in microsecond units
*/
int
Read_timer(void)
benchmark_timerread(void)
{
return MCF5282_TIMER3_DTCN;
}
@@ -45,12 +45,12 @@ Read_timer(void)
* in Timing Test Suite.
*/
rtems_status_code
Empty_function(void)
benchmark_timerempty_function(void)
{
return RTEMS_SUCCESSFUL;
}
void
Set_find_average_overhead(rtems_boolean find_flag)
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
{
}

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-08-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* timer/timer.c: Eliminate rtems_boolean.

View File

@@ -22,12 +22,12 @@
uint32_t Timer_interrupts;
bool Timer_driver_Find_average_overhead;
bool benchmark_timerfind_average_overhead;
/* External assembler interrupt handler routine */
extern rtems_isr timerisr(rtems_vector_number vector);
/* Timer_initialize --
/* benchmark_timerinitialize --
* Initialize timer 2 for accurate time measurement.
*
* PARAMETERS:
@@ -37,13 +37,13 @@ extern rtems_isr timerisr(rtems_vector_number vector);
* none
*/
void
Timer_initialize(void)
benchmark_timerinitialize(void)
{
return;
}
/*
* The following controls the behavior of Read_timer().
* The following controls the behavior of benchmark_timerread().
*
* FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
*
@@ -59,7 +59,7 @@ Timer_initialize(void)
/* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
/* Read_timer --
/* benchmark_timerread --
* Read timer value in microsecond units since timer start.
*
* PARAMETERS:
@@ -69,12 +69,12 @@ Timer_initialize(void)
* number of microseconds since timer has been started
*/
int
Read_timer( void )
benchmark_timerread( void )
{
return 0;
}
/* Empty_function --
/* benchmark_timerempty_function --
* Empty function call used in loops to measure basic cost of looping
* in Timing Test Suite.
*
@@ -85,14 +85,14 @@ Read_timer( void )
* RTEMS_SUCCESSFUL
*/
rtems_status_code
Empty_function(void)
benchmark_timerempty_function(void)
{
return RTEMS_SUCCESSFUL;
}
/* Set_find_average_overhead --
/* benchmark_timerdisable_subtracting_average_overhead --
* This routine is invoked by the "Check Timer" (tmck) test in the
* RTEMS Timing Test Suite. It makes the Read_timer routine not
* RTEMS Timing Test Suite. It makes the benchmark_timerread routine not
* subtract the overhead required to initialize and read the benchmark
* timer.
*
@@ -103,7 +103,7 @@ Empty_function(void)
* none
*/
void
Set_find_average_overhead(bool find_flag)
benchmark_timerdisable_subtracting_average_overhead(bool find_flag)
{
Timer_driver_Find_average_overhead = find_flag;
benchmark_timerfind_average_overhead = find_flag;
}

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-08-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* gnatsupp/gnatsupp.c, timer/timer.c: Add missing prototypes.

View File

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

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-08-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* cchip/cchip.c, gnatsupp/gnatsupp.c, timer/timer.c: Add missing

View File

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

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-08-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/bspstart.c: Remove bogus local declarations.

View File

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

View File

@@ -1,3 +1,8 @@
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS
programming conventions.
2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: Add capability for bootcard.c BSP Initialization

View File

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