forked from Imagelibrary/rtems
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:
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -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
|
||||
* benchmark_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() 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.
|
||||
@@ -23,11 +23,11 @@
|
||||
#include <rtems/tic4x/c4xio.h>
|
||||
|
||||
uint32_t Timer_interrupts;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
static uint32_t start;
|
||||
|
||||
void benchmark_timerinitialize( void )
|
||||
void benchmark_timer_initialize( void )
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -48,7 +48,7 @@ void benchmark_timerinitialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
* 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.
|
||||
@@ -62,7 +62,7 @@ void benchmark_timerinitialize( void )
|
||||
/* This value is in microseconds. */
|
||||
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
|
||||
|
||||
int benchmark_timerread( void )
|
||||
int benchmark_timer_read( void )
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t total;
|
||||
@@ -83,7 +83,7 @@ int benchmark_timerread( void )
|
||||
|
||||
total = clicks * 1;
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 ) {
|
||||
if ( benchmark_timer_find_average_overhead == 1 ) {
|
||||
return total; /* in count units where each count is */
|
||||
/* 1 / (clock frequency/2) */
|
||||
} else {
|
||||
@@ -97,19 +97,9 @@ int benchmark_timerread( void )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
extern void timerisr(void);
|
||||
extern int ClockIsOn(const rtems_raw_irq_connect_data*);
|
||||
@@ -81,7 +81,7 @@ void Timer_exit(void)
|
||||
}
|
||||
}
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
|
||||
static rtems_boolean First = TRUE;
|
||||
@@ -92,7 +92,7 @@ void benchmark_timerinitialize(void)
|
||||
|
||||
atexit(Timer_exit); /* Try not to hose the system at exit. */
|
||||
if (!i386_set_idt_entry (&timer_raw_irq_data)) {
|
||||
printk("benchmark_timerinitialize: raw handler installation failed\n");
|
||||
printk("benchmark_timer_initialize: raw handler installation failed\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void benchmark_timerinitialize(void)
|
||||
/* (3 ticks) to start/stop the timer. */
|
||||
#define LEAST_VALID 4 /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
register uint32_t clicks;
|
||||
register uint32_t total;
|
||||
@@ -124,7 +124,7 @@ int benchmark_timerread(void)
|
||||
|
||||
/* ??? Is "do not restore old vector" causing problems? */
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
|
||||
else {
|
||||
@@ -134,14 +134,9 @@ int benchmark_timerread(void)
|
||||
}
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -59,10 +59,10 @@
|
||||
| Global Variables
|
||||
+--------------------------------------------------------------------------*/
|
||||
volatile uint32_t Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead = TRUE;
|
||||
rtems_boolean benchmark_timer_find_average_overhead = TRUE;
|
||||
volatile unsigned int fastLoop1ms, slowLoop1ms;
|
||||
void (*benchmark_timerinitialize_function)(void) = 0;
|
||||
uint32_t (*benchmark_timerread_function)(void) = 0;
|
||||
void (*benchmark_timer_initialize_function)(void) = 0;
|
||||
uint32_t (*benchmark_timer_read_function)(void) = 0;
|
||||
void (*Timer_exit_function)(void) = 0;
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
@@ -112,7 +112,7 @@ tsc_timer_exit(void)
|
||||
} /* tsc_timer_exit */
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: benchmark_timerinitialize
|
||||
| Function: benchmark_timer_initialize
|
||||
| Description: Timer initialization routine.
|
||||
| Global Variables: Ttimer_val.
|
||||
| Arguments: None.
|
||||
@@ -133,9 +133,9 @@ tsc_timer_initialize(void)
|
||||
} /* tsc_timer_initialize */
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: benchmark_timerread
|
||||
| Function: benchmark_timer_read
|
||||
| Description: Read hardware timer value.
|
||||
| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead.
|
||||
| Global Variables: Ttimer_val, benchmark_timer_find_average_overhead.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
@@ -146,7 +146,7 @@ tsc_read_timer(void)
|
||||
|
||||
total = (uint32_t)(rdtsc() - Ttimer_val);
|
||||
|
||||
if (benchmark_timerfind_average_overhead)
|
||||
if (benchmark_timer_find_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: benchmark_timerinitialize
|
||||
| Function: benchmark_timer_initialize
|
||||
| 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;
|
||||
} /* benchmark_timerinitialize */
|
||||
} /* benchmark_timer_initialize */
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: benchmark_timerread
|
||||
| Function: benchmark_timer_read
|
||||
| Description: Read hardware timer value.
|
||||
| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead.
|
||||
| Global Variables: Ttimer_val, benchmark_timer_find_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 (benchmark_timerfind_average_overhead)
|
||||
if (benchmark_timer_find_average_overhead)
|
||||
return total;
|
||||
else if (total < LEAST_VALID)
|
||||
return 0; /* below timer resolution */
|
||||
@@ -283,7 +283,7 @@ i386_read_timer(void)
|
||||
*/
|
||||
|
||||
void
|
||||
benchmark_timerinitialize(void)
|
||||
benchmark_timer_initialize(void)
|
||||
{
|
||||
static rtems_boolean First = TRUE;
|
||||
|
||||
@@ -292,27 +292,27 @@ benchmark_timerinitialize(void)
|
||||
#if defined(DEBUG)
|
||||
printk("TSC: timer initialization\n");
|
||||
#endif /* DEBUG */
|
||||
benchmark_timerinitialize_function = &tsc_timer_initialize;
|
||||
benchmark_timerread_function = &tsc_read_timer;
|
||||
benchmark_timer_initialize_function = &tsc_timer_initialize;
|
||||
benchmark_timer_read_function = &tsc_read_timer;
|
||||
Timer_exit_function = &tsc_timer_exit;
|
||||
}
|
||||
else {
|
||||
#if defined(DEBUG)
|
||||
printk("ISR: timer initialization\n");
|
||||
#endif /* DEBUG */
|
||||
benchmark_timerinitialize_function = &i386_timer_initialize;
|
||||
benchmark_timerread_function = &i386_read_timer;
|
||||
benchmark_timer_initialize_function = &i386_timer_initialize;
|
||||
benchmark_timer_read_function = &i386_read_timer;
|
||||
Timer_exit_function = &i386_timer_exit;
|
||||
}
|
||||
First = FALSE;
|
||||
}
|
||||
(*benchmark_timerinitialize_function)();
|
||||
(*benchmark_timer_initialize_function)();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
benchmark_timerread(void)
|
||||
benchmark_timer_read(void)
|
||||
{
|
||||
return (*benchmark_timerread_function)();
|
||||
return (*benchmark_timer_read_function)();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -322,29 +322,17 @@ Timer_exit(void)
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: benchmark_timerempty_function
|
||||
| Description: Empty function used in time tests.
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
rtems_status_code benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
} /* Empty function */
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: benchmark_timerdisable_subtracting_average_overhead
|
||||
| Description: Set internal benchmark_timerfind_average_overhead flag value.
|
||||
| Global Variables: benchmark_timerfind_average_overhead.
|
||||
| Function: benchmark_timer_disable_subtracting_average_overhead
|
||||
| Description: Set internal benchmark_timer_find_average_overhead flag value.
|
||||
| Global Variables: benchmark_timer_find_average_overhead.
|
||||
| Arguments: find_flag - new value of the flag.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
} /* benchmark_timerdisable_subtracting_average_overhead */
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
} /* benchmark_timer_disable_subtracting_average_overhead */
|
||||
|
||||
static unsigned short lastLoadedValue;
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
volatile uint32_t Ttimer_val; /* Updated from ISR!!! */
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
extern void timerisr(void);
|
||||
|
||||
@@ -96,7 +96,7 @@ void Timer_exit(void)
|
||||
}
|
||||
}
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
|
||||
static rtems_boolean First = TRUE;
|
||||
@@ -106,18 +106,18 @@ void benchmark_timerinitialize(void)
|
||||
First = FALSE;
|
||||
|
||||
if (!i386_get_current_idt_entry (&old_raw_irq_data)) {
|
||||
printk("benchmark_timerinitialize: failed to get old raw irq entry.\n");
|
||||
printk("benchmark_timer_initialize: failed to get old raw irq entry.\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
}
|
||||
|
||||
if (!i386_delete_idt_entry (&old_raw_irq_data)) {
|
||||
printk("benchmark_timerinitialize: failed to delete old raw irq entry.\n");
|
||||
printk("benchmark_timer_initialize: 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("benchmark_timerinitialize: raw handler installation failed.\n");
|
||||
printk("benchmark_timer_initialize: raw handler installation failed.\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void benchmark_timerinitialize(void)
|
||||
/* (3 ticks) to start/stop the timer. */
|
||||
#define LEAST_VALID 4 /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
register uint32_t clicks, total;
|
||||
register uint8_t lsb, msb;
|
||||
@@ -155,7 +155,7 @@ int benchmark_timerread(void)
|
||||
clicks = (msb << 8) | lsb;
|
||||
total = Ttimer_val * US_PER_ISR + (US_PER_ISR - clicks);
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
else if ( total < LEAST_VALID )
|
||||
return 0; /* below timer resolution */
|
||||
@@ -163,16 +163,11 @@ int benchmark_timerread(void)
|
||||
return (total - AVG_OVERHEAD);
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <bsp.h>
|
||||
|
||||
void
|
||||
benchmark_timerinitialize(void)
|
||||
benchmark_timer_initialize(void)
|
||||
{
|
||||
int preScaleDivisor = 58;
|
||||
int div = MCF5282_TIMER_DTMR_CLK_DIV1;
|
||||
@@ -22,22 +22,12 @@ benchmark_timerinitialize(void)
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int
|
||||
benchmark_timerread(void)
|
||||
benchmark_timer_read(void)
|
||||
{
|
||||
return MCF5282_TIMER3_DTCN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <rtems/m68k/m68360.h>
|
||||
|
||||
void
|
||||
benchmark_timerinitialize (void)
|
||||
benchmark_timer_initialize (void)
|
||||
{
|
||||
/*
|
||||
* Reset timers 1 and 2
|
||||
@@ -73,22 +73,12 @@ benchmark_timerinitialize (void)
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int
|
||||
benchmark_timerread (void)
|
||||
benchmark_timer_read (void)
|
||||
{
|
||||
return *(uint32_t*)&m360.tcn1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function (void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -54,10 +54,10 @@
|
||||
#include <bsp.h>
|
||||
#include <mcf548x/mcf548x.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
static uint32_t microsecond_timer_value = 0;
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
|
||||
MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
|
||||
@@ -68,27 +68,14 @@ MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN);
|
||||
* XLB clock 100 MHz / 1us is equal to 100 counts
|
||||
*/
|
||||
int
|
||||
benchmark_timerread(void)
|
||||
benchmark_timer_read(void)
|
||||
{
|
||||
microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
|
||||
return microsecond_timer_value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#define TIMER_VECTOR 0x4D
|
||||
|
||||
int Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
rtems_isr timerisr(void);
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
(void) set_vector( timerisr, TIMER_VECTOR, 0 ); /* install ISR */
|
||||
|
||||
@@ -64,7 +64,7 @@ void benchmark_timerinitialize(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 benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint8_t data;
|
||||
uint8_t msb, osb, lsb;
|
||||
@@ -93,7 +93,7 @@ int benchmark_timerread(void)
|
||||
MC68230_WRITE (MC68230_TCR, 0xA1);
|
||||
|
||||
/* do not restore old vector */
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in countdown units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -105,14 +105,9 @@ int benchmark_timerread(void)
|
||||
return (total - AVG_OVERHEAD);
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <rtems.h>
|
||||
#include <bsp.h>
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
|
||||
|
||||
@@ -28,20 +28,11 @@ void benchmark_timerinitialize(void)
|
||||
/*
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
return MCF_DTIM3_DTCN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <bsp.h>
|
||||
|
||||
void
|
||||
benchmark_timerinitialize(void)
|
||||
benchmark_timer_initialize(void)
|
||||
{
|
||||
int preScaleDivisor = 0x4A;
|
||||
int div = MCF5235_TIMER_DTMR_CLK_DIV1;
|
||||
@@ -22,22 +22,12 @@ benchmark_timerinitialize(void)
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int
|
||||
benchmark_timerread(void)
|
||||
benchmark_timer_read(void)
|
||||
{
|
||||
return MCF5235_TIMER3_DTCN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <rtems.h>
|
||||
#include <bsp.h>
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
uint32_t preScaleDivisor = bsp_get_BUS_clock_speed() / 1000000;
|
||||
|
||||
@@ -29,20 +29,11 @@ void benchmark_timerinitialize(void)
|
||||
/*
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
return MCF_DTIM3_DTCN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
extern rtems_isr Clock_isr(void);
|
||||
|
||||
void benchmark_timerinitialize( void )
|
||||
void benchmark_timer_initialize( void )
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
* The following controls the behavior of benchmark_timer_read().
|
||||
*
|
||||
* FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
|
||||
*
|
||||
@@ -49,12 +49,12 @@ void benchmark_timerinitialize( void )
|
||||
/*
|
||||
* Return timer value in 1/2-microsecond units
|
||||
*/
|
||||
int benchmark_timerread( void )
|
||||
int benchmark_timer_read( void )
|
||||
{
|
||||
uint32_t total;
|
||||
total = 0;
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in XXX microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -63,19 +63,9 @@ int benchmark_timerread( void )
|
||||
return (total - AVG_OVERHEAD);
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
rtems_status_code benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
|
||||
|
||||
int Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
rtems_isr timerisr(void);
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
(void) set_vector( timerisr, 66, 0 ); /* install ISR */
|
||||
|
||||
@@ -65,7 +65,7 @@ void benchmark_timerinitialize(void)
|
||||
/* (6 countdowns) to start/stop the timer. */
|
||||
#define LEAST_VALID 10 /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
/*
|
||||
uint8_t msb, lsb;
|
||||
@@ -82,7 +82,7 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
|
||||
*/
|
||||
total = (Ttimer_val * 0x10000) + remaining;
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one-half microsecond units */
|
||||
|
||||
else {
|
||||
@@ -92,14 +92,9 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
|
||||
}
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
/* Each tick is 6.25 us */
|
||||
|
||||
int Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
rtems_isr timerisr(void);
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
(void) set_vector(timerisr, TIMER_1_VECTOR, 0); /* install ISR */
|
||||
|
||||
@@ -56,7 +56,7 @@ void benchmark_timerinitialize(void)
|
||||
synchronized whith the counter updates*/
|
||||
#define LEAST_VALID 10 /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
uint16_t counter_value;
|
||||
@@ -70,14 +70,9 @@ int benchmark_timerread(void)
|
||||
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
#define TIMER_INT_LEVEL 6
|
||||
|
||||
uint32_t Ttimer_val;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
rtems_isr timerisr(void);
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
(void) set_vector( timerisr, VBR0 * 0x10 + 0x8, 0 );
|
||||
|
||||
@@ -63,13 +63,13 @@ void benchmark_timerinitialize(void)
|
||||
/* (3 countdowns) to start/stop the timer. */
|
||||
#define LEAST_VALID 10U /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
|
||||
total = (Ttimer_val * TICK_INTERVAL) + lcsr->timer_cnt_1;
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one-half microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -78,14 +78,9 @@ int benchmark_timerread(void)
|
||||
return (total-AVG_OVERHEAD) >> 1;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <bsp.h>
|
||||
|
||||
void
|
||||
benchmark_timerinitialize(void)
|
||||
benchmark_timer_initialize(void)
|
||||
{
|
||||
int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
|
||||
int div = MCF5282_TIMER_DTMR_CLK_DIV1;
|
||||
@@ -35,22 +35,12 @@ benchmark_timerinitialize(void)
|
||||
* Return timer value in microsecond units
|
||||
*/
|
||||
int
|
||||
benchmark_timerread(void)
|
||||
benchmark_timer_read(void)
|
||||
{
|
||||
return MCF5282_TIMER3_DTCN;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
uint32_t tstart;
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
asm volatile ("mfc0 %0, $9\n" : "=r" (tstart));
|
||||
/* tick time in picooseconds */
|
||||
@@ -30,7 +30,7 @@ void benchmark_timerinitialize(void)
|
||||
#define LEAST_VALID 1 /* Don't trust a value lower than this */
|
||||
/* tx39 simulator can count instructions. :) */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
uint32_t cnt;
|
||||
@@ -41,7 +41,7 @@ int benchmark_timerread(void)
|
||||
total = (total * 1000) / 396; /* convert to nanoseconds */
|
||||
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -50,14 +50,9 @@ int benchmark_timerread(void)
|
||||
return total - AVG_OVERHEAD;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
#if defined(USE_TIMER2_FOR_CLOCK)
|
||||
#define TIMER_BASE MONGOOSEV_TIMER1_BASE
|
||||
@@ -25,7 +25,7 @@ rtems_boolean benchmark_timerfind_average_overhead;
|
||||
#define TIMER_VECTOR MONGOOSEV_IRQ_TIMER2
|
||||
#endif
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
/*
|
||||
* Programming the compare register as the maximum value should let
|
||||
@@ -56,7 +56,7 @@ void benchmark_timerinitialize(void)
|
||||
/* mongoose-v can count cycles. :) */
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t total;
|
||||
@@ -75,7 +75,7 @@ int benchmark_timerread(void)
|
||||
if ( tcr & MONGOOSEV_TIMER_CONTROL_TIMEOUT )
|
||||
printk( "MG5 timer overran\n" );
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in cycle units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -84,16 +84,11 @@ int benchmark_timerread(void)
|
||||
return (total - AVG_OVERHEAD) / CPU_CLOCK_RATE_MHZ;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
#include <bsp.h>
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
void benchmark_timerinitialize(void)
|
||||
void benchmark_timer_initialize(void)
|
||||
{
|
||||
/*
|
||||
* Programming the compare register as the maximum value should let
|
||||
@@ -45,13 +45,13 @@ void benchmark_timerinitialize(void)
|
||||
#define LEAST_VALID 1 /* Don't trust a value lower than this */
|
||||
/* tx39 simulator can count instructions. :) */
|
||||
|
||||
int benchmark_timerread(void)
|
||||
int benchmark_timer_read(void)
|
||||
{
|
||||
uint32_t total;
|
||||
|
||||
total = TX3904_TIMER_READ( TX3904_TIMER1_BASE, TX3904_TIMER_TRR );
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in one microsecond units */
|
||||
|
||||
if ( total < LEAST_VALID )
|
||||
@@ -60,14 +60,9 @@ int benchmark_timerread(void)
|
||||
return total - AVG_OVERHEAD;
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -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
|
||||
* benchmark_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns
|
||||
* the number of microseconds since benchmark_timerinitialize() 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.
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <bsp.h>
|
||||
|
||||
volatile uint32_t Timer_interrupts;
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
#define TIMER_REGS ((altera_avalon_timer_regs*)NIOS2_IO_BASE(TIMER_BASE))
|
||||
|
||||
@@ -37,7 +37,7 @@ void timerisr( void )
|
||||
Timer_interrupts++;
|
||||
}
|
||||
|
||||
void benchmark_timerinitialize( void )
|
||||
void benchmark_timer_initialize( void )
|
||||
{
|
||||
uint32_t old_ie;
|
||||
|
||||
@@ -83,7 +83,7 @@ void benchmark_timerinitialize( void )
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
* 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.
|
||||
@@ -97,7 +97,7 @@ void benchmark_timerinitialize( void )
|
||||
|
||||
#define LEAST_VALID AVG_OVERHEAD /* Don't trust a value lower than this */
|
||||
|
||||
int benchmark_timerread( void )
|
||||
int benchmark_timer_read( void )
|
||||
{
|
||||
uint32_t timer_wraps;
|
||||
uint32_t timer_snap;
|
||||
@@ -128,24 +128,14 @@ int benchmark_timerread( void )
|
||||
|
||||
if(total < LEAST_VALID) return 0;
|
||||
|
||||
if(benchmark_timerfind_average_overhead != TRUE) total-= AVG_OVERHEAD;
|
||||
if(benchmark_timer_find_average_overhead != TRUE) total-= AVG_OVERHEAD;
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*/
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
|
||||
uint64_t Timer_driver_Start_time;
|
||||
|
||||
rtems_boolean benchmark_timerfind_average_overhead;
|
||||
rtems_boolean benchmark_timer_find_average_overhead;
|
||||
|
||||
/*
|
||||
* benchmark_timerinitialize
|
||||
* benchmark_timer_initialize
|
||||
*/
|
||||
|
||||
void benchmark_timerinitialize()
|
||||
void benchmark_timer_initialize()
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -40,10 +40,10 @@ void benchmark_timerinitialize()
|
||||
}
|
||||
|
||||
/*
|
||||
* benchmark_timerread
|
||||
* benchmark_timer_read
|
||||
*/
|
||||
|
||||
int benchmark_timerread()
|
||||
int benchmark_timer_read()
|
||||
{
|
||||
uint64_t clicks;
|
||||
uint64_t total64;
|
||||
@@ -61,7 +61,7 @@ int benchmark_timerread()
|
||||
|
||||
total = (uint32_t) total64;
|
||||
|
||||
if ( benchmark_timerfind_average_overhead == 1 )
|
||||
if ( benchmark_timer_find_average_overhead == 1 )
|
||||
return total; /* in "clicks" of the decrementer units */
|
||||
|
||||
if ( total < BSP_TIMER_LEAST_VALID )
|
||||
@@ -70,14 +70,9 @@ int benchmark_timerread()
|
||||
return BSP_Convert_decrementer(total - BSP_TIMER_AVG_OVERHEAD);
|
||||
}
|
||||
|
||||
rtems_status_code benchmark_timerempty_function( void )
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
void benchmark_timerdisable_subtracting_average_overhead(
|
||||
void benchmark_timer_disable_subtracting_average_overhead(
|
||||
rtems_boolean find_flag
|
||||
)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
* timer/timer.c: Rename timer driver methods to follow RTEMS
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
uint32_t Timer_interrupts;
|
||||
|
||||
bool benchmark_timerfind_average_overhead;
|
||||
bool benchmark_timer_find_average_overhead;
|
||||
|
||||
/* External assembler interrupt handler routine */
|
||||
extern rtems_isr timerisr(rtems_vector_number vector);
|
||||
|
||||
/* benchmark_timerinitialize --
|
||||
/* benchmark_timer_initialize --
|
||||
* Initialize timer 2 for accurate time measurement.
|
||||
*
|
||||
* PARAMETERS:
|
||||
@@ -37,13 +37,13 @@ extern rtems_isr timerisr(rtems_vector_number vector);
|
||||
* none
|
||||
*/
|
||||
void
|
||||
benchmark_timerinitialize(void)
|
||||
benchmark_timer_initialize(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following controls the behavior of benchmark_timerread().
|
||||
* The following controls the behavior of benchmark_timer_read().
|
||||
*
|
||||
* FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
|
||||
*
|
||||
@@ -59,7 +59,7 @@ benchmark_timerinitialize(void)
|
||||
/* This value is in microseconds. */
|
||||
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */
|
||||
|
||||
/* benchmark_timerread --
|
||||
/* benchmark_timer_read --
|
||||
* Read timer value in microsecond units since timer start.
|
||||
*
|
||||
* PARAMETERS:
|
||||
@@ -69,30 +69,14 @@ benchmark_timerinitialize(void)
|
||||
* number of microseconds since timer has been started
|
||||
*/
|
||||
int
|
||||
benchmark_timerread( void )
|
||||
benchmark_timer_read( void )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* benchmark_timerempty_function --
|
||||
* Empty function call used in loops to measure basic cost of looping
|
||||
* in Timing Test Suite.
|
||||
*
|
||||
* PARAMETERS:
|
||||
* none
|
||||
*
|
||||
* RETURNS:
|
||||
* RTEMS_SUCCESSFUL
|
||||
*/
|
||||
rtems_status_code
|
||||
benchmark_timerempty_function(void)
|
||||
{
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
/* benchmark_timerdisable_subtracting_average_overhead --
|
||||
/* benchmark_timer_disable_subtracting_average_overhead --
|
||||
* This routine is invoked by the "Check Timer" (tmck) test in the
|
||||
* RTEMS Timing Test Suite. It makes the benchmark_timerread routine not
|
||||
* RTEMS Timing Test Suite. It makes the benchmark_timer_read routine not
|
||||
* subtract the overhead required to initialize and read the benchmark
|
||||
* timer.
|
||||
*
|
||||
@@ -103,7 +87,7 @@ benchmark_timerempty_function(void)
|
||||
* none
|
||||
*/
|
||||
void
|
||||
benchmark_timerdisable_subtracting_average_overhead(bool find_flag)
|
||||
benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
|
||||
{
|
||||
benchmark_timerfind_average_overhead = find_flag;
|
||||
benchmark_timer_find_average_overhead = find_flag;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user