forked from Imagelibrary/rtems
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* at91rm9200/timer/timer.c, lpc22xx/timer/timer.c, mc9328mxl/timer/timer.c, s3c2400/timer/timer.c, s3c24xx/timer/timer.c: Rename timer driver methods to follow RTEMS programming conventions.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* at91rm9200/timer/timer.c, lpc22xx/timer/timer.c,
|
||||
mc9328mxl/timer/timer.c, s3c2400/timer/timer.c,
|
||||
s3c24xx/timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
programming conventions.
|
||||
|
||||
2008-08-27 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* lpc22xx/timer/timer.c: Remove broken bool implementation.
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* Notes:
|
||||
* 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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
@@ -28,14 +28,14 @@
|
||||
#include <at91rm9200_pmc.h>
|
||||
|
||||
uint16_t tstart;
|
||||
rtems_boolean Timer_driver_Find_average_overhead;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
uint32_t tick_time;
|
||||
/*
|
||||
* Set up TC0 -
|
||||
* timer_clock2 (MCK/8)
|
||||
* capture mode - this shouldn't matter
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timerinitialize( void )
|
||||
{
|
||||
uint32_t tmr_freq;
|
||||
|
||||
@@ -52,7 +52,7 @@ void Timer_initialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of Read_timer().
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
*
|
||||
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
|
||||
* is usually deducted from the number returned.
|
||||
@@ -66,7 +66,7 @@ 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_timerread( void )
|
||||
{
|
||||
uint16_t t;
|
||||
uint32_t total;
|
||||
@@ -80,7 +80,7 @@ int Read_timer( void )
|
||||
|
||||
total = t * tick_time;
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 )
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
return total; /* in nanosecond units */
|
||||
else {
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -97,15 +97,15 @@ int Read_timer( void )
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* Notes:
|
||||
* 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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
@@ -29,19 +29,19 @@
|
||||
uint32_t g_start;
|
||||
uint32_t g_freq;
|
||||
|
||||
rtems_boolean Timer_driver_Find_average_overhead;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
|
||||
|
||||
/*
|
||||
* Set up Timer 1
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timerinitialize( void )
|
||||
{
|
||||
g_freq = LPC22xx_Fpclk / 1000;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of Read_timer().
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
*
|
||||
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
|
||||
* is usually deducted from the number returned.
|
||||
@@ -55,7 +55,7 @@ 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_timerread( void )
|
||||
{
|
||||
return (T0TC/(LPC22xx_Fpclk/1000000));
|
||||
/*
|
||||
@@ -70,15 +70,15 @@ int Read_timer( void )
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* Notes:
|
||||
* 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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
@@ -30,13 +30,13 @@
|
||||
uint32_t g_start;
|
||||
uint32_t g_freq;
|
||||
|
||||
rtems_boolean Timer_driver_Find_average_overhead;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
|
||||
|
||||
/*
|
||||
* Set up Timer 1
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timerinitialize( void )
|
||||
{
|
||||
MC9328MXL_TMR2_TCTL = (MC9328MXL_TMR_TCTL_CLKSRC_PCLK1 |
|
||||
MC9328MXL_TMR_TCTL_FRR |
|
||||
@@ -51,7 +51,7 @@ void Timer_initialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of Read_timer().
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
*
|
||||
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
|
||||
* is usually deducted from the number returned.
|
||||
@@ -65,7 +65,7 @@ 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_timerread( void )
|
||||
{
|
||||
uint32_t t;
|
||||
unsigned long long total;
|
||||
@@ -82,7 +82,7 @@ int Read_timer( void )
|
||||
/* convert to nanoseconds */
|
||||
total = (total * 1000)/ g_freq;
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 ) {
|
||||
if ( benchmark_timerfind_average_overhead == 1 ) {
|
||||
return (int) total;
|
||||
} else if ( total < LEAST_VALID ) {
|
||||
return 0;
|
||||
@@ -99,15 +99,15 @@ int Read_timer( void )
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* Notes:
|
||||
* 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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
@@ -27,13 +27,13 @@
|
||||
uint32_t g_start;
|
||||
uint32_t g_freq;
|
||||
|
||||
rtems_boolean Timer_driver_Find_average_overhead;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
|
||||
|
||||
/*
|
||||
* Set up Timer 1
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timerinitialize( void )
|
||||
{
|
||||
uint32_t cr;
|
||||
|
||||
@@ -58,7 +58,7 @@ void Timer_initialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of Read_timer().
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
*
|
||||
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
|
||||
* is usually deducted from the number returned.
|
||||
@@ -72,7 +72,7 @@ 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_timerread( void )
|
||||
{
|
||||
uint32_t t;
|
||||
unsigned long long total;
|
||||
@@ -89,7 +89,7 @@ int Read_timer( void )
|
||||
/* convert to microseconds */
|
||||
total = (total*1000) / g_freq;
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 ) {
|
||||
if ( benchmark_timerfind_average_overhead == 1 ) {
|
||||
return (int) total;
|
||||
} else if ( total < LEAST_VALID ) {
|
||||
return 0;
|
||||
@@ -106,15 +106,15 @@ int Read_timer( void )
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
* Notes:
|
||||
* 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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() exitted.
|
||||
*
|
||||
* It is important that the timer start/stop overhead be determined
|
||||
* when porting or modifying this code.
|
||||
@@ -27,13 +27,13 @@
|
||||
uint32_t g_start;
|
||||
uint32_t g_freq;
|
||||
|
||||
rtems_boolean Timer_driver_Find_average_overhead;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
|
||||
|
||||
/*
|
||||
* Set up Timer 1
|
||||
*/
|
||||
void Timer_initialize( void )
|
||||
void benchmark_timerinitialize( void )
|
||||
{
|
||||
uint32_t cr;
|
||||
|
||||
@@ -58,7 +58,7 @@ void Timer_initialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of Read_timer().
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
*
|
||||
* AVG_OVEREHAD is the overhead for starting and stopping the timer. It
|
||||
* is usually deducted from the number returned.
|
||||
@@ -72,7 +72,7 @@ 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_timerread( void )
|
||||
{
|
||||
uint32_t t;
|
||||
unsigned long long total;
|
||||
@@ -89,7 +89,7 @@ int Read_timer( void )
|
||||
/* convert to microseconds */
|
||||
total = (total*1000) / g_freq;
|
||||
|
||||
if ( Timer_driver_Find_average_overhead == 1 ) {
|
||||
if ( benchmark_timerfind_average_overhead == 1 ) {
|
||||
return (int) total;
|
||||
} else if ( total < LEAST_VALID ) {
|
||||
return 0;
|
||||
@@ -106,15 +106,15 @@ int Read_timer( void )
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user