summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-31 17:03:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-31 17:03:54 +0000
commit6427f1a24f17c44f233d9b7fe84ac74b099ca85e (patch)
tree37fda00b2b5b2a7d945474de264481c6b64dfcb4 /c/src/lib/libcpu
parent2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-6427f1a24f17c44f233d9b7fe84ac74b099ca85e.tar.bz2
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* mpc505/timer/timer.c, mpc5xx/timer/timer.c, mpc6xx/timer/timer.c, mpc8260/timer/timer.c, mpc8xx/timer/timer.c, ppc403/timer/timer.c: Rename timer driver methods to follow RTEMS programming conventions.
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/powerpc/ChangeLog6
-rw-r--r--c/src/lib/libcpu/powerpc/mpc505/timer/timer.c26
-rw-r--r--c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c17
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c21
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c17
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c17
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/timer/timer.c11
7 files changed, 43 insertions, 72 deletions
diff --git a/c/src/lib/libcpu/powerpc/ChangeLog b/c/src/lib/libcpu/powerpc/ChangeLog
index 6b524a72de..8b1ea35bf2 100644
--- a/c/src/lib/libcpu/powerpc/ChangeLog
+++ b/c/src/lib/libcpu/powerpc/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * mpc505/timer/timer.c, mpc5xx/timer/timer.c, mpc6xx/timer/timer.c,
+ mpc8260/timer/timer.c, mpc8xx/timer/timer.c, ppc403/timer/timer.c:
+ Rename timer driver methods to follow RTEMS programming conventions.
+
2008-08-26 Thomas Doerfler <Thomas.Doerflerr@embedded-brains.de>
* mpc83xx/i2c/mpc83xx_i2cdrv.c: wait for proper end of transfer
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;
}
diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
index c4a0eb45b2..f5b77124df 100644
--- a/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc5xx/timer/timer.c
@@ -52,7 +52,7 @@
#include <mpc5xx.h>
static volatile uint32_t Timer_starting;
-static rtems_boolean Timer_driver_Find_average_overhead;
+static rtems_boolean benchmark_timer_find_average_overhead;
/*
* This is so small that this code will be reproduced where needed.
@@ -66,7 +66,7 @@ static inline uint32_t get_itimer(void)
return ret;
}
-void Timer_initialize(void)
+void benchmark_timer_initialize(void)
{
/* set interrupt level and enable timebase. This should never */
/* generate an interrupt however. */
@@ -79,7 +79,7 @@ void Timer_initialize(void)
Timer_starting = get_itimer();
}
-int Read_timer(void)
+int benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
@@ -90,7 +90,7 @@ int Read_timer(void)
total = clicks - Timer_starting;
- if ( Timer_driver_Find_average_overhead == 1 )
+ if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in XXX microsecond units */
else {
@@ -101,12 +101,7 @@ int Read_timer(void)
}
}
-rtems_status_code Empty_function(void)
+void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(rtems_boolean find_flag)
-{
- Timer_driver_Find_average_overhead = find_flag;
+ benchmark_timer_find_average_overhead = find_flag;
}
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
index 032482aef2..6c8957f53b 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/timer/timer.c
@@ -21,7 +21,7 @@
uint64_t Timer_driver_Start_time;
-rtems_boolean Timer_driver_Find_average_overhead = 0;
+rtems_boolean benchmark_timer_find_average_overhead = 0;
unsigned clicks_overhead = 0;
/*
@@ -40,9 +40,9 @@ int Timer_get_clicks_overhead(void)
}
/*
- * Timer_initialize
+ * benchmark_timer_initialize
*/
-void Timer_initialize(void)
+void benchmark_timer_initialize(void)
{
/*
@@ -55,10 +55,10 @@ void Timer_initialize(void)
/*
- * Read_timer
+ * benchmark_timer_read
*/
-int Read_timer(void)
+int benchmark_timer_read(void)
{
uint64_t total64;
uint32_t total;
@@ -71,7 +71,7 @@ int Read_timer(void)
total = (uint32_t) total64;
- if ( Timer_driver_Find_average_overhead == 1 )
+ if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in "clicks" of the decrementer units */
return (int) BSP_Convert_decrementer(total - clicks_overhead);
@@ -85,14 +85,9 @@ unsigned long long Read_long_timer(void)
return BSP_Convert_decrementer(total64 - clicks_overhead);
}
-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;
}
diff --git a/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
index ad53057fac..d4b113bf3a 100644
--- a/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c
@@ -51,7 +51,7 @@
#include <mpc8260.h>
static volatile uint32_t Timer_starting;
-static rtems_boolean Timer_driver_Find_average_overhead;
+static rtems_boolean benchmark_timer_find_average_overhead;
/*
* This is so small that this code will be reproduced where needed.
@@ -65,7 +65,7 @@ static inline uint32_t get_itimer(void)
return ret;
}
-void Timer_initialize(void)
+void benchmark_timer_initialize(void)
{
/* set interrupt level and enable timebase. This should never */
/* generate an interrupt however. */
@@ -78,7 +78,7 @@ void Timer_initialize(void)
Timer_starting = get_itimer();
}
-int Read_timer(void)
+int benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
@@ -89,7 +89,7 @@ int Read_timer(void)
total = clicks - Timer_starting;
- if ( Timer_driver_Find_average_overhead == 1 )
+ if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in XXX microsecond units */
else {
@@ -100,12 +100,7 @@ int Read_timer(void)
}
}
-rtems_status_code Empty_function(void)
+void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(rtems_boolean find_flag)
-{
- Timer_driver_Find_average_overhead = find_flag;
+ benchmark_timer_find_average_overhead = find_flag;
}
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
index 87d1486695..dd58cbe78e 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
@@ -46,7 +46,7 @@
#include <mpc8xx.h>
static volatile uint32_t Timer_starting;
-static rtems_boolean Timer_driver_Find_average_overhead;
+static rtems_boolean benchmark_timer_find_average_overhead;
/*
* This is so small that this code will be reproduced where needed.
@@ -60,7 +60,7 @@ static inline uint32_t get_itimer(void)
return ret;
}
-void Timer_initialize(void)
+void benchmark_timer_initialize(void)
{
/* set interrupt level and enable timebase. This should never */
/* generate an interrupt however. */
@@ -69,7 +69,7 @@ void Timer_initialize(void)
Timer_starting = get_itimer();
}
-int Read_timer(void)
+int benchmark_timer_read(void)
{
uint32_t clicks;
uint32_t total;
@@ -80,7 +80,7 @@ int Read_timer(void)
total = clicks - Timer_starting;
- if ( Timer_driver_Find_average_overhead == 1 )
+ if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in XXX microsecond units */
else {
@@ -91,12 +91,7 @@ int Read_timer(void)
}
}
-rtems_status_code Empty_function(void)
+void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead(rtems_boolean find_flag)
-{
- Timer_driver_Find_average_overhead = find_flag;
+ benchmark_timer_find_average_overhead = find_flag;
}
diff --git a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
index 978cda8efb..1ac158ea5b 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/timer/timer.c
@@ -47,13 +47,13 @@ extern uint32_t bsp_timer_average_overhead;
static volatile uint32_t startedAt;
static rtems_boolean subtractOverhead;
-void Timer_initialize(void)
+void benchmark_timer_initialize(void)
{
/* We are going to rely on clock.c to sort out where the clock comes from */
startedAt = ppc_time_base();
}
-int Read_timer(void)
+int benchmark_timer_read(void)
{
uint32_t clicks, total;
@@ -67,12 +67,7 @@ int Read_timer(void)
return (total - bsp_timer_average_overhead);
}
-rtems_status_code Empty_function( void )
-{
- return RTEMS_SUCCESSFUL;
-}
-
-void Set_find_average_overhead( rtems_boolean find_flag)
+void benchmark_timer_disable_subtracting_average_overhead( rtems_boolean find_flag)
{
subtractOverhead = find_flag;
}