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:07:58 +00:00
parent e6778bc860
commit 35f52a6982
46 changed files with 301 additions and 186 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-08-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* timer/timer.c: Eliminate rtems_boolean.

View File

@@ -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.
@@ -25,16 +25,16 @@
#include <ep7312.h>
uint16_t tstart;
bool Timer_driver_Find_average_overhead;
bool benchmark_timerfind_average_overhead;
void Timer_initialize( void )
void benchmark_timerinitialize( void )
{
*EP7312_SYSCON1 |= EP7312_SYSCON1_TC2_512KHZ;
*EP7312_TC2D = 0xffff;
}
/*
* 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.
@@ -48,7 +48,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;
@@ -62,7 +62,7 @@ int Read_timer( void )
total = (uint32_t)0x0000ffff - t; /* result is 1/512000 = ~2 uS */
total = (total * 1953) / 1000; /* convert to uS */
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in XXX microsecond units */
else {
if ( total < LEAST_VALID )
@@ -79,14 +79,14 @@ 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(
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-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* timer/timer.c: Eliminate rtems_boolean.

View File

@@ -18,8 +18,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.
@@ -55,15 +55,15 @@
#define GBA_TM0CNT_PS 0x0003
#endif
bool Timer_driver_Find_average_overhead;
bool benchmark_timerfind_average_overhead;
/**
* @brief Timer_initialize start TM0 and TM1
* @brief benchmark_timerinitialize start TM0 and TM1
*
* @param None
* @return None
*/
void Timer_initialize( void )
void benchmark_timerinitialize( void )
{
GBA_REG_TM1CNT = 0x0000; /* Stop Counters */
GBA_REG_TM0CNT = 0x0000;
@@ -75,7 +75,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.
@@ -88,14 +88,14 @@ void Timer_initialize( void )
#define LEAST_VALID 1 /**< Don't trust a clicks value lower than this */
/**
* @brief Read_timer return timer countervalue in microseconds.
* @brief benchmark_timerread return timer countervalue in microseconds.
*
* Used in Timing Test Suite.
*
* @param None
* @return Timer value in microseconds
*/
uint32_t Read_timer( void )
uint32_t benchmark_timerread( void )
{
uint32_t ticks;
uint32_t total;
@@ -110,7 +110,7 @@ uint32_t Read_timer( void )
}
/* convert to uS */
total = ((ticks * __TickTime_ns) / 1000);
if ( Timer_driver_Find_average_overhead == 1 ) {
if ( benchmark_timerfind_average_overhead == 1 ) {
return total; /* in microseconds */
}
else {
@@ -130,20 +130,20 @@ uint32_t Read_timer( void )
* @param None
* @return RTEMS_SUCCESSFUL
*/
rtems_status_code Empty_function( void )
rtems_status_code benchmark_timerempty_function( void )
{
return RTEMS_SUCCESSFUL;
}
/**
* @brief Set Timer_driver_Find_average_overhead flag.
* @brief Set benchmark_timerfind_average_overhead flag.
*
* Used in Timing Test Suite.
*
* @param find_flag boolean find_flag
* @return None
*/
void Set_find_average_overhead(bool find_flag)
void 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-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* timer/timer.c: Eliminate rtems_boolean.

View File

@@ -15,10 +15,10 @@
#include <bsp.h>
#include <nds.h>
bool Timer_driver_Find_average_overhead;
bool benchmark_timerfind_average_overhead;
void
Timer_initialize (void)
benchmark_timerinitialize (void)
{
TIMER_CR (1) = 0x0000;
TIMER_CR (2) = 0x0000;
@@ -36,7 +36,7 @@ Timer_initialize (void)
#define LEAST_VALID 1
uint32_t
Read_timer (void)
benchmark_timerread (void)
{
uint32_t ticks;
@@ -50,13 +50,13 @@ Read_timer (void)
}
rtems_status_code
Empty_function (void)
benchmark_timerempty_function (void)
{
return RTEMS_SUCCESSFUL;
}
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-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: Add capability for bootcard.c BSP Initialization

View File

@@ -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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
* the number of microseconds since benchmark_timerinitialize() exitted.
*
* NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code.
@@ -23,11 +23,11 @@
#include <rtems/tic4x/c4xio.h>
uint32_t Timer_interrupts;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
static uint32_t start;
void Timer_initialize( void )
void benchmark_timerinitialize( void )
{
/*
@@ -48,7 +48,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.
@@ -62,7 +62,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 clicks;
uint32_t total;
@@ -83,7 +83,7 @@ int Read_timer( void )
total = clicks * 1;
if ( Timer_driver_Find_average_overhead == 1 ) {
if ( benchmark_timerfind_average_overhead == 1 ) {
return total; /* in count units where each count is */
/* 1 / (clock frequency/2) */
} else {
@@ -102,14 +102,14 @@ 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;
}

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-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* timer/timer.c: Add missing prototypes.

View File

@@ -28,7 +28,7 @@
#include <stdlib.h>
int Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
extern void timerisr(void);
extern int ClockIsOn(const rtems_raw_irq_connect_data*);
@@ -81,7 +81,7 @@ void Timer_exit(void)
}
}
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
static rtems_boolean First = TRUE;
@@ -92,7 +92,7 @@ void Timer_initialize(void)
atexit(Timer_exit); /* Try not to hose the system at exit. */
if (!i386_set_idt_entry (&timer_raw_irq_data)) {
printk("Timer_initialize: raw handler installation failed\n");
printk("benchmark_timerinitialize: raw handler installation failed\n");
rtems_fatal_error_occurred(1);
}
}
@@ -107,7 +107,7 @@ void Timer_initialize(void)
/* (3 ticks) to start/stop the timer. */
#define LEAST_VALID 4 /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
register uint32_t clicks;
register uint32_t total;
@@ -124,7 +124,7 @@ int Read_timer(void)
/* ??? Is "do not restore old vector" causing problems? */
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one microsecond units */
else {
@@ -134,14 +134,14 @@ int Read_timer(void)
}
}
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-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am: Now named bspclean.c

View File

@@ -59,10 +59,10 @@
| Global Variables
+--------------------------------------------------------------------------*/
volatile uint32_t Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead = TRUE;
rtems_boolean benchmark_timerfind_average_overhead = TRUE;
volatile unsigned int fastLoop1ms, slowLoop1ms;
void (*Timer_initialize_function)(void) = 0;
uint32_t (*Read_timer_function)(void) = 0;
void (*benchmark_timerinitialize_function)(void) = 0;
uint32_t (*benchmark_timerread_function)(void) = 0;
void (*Timer_exit_function)(void) = 0;
/*-------------------------------------------------------------------------+
@@ -112,7 +112,7 @@ tsc_timer_exit(void)
} /* tsc_timer_exit */
/*-------------------------------------------------------------------------+
| Function: Timer_initialize
| Function: benchmark_timerinitialize
| Description: Timer initialization routine.
| Global Variables: Ttimer_val.
| Arguments: None.
@@ -133,9 +133,9 @@ tsc_timer_initialize(void)
} /* tsc_timer_initialize */
/*-------------------------------------------------------------------------+
| Function: Read_timer
| Function: benchmark_timerread
| Description: Read hardware timer value.
| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead.
| Arguments: None.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
@@ -146,7 +146,7 @@ tsc_read_timer(void)
total = (uint32_t)(rdtsc() - Ttimer_val);
if (Timer_driver_Find_average_overhead)
if (benchmark_timerfind_average_overhead)
return total;
else if (total < LEAST_VALID)
return 0; /* below timer resolution */
@@ -222,7 +222,7 @@ i386_timer_exit(void)
} /* Timer_exit */
/*-------------------------------------------------------------------------+
| Function: Timer_initialize
| Function: benchmark_timerinitialize
| Description: Timer initialization routine.
| Global Variables: Ttimer_val.
| Arguments: None.
@@ -248,12 +248,12 @@ i386_timer_initialize(void)
while (Ttimer_val == 0)
continue;
Ttimer_val = 0;
} /* Timer_initialize */
} /* benchmark_timerinitialize */
/*-------------------------------------------------------------------------+
| Function: Read_timer
| Function: benchmark_timerread
| Description: Read hardware timer value.
| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead.
| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead.
| Arguments: None.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
@@ -269,7 +269,7 @@ i386_read_timer(void)
clicks = (msb << 8) | lsb;
total = (Ttimer_val * US_PER_ISR) + (US_PER_ISR - TICK_TO_US(clicks));
if (Timer_driver_Find_average_overhead)
if (benchmark_timerfind_average_overhead)
return total;
else if (total < LEAST_VALID)
return 0; /* below timer resolution */
@@ -283,7 +283,7 @@ i386_read_timer(void)
*/
void
Timer_initialize(void)
benchmark_timerinitialize(void)
{
static rtems_boolean First = TRUE;
@@ -292,27 +292,27 @@ Timer_initialize(void)
#if defined(DEBUG)
printk("TSC: timer initialization\n");
#endif /* DEBUG */
Timer_initialize_function = &tsc_timer_initialize;
Read_timer_function = &tsc_read_timer;
benchmark_timerinitialize_function = &tsc_timer_initialize;
benchmark_timerread_function = &tsc_read_timer;
Timer_exit_function = &tsc_timer_exit;
}
else {
#if defined(DEBUG)
printk("ISR: timer initialization\n");
#endif /* DEBUG */
Timer_initialize_function = &i386_timer_initialize;
Read_timer_function = &i386_read_timer;
benchmark_timerinitialize_function = &i386_timer_initialize;
benchmark_timerread_function = &i386_read_timer;
Timer_exit_function = &i386_timer_exit;
}
First = FALSE;
}
(*Timer_initialize_function)();
(*benchmark_timerinitialize_function)();
}
uint32_t
Read_timer(void)
benchmark_timerread(void)
{
return (*Read_timer_function)();
return (*benchmark_timerread_function)();
}
void
@@ -322,29 +322,29 @@ Timer_exit(void)
}
/*-------------------------------------------------------------------------+
| Function: Empty_function
| Function: benchmark_timerempty_function
| Description: Empty function used in time tests.
| Global Variables: None.
| Arguments: None.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
rtems_status_code Empty_function(void)
rtems_status_code benchmark_timerempty_function(void)
{
return RTEMS_SUCCESSFUL;
} /* Empty function */
/*-------------------------------------------------------------------------+
| Function: Set_find_average_overhead
| Description: Set internal Timer_driver_Find_average_overhead flag value.
| Global Variables: Timer_driver_Find_average_overhead.
| Function: benchmark_timerdisable_subtracting_average_overhead
| Description: Set internal benchmark_timerfind_average_overhead flag value.
| Global Variables: benchmark_timerfind_average_overhead.
| Arguments: find_flag - new value of the flag.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
Set_find_average_overhead(rtems_boolean find_flag)
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
{
Timer_driver_Find_average_overhead = find_flag;
} /* Set_find_average_overhead */
benchmark_timerfind_average_overhead = find_flag;
} /* benchmark_timerdisable_subtracting_average_overhead */
static unsigned short lastLoadedValue;

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>
* clock/ckinit.c, startup/bspstart.c, timer/timer.c:

View File

@@ -28,7 +28,7 @@
#include <stdlib.h>
volatile uint32_t Ttimer_val; /* Updated from ISR!!! */
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
extern void timerisr(void);
@@ -96,7 +96,7 @@ void Timer_exit(void)
}
}
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
static rtems_boolean First = TRUE;
@@ -106,18 +106,18 @@ void Timer_initialize(void)
First = FALSE;
if (!i386_get_current_idt_entry (&old_raw_irq_data)) {
printk("Timer_initialize: failed to get old raw irq entry.\n");
printk("benchmark_timerinitialize: failed to get old raw irq entry.\n");
rtems_fatal_error_occurred(1);
}
if (!i386_delete_idt_entry (&old_raw_irq_data)) {
printk("Timer_initialize: failed to delete old raw irq entry.\n");
printk("benchmark_timerinitialize: failed to delete old raw irq entry.\n");
rtems_fatal_error_occurred(1);
}
atexit(Timer_exit); /* Try not to hose the system at exit. */
if (!i386_set_idt_entry (&timer_raw_irq_data)) {
printk("Timer_initialize: raw handler installation failed.\n");
printk("benchmark_timerinitialize: raw handler installation failed.\n");
rtems_fatal_error_occurred(1);
}
}
@@ -133,7 +133,7 @@ void Timer_initialize(void)
/* (3 ticks) to start/stop the timer. */
#define LEAST_VALID 4 /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
register uint32_t clicks, total;
register uint8_t lsb, msb;
@@ -155,7 +155,7 @@ int Read_timer(void)
clicks = (msb << 8) | lsb;
total = Ttimer_val * US_PER_ISR + (US_PER_ISR - clicks);
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one microsecond units */
else if ( total < LEAST_VALID )
return 0; /* below timer resolution */
@@ -163,16 +163,16 @@ 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-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
* startup/bspstart.c, startup/init5282.c: Fixed warnings.

View File

@@ -8,7 +8,7 @@
#include <bsp.h>
void
Timer_initialize(void)
benchmark_timerinitialize(void)
{
int preScaleDivisor = 58;
int div = MCF5282_TIMER_DTMR_CLK_DIV1;
@@ -22,7 +22,7 @@ Timer_initialize(void)
* Return timer value in microsecond units
*/
int
Read_timer(void)
benchmark_timerread(void)
{
return MCF5282_TIMER3_DTCN;
}
@@ -32,12 +32,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-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/clock.c: Move extern outside of braces.

View File

@@ -39,7 +39,7 @@
#include <rtems/m68k/m68360.h>
void
Timer_initialize (void)
benchmark_timerinitialize (void)
{
/*
* Reset timers 1 and 2
@@ -73,7 +73,7 @@ Timer_initialize (void)
* Return timer value in microsecond units
*/
int
Read_timer (void)
benchmark_timerread (void)
{
return *(uint32_t*)&m360.tcn1;
}
@@ -83,12 +83,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-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
* startup/bspstart.c: Fixed nested extern declarations.

View File

@@ -54,10 +54,10 @@
#include <bsp.h>
#include <mcf548x/mcf548x.h>
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
static uint32_t microsecond_timer_value = 0;
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
@@ -68,7 +68,7 @@ MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
* XLB clock 100 MHz / 1us is equal to 100 counts
*/
int
Read_timer(void)
benchmark_timerread(void)
{
microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
return microsecond_timer_value;
@@ -79,15 +79,15 @@ 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)
{
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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* clock/ckinit.c, console/leds.c, console/mc68ec.c,

View File

@@ -32,11 +32,11 @@
#define TIMER_VECTOR 0x4D
int Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
rtems_isr timerisr(void);
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
(void) set_vector( timerisr, TIMER_VECTOR, 0 ); /* install ISR */
@@ -64,7 +64,7 @@ void Timer_initialize(void)
#define AVG_OVERHEAD 9 /* may not be right -- do this later */
#define LEAST_VALID 10 /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
uint8_t data;
uint8_t msb, osb, lsb;
@@ -93,7 +93,7 @@ int Read_timer(void)
MC68230_WRITE (MC68230_TCR, 0xA1);
/* do not restore old vector */
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in countdown units */
if ( total < LEAST_VALID )
@@ -105,14 +105,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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* clock/clock.c, startup/init52235.c: Add missing prototypes.

View File

@@ -16,7 +16,7 @@
#include <rtems.h>
#include <bsp.h>
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
@@ -28,7 +28,7 @@ void Timer_initialize(void)
/*
* Return timer value in microsecond units
*/
int Read_timer(void)
int benchmark_timerread(void)
{
return MCF_DTIM3_DTCN;
}
@@ -37,11 +37,11 @@ int Read_timer(void)
* Empty function call used in loops to measure basic cost of looping
* 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(rtems_boolean find_flag)
void 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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/init5235.c: Add missing prototypes.

View File

@@ -8,7 +8,7 @@
#include <bsp.h>
void
Timer_initialize(void)
benchmark_timerinitialize(void)
{
int preScaleDivisor = 0x4A;
int div = MCF5235_TIMER_DTMR_CLK_DIV1;
@@ -22,7 +22,7 @@ Timer_initialize(void)
* Return timer value in microsecond units
*/
int
Read_timer(void)
benchmark_timerread(void)
{
return MCF5235_TIMER3_DTCN;
}
@@ -32,12 +32,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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* clock/clock.c, startup/init5329.c: Add missing prototypes.

View File

@@ -17,7 +17,7 @@
#include <rtems.h>
#include <bsp.h>
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
uint32_t preScaleDivisor = bsp_get_BUS_clock_speed() / 1000000;
@@ -29,7 +29,7 @@ void Timer_initialize(void)
/*
* Return timer value in microsecond units
*/
int Read_timer(void)
int benchmark_timerread(void)
{
return MCF_DTIM3_DTCN;
}
@@ -38,11 +38,11 @@ int Read_timer(void)
* Empty function call used in loops to measure basic cost of looping
* 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(rtems_boolean find_flag)
void 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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* console/sci.c, startup/bspstart.c, startup/start_c.c,

View File

@@ -21,16 +21,16 @@
#include <bsp.h>
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
extern rtems_isr Clock_isr(void);
void Timer_initialize( void )
void benchmark_timerinitialize( void )
{
}
/*
* 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.
*
@@ -49,12 +49,12 @@ void Timer_initialize( void )
/*
* Return timer value in 1/2-microsecond units
*/
int Read_timer( void )
int benchmark_timerread( void )
{
uint32_t total;
total = 0;
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in XXX microsecond units */
if ( total < LEAST_VALID )
@@ -68,14 +68,14 @@ 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;
}

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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/bspclean.c, timer/timer.c: Add missing prototypes.

View File

@@ -29,11 +29,11 @@
#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
int Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
rtems_isr timerisr(void);
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
(void) set_vector( timerisr, 66, 0 ); /* install ISR */
@@ -65,7 +65,7 @@ void Timer_initialize(void)
/* (6 countdowns) to start/stop the timer. */
#define LEAST_VALID 10 /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
/*
uint8_t msb, lsb;
@@ -82,7 +82,7 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
*/
total = (Ttimer_val * 0x10000) + remaining;
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one-half microsecond units */
else {
@@ -92,14 +92,14 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
}
}
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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/bspclean.c, timer/timer.c: Add missing prototypes.

View File

@@ -32,11 +32,11 @@
/* Each tick is 6.25 us */
int Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
rtems_isr timerisr(void);
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
(void) set_vector(timerisr, TIMER_1_VECTOR, 0); /* install ISR */
@@ -56,7 +56,7 @@ void Timer_initialize(void)
synchronized whith the counter updates*/
#define LEAST_VALID 10 /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
uint32_t total;
uint16_t counter_value;
@@ -70,14 +70,14 @@ int Read_timer(void)
}
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-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* startup/bspclean.c, timer/timer.c, tod/tod.c:

View File

@@ -38,11 +38,11 @@
#define TIMER_INT_LEVEL 6
uint32_t Ttimer_val;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
rtems_isr timerisr(void);
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
(void) set_vector( timerisr, VBR0 * 0x10 + 0x8, 0 );
@@ -63,13 +63,13 @@ void Timer_initialize(void)
/* (3 countdowns) to start/stop the timer. */
#define LEAST_VALID 10U /* Don't trust a value lower than this */
int Read_timer(void)
int benchmark_timerread(void)
{
uint32_t total;
total = (Ttimer_val * TICK_INTERVAL) + lcsr->timer_cnt_1;
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one-half microsecond units */
if ( total < LEAST_VALID )
@@ -78,14 +78,14 @@ int Read_timer(void)
return (total-AVG_OVERHEAD) >> 1;
}
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>
* timer/timer.c: Add missing prototypes.

View File

@@ -16,10 +16,10 @@
#include <bsp.h>
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
uint32_t tstart;
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
asm volatile ("mfc0 %0, $9\n" : "=r" (tstart));
/* tick time in picooseconds */
@@ -30,7 +30,7 @@ void Timer_initialize(void)
#define LEAST_VALID 1 /* Don't trust a value lower than this */
/* tx39 simulator can count instructions. :) */
int Read_timer(void)
int benchmark_timerread(void)
{
uint32_t total;
uint32_t cnt;
@@ -41,7 +41,7 @@ int Read_timer(void)
total = (total * 1000) / 396; /* convert to nanoseconds */
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one microsecond units */
if ( total < LEAST_VALID )
@@ -50,14 +50,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: Add missing prototypes.

View File

@@ -15,7 +15,7 @@
#include <bsp.h>
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
#if defined(USE_TIMER2_FOR_CLOCK)
#define TIMER_BASE MONGOOSEV_TIMER1_BASE
@@ -25,7 +25,7 @@ rtems_boolean Timer_driver_Find_average_overhead;
#define TIMER_VECTOR MONGOOSEV_IRQ_TIMER2
#endif
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
/*
* Programming the compare register as the maximum value should let
@@ -56,7 +56,7 @@ void Timer_initialize(void)
/* mongoose-v can count cycles. :) */
#include <rtems/bspIo.h>
int Read_timer(void)
int benchmark_timerread(void)
{
uint32_t clicks;
uint32_t total;
@@ -75,7 +75,7 @@ int Read_timer(void)
if ( tcr & MONGOOSEV_TIMER_CONTROL_TIMEOUT )
printk( "MG5 timer overran\n" );
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in cycle units */
if ( total < LEAST_VALID )
@@ -84,16 +84,16 @@ int Read_timer(void)
return (total - AVG_OVERHEAD) / CPU_CLOCK_RATE_MHZ;
}
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;
}
/* eof */

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>
* timer/timer.c: Add missing prototypes.

View File

@@ -17,9 +17,9 @@
#include <bsp.h>
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
void Timer_initialize(void)
void benchmark_timerinitialize(void)
{
/*
* Programming the compare register as the maximum value should let
@@ -45,13 +45,13 @@ void Timer_initialize(void)
#define LEAST_VALID 1 /* Don't trust a value lower than this */
/* tx39 simulator can count instructions. :) */
int Read_timer(void)
int benchmark_timerread(void)
{
uint32_t total;
total = TX3904_TIMER_READ( TX3904_TIMER1_BASE, TX3904_TIMER_TRR );
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in one microsecond units */
if ( total < LEAST_VALID )
@@ -60,14 +60,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-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: Add capability for bootcard.c BSP Initialization

View File

@@ -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_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
* the number of microseconds since benchmark_timerinitialize() exitted.
*
* NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code.
@@ -27,7 +27,7 @@
#include <bsp.h>
volatile uint32_t Timer_interrupts;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
#define TIMER_REGS ((altera_avalon_timer_regs*)NIOS2_IO_BASE(TIMER_BASE))
@@ -37,7 +37,7 @@ void timerisr( void )
Timer_interrupts++;
}
void Timer_initialize( void )
void benchmark_timerinitialize( void )
{
uint32_t old_ie;
@@ -83,7 +83,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.
@@ -97,7 +97,7 @@ void Timer_initialize( void )
#define LEAST_VALID AVG_OVERHEAD /* Don't trust a value lower than this */
int Read_timer( void )
int benchmark_timerread( void )
{
uint32_t timer_wraps;
uint32_t timer_snap;
@@ -128,7 +128,7 @@ int Read_timer( void )
if(total < LEAST_VALID) return 0;
if(Timer_driver_Find_average_overhead != TRUE) total-= AVG_OVERHEAD;
if(benchmark_timerfind_average_overhead != TRUE) total-= AVG_OVERHEAD;
return total;
}
@@ -138,14 +138,14 @@ 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;
}

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-20 Ralf Corsépius <ralf.corsepius@rtems.org>
* irq/FPGA.c, irq/irq_init.c, pci/no_host_bridge.c,

View File

@@ -23,13 +23,13 @@
uint64_t Timer_driver_Start_time;
rtems_boolean Timer_driver_Find_average_overhead;
rtems_boolean benchmark_timerfind_average_overhead;
/*
* Timer_initialize
* benchmark_timerinitialize
*/
void Timer_initialize()
void benchmark_timerinitialize()
{
/*
@@ -40,10 +40,10 @@ void Timer_initialize()
}
/*
* Read_timer
* benchmark_timerread
*/
int Read_timer()
int benchmark_timerread()
{
uint64_t clicks;
uint64_t total64;
@@ -61,7 +61,7 @@ int Read_timer()
total = (uint32_t) total64;
if ( Timer_driver_Find_average_overhead == 1 )
if ( benchmark_timerfind_average_overhead == 1 )
return total; /* in "clicks" of the decrementer units */
if ( total < BSP_TIMER_LEAST_VALID )
@@ -70,14 +70,14 @@ int Read_timer()
return BSP_Convert_decrementer(total - BSP_TIMER_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;
}