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:
Joel Sherrill
2008-08-31 18:18:17 +00:00
parent 6b2923cbc3
commit 25c62b02bc
44 changed files with 259 additions and 328 deletions

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -2,8 +2,8 @@
* *
* This file manages the benchmark timer used by the RTEMS Timing Test * This file manages the benchmark timer used by the RTEMS Timing Test
* Suite. Each measured time period is demarcated by calls to * Suite. Each measured time period is demarcated by calls to
* benchmark_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
* the number of microseconds since benchmark_timerinitialize() exitted. * the number of microseconds since benchmark_timer_initialize() exitted.
* *
* NOTE: It is important that the timer start/stop overhead be * NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code. * determined when porting or modifying this code.
@@ -23,11 +23,11 @@
#include <rtems/tic4x/c4xio.h> #include <rtems/tic4x/c4xio.h>
uint32_t Timer_interrupts; uint32_t Timer_interrupts;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
static uint32_t start; 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 * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
* is usually deducted from the number returned. * is usually deducted from the number returned.
@@ -62,7 +62,7 @@ void benchmark_timerinitialize( void )
/* This value is in microseconds. */ /* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ #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 clicks;
uint32_t total; uint32_t total;
@@ -83,7 +83,7 @@ int benchmark_timerread( void )
total = clicks * 1; 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 */ return total; /* in count units where each count is */
/* 1 / (clock frequency/2) */ /* 1 / (clock frequency/2) */
} else { } else {
@@ -97,19 +97,9 @@ int benchmark_timerread( void )
} }
} }
/* void benchmark_timer_disable_subtracting_average_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(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -28,7 +28,7 @@
#include <stdlib.h> #include <stdlib.h>
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
extern void timerisr(void); extern void timerisr(void);
extern int ClockIsOn(const rtems_raw_irq_connect_data*); 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; static rtems_boolean First = TRUE;
@@ -92,7 +92,7 @@ void benchmark_timerinitialize(void)
atexit(Timer_exit); /* Try not to hose the system at exit. */ atexit(Timer_exit); /* Try not to hose the system at exit. */
if (!i386_set_idt_entry (&timer_raw_irq_data)) { 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); rtems_fatal_error_occurred(1);
} }
} }
@@ -107,7 +107,7 @@ void benchmark_timerinitialize(void)
/* (3 ticks) to start/stop the timer. */ /* (3 ticks) to start/stop the timer. */
#define LEAST_VALID 4 /* Don't trust a value lower than this */ #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 clicks;
register uint32_t total; register uint32_t total;
@@ -124,7 +124,7 @@ int benchmark_timerread(void)
/* ??? Is "do not restore old vector" causing problems? */ /* ??? 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 */ return total; /* in one microsecond units */
else { else {
@@ -134,14 +134,9 @@ int benchmark_timerread(void)
} }
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

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

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -28,7 +28,7 @@
#include <stdlib.h> #include <stdlib.h>
volatile uint32_t Ttimer_val; /* Updated from ISR!!! */ 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); 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; static rtems_boolean First = TRUE;
@@ -106,18 +106,18 @@ void benchmark_timerinitialize(void)
First = FALSE; First = FALSE;
if (!i386_get_current_idt_entry (&old_raw_irq_data)) { 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); rtems_fatal_error_occurred(1);
} }
if (!i386_delete_idt_entry (&old_raw_irq_data)) { 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); rtems_fatal_error_occurred(1);
} }
atexit(Timer_exit); /* Try not to hose the system at exit. */ atexit(Timer_exit); /* Try not to hose the system at exit. */
if (!i386_set_idt_entry (&timer_raw_irq_data)) { 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); rtems_fatal_error_occurred(1);
} }
} }
@@ -133,7 +133,7 @@ void benchmark_timerinitialize(void)
/* (3 ticks) to start/stop the timer. */ /* (3 ticks) to start/stop the timer. */
#define LEAST_VALID 4 /* Don't trust a value lower than this */ #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 uint32_t clicks, total;
register uint8_t lsb, msb; register uint8_t lsb, msb;
@@ -155,7 +155,7 @@ int benchmark_timerread(void)
clicks = (msb << 8) | lsb; clicks = (msb << 8) | lsb;
total = Ttimer_val * US_PER_ISR + (US_PER_ISR - clicks); 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 */ return total; /* in one microsecond units */
else if ( total < LEAST_VALID ) else if ( total < LEAST_VALID )
return 0; /* below timer resolution */ return 0; /* below timer resolution */
@@ -163,16 +163,11 @@ int benchmark_timerread(void)
return (total - AVG_OVERHEAD); return (total - AVG_OVERHEAD);
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }
/* /*

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -8,7 +8,7 @@
#include <bsp.h> #include <bsp.h>
void void
benchmark_timerinitialize(void) benchmark_timer_initialize(void)
{ {
int preScaleDivisor = 58; int preScaleDivisor = 58;
int div = MCF5282_TIMER_DTMR_CLK_DIV1; int div = MCF5282_TIMER_DTMR_CLK_DIV1;
@@ -22,22 +22,12 @@ benchmark_timerinitialize(void)
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int int
benchmark_timerread(void) benchmark_timer_read(void)
{ {
return MCF5282_TIMER3_DTCN; 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 void
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_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: Eliminate empty function from every benchmark timer
driver. Fix spelling.
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -39,7 +39,7 @@
#include <rtems/m68k/m68360.h> #include <rtems/m68k/m68360.h>
void void
benchmark_timerinitialize (void) benchmark_timer_initialize (void)
{ {
/* /*
* Reset timers 1 and 2 * Reset timers 1 and 2
@@ -73,22 +73,12 @@ benchmark_timerinitialize (void)
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int int
benchmark_timerread (void) benchmark_timer_read (void)
{ {
return *(uint32_t*)&m360.tcn1; 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 void
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_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: Eliminate empty function from every benchmark timer
driver. Fix spelling.
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -54,10 +54,10 @@
#include <bsp.h> #include <bsp.h>
#include <mcf548x/mcf548x.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; static uint32_t microsecond_timer_value = 0;
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF; MCF548X_SLT_SLTCNT1 = 0xFFFFFFFF;
MCF548X_SLT_SCR1 |= (MCF548X_SLT_SCR_TEN | MCF548X_SLT_SCR_RUN); 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 * XLB clock 100 MHz / 1us is equal to 100 counts
*/ */
int int
benchmark_timerread(void) benchmark_timer_read(void)
{ {
microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100; microsecond_timer_value = (0xFFFFFFFF - MCF548X_SLT_SCNT1)/100;
return microsecond_timer_value; 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 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;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -32,11 +32,11 @@
#define TIMER_VECTOR 0x4D #define TIMER_VECTOR 0x4D
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
(void) set_vector( timerisr, TIMER_VECTOR, 0 ); /* install ISR */ (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 AVG_OVERHEAD 9 /* may not be right -- do this later */
#define LEAST_VALID 10 /* Don't trust a value lower than this */ #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 data;
uint8_t msb, osb, lsb; uint8_t msb, osb, lsb;
@@ -93,7 +93,7 @@ int benchmark_timerread(void)
MC68230_WRITE (MC68230_TCR, 0xA1); MC68230_WRITE (MC68230_TCR, 0xA1);
/* do not restore old vector */ /* do not restore old vector */
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in countdown units */ return total; /* in countdown units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -105,14 +105,9 @@ int benchmark_timerread(void)
return (total - AVG_OVERHEAD); return (total - AVG_OVERHEAD);
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -16,7 +16,7 @@
#include <rtems.h> #include <rtems.h>
#include <bsp.h> #include <bsp.h>
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000; uint32_t preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
@@ -28,20 +28,11 @@ void benchmark_timerinitialize(void)
/* /*
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
return MCF_DTIM3_DTCN; return MCF_DTIM3_DTCN;
} }
/* void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
* 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)
{ {
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -8,7 +8,7 @@
#include <bsp.h> #include <bsp.h>
void void
benchmark_timerinitialize(void) benchmark_timer_initialize(void)
{ {
int preScaleDivisor = 0x4A; int preScaleDivisor = 0x4A;
int div = MCF5235_TIMER_DTMR_CLK_DIV1; int div = MCF5235_TIMER_DTMR_CLK_DIV1;
@@ -22,22 +22,12 @@ benchmark_timerinitialize(void)
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int int
benchmark_timerread(void) benchmark_timer_read(void)
{ {
return MCF5235_TIMER3_DTCN; 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 void
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_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: Eliminate empty function from every benchmark timer
driver. Fix spelling.
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -17,7 +17,7 @@
#include <rtems.h> #include <rtems.h>
#include <bsp.h> #include <bsp.h>
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
uint32_t preScaleDivisor = bsp_get_BUS_clock_speed() / 1000000; uint32_t preScaleDivisor = bsp_get_BUS_clock_speed() / 1000000;
@@ -29,20 +29,11 @@ void benchmark_timerinitialize(void)
/* /*
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
return MCF_DTIM3_DTCN; return MCF_DTIM3_DTCN;
} }
/* void benchmark_timer_disable_subtracting_average_overhead(rtems_boolean find_flag)
* 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)
{ {
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -21,16 +21,16 @@
#include <bsp.h> #include <bsp.h>
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
extern rtems_isr Clock_isr(void); 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. * 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 * Return timer value in 1/2-microsecond units
*/ */
int benchmark_timerread( void ) int benchmark_timer_read( void )
{ {
uint32_t total; uint32_t total;
total = 0; total = 0;
if ( benchmark_timerfind_average_overhead == 1 ) if ( benchmark_timer_find_average_overhead == 1 )
return total; /* in XXX microsecond units */ return total; /* in XXX microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -63,19 +63,9 @@ int benchmark_timerread( void )
return (total - AVG_OVERHEAD); return (total - AVG_OVERHEAD);
} }
/* void benchmark_timer_disable_subtracting_average_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(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -29,11 +29,11 @@
#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */ #define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
(void) set_vector( timerisr, 66, 0 ); /* install ISR */ (void) set_vector( timerisr, 66, 0 ); /* install ISR */
@@ -65,7 +65,7 @@ void benchmark_timerinitialize(void)
/* (6 countdowns) to start/stop the timer. */ /* (6 countdowns) to start/stop the timer. */
#define LEAST_VALID 10 /* Don't trust a value lower than this */ #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; uint8_t msb, lsb;
@@ -82,7 +82,7 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
*/ */
total = (Ttimer_val * 0x10000) + remaining; 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 */ return total; /* in one-half microsecond units */
else { else {
@@ -92,14 +92,9 @@ remaining = 0xffff - *((uint16_t*) 0xfffb0010);
} }
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -32,11 +32,11 @@
/* Each tick is 6.25 us */ /* Each tick is 6.25 us */
int Ttimer_val; int Ttimer_val;
rtems_boolean benchmark_timerfind_average_overhead; rtems_boolean benchmark_timer_find_average_overhead;
rtems_isr timerisr(void); rtems_isr timerisr(void);
void benchmark_timerinitialize(void) void benchmark_timer_initialize(void)
{ {
(void) set_vector(timerisr, TIMER_1_VECTOR, 0); /* install ISR */ (void) set_vector(timerisr, TIMER_1_VECTOR, 0); /* install ISR */
@@ -56,7 +56,7 @@ void benchmark_timerinitialize(void)
synchronized whith the counter updates*/ synchronized whith the counter updates*/
#define LEAST_VALID 10 /* Don't trust a value lower than this */ #define LEAST_VALID 10 /* Don't trust a value lower than this */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
uint32_t total; uint32_t total;
uint16_t counter_value; uint16_t counter_value;
@@ -70,14 +70,9 @@ int benchmark_timerread(void)
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

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

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -17,7 +17,7 @@
#include <bsp.h> #include <bsp.h>
void void
benchmark_timerinitialize(void) benchmark_timer_initialize(void)
{ {
int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000; int preScaleDivisor = bsp_get_CPU_clock_speed() / 1000000;
int div = MCF5282_TIMER_DTMR_CLK_DIV1; int div = MCF5282_TIMER_DTMR_CLK_DIV1;
@@ -35,22 +35,12 @@ benchmark_timerinitialize(void)
* Return timer value in microsecond units * Return timer value in microsecond units
*/ */
int int
benchmark_timerread(void) benchmark_timer_read(void)
{ {
return MCF5282_TIMER3_DTCN; 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 void
benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag) benchmark_timer_disable_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: Eliminate empty function from every benchmark timer
driver. Fix spelling.
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

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

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

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

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -17,9 +17,9 @@
#include <bsp.h> #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 * 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 */ #define LEAST_VALID 1 /* Don't trust a value lower than this */
/* tx39 simulator can count instructions. :) */ /* tx39 simulator can count instructions. :) */
int benchmark_timerread(void) int benchmark_timer_read(void)
{ {
uint32_t total; uint32_t total;
total = TX3904_TIMER_READ( TX3904_TIMER1_BASE, TX3904_TIMER_TRR ); 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 */ return total; /* in one microsecond units */
if ( total < LEAST_VALID ) if ( total < LEAST_VALID )
@@ -60,14 +60,9 @@ int benchmark_timerread(void)
return total - AVG_OVERHEAD; return total - AVG_OVERHEAD;
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -2,8 +2,8 @@
* *
* This file manages the benchmark timer used by the RTEMS Timing Test * This file manages the benchmark timer used by the RTEMS Timing Test
* Suite. Each measured time period is demarcated by calls to * Suite. Each measured time period is demarcated by calls to
* benchmark_timerinitialize() and benchmark_timerread(). benchmark_timerread() usually returns * benchmark_timer_initialize() and benchmark_timer_read(). benchmark_timer_read() usually returns
* the number of microseconds since benchmark_timerinitialize() exitted. * the number of microseconds since benchmark_timer_initialize() exitted.
* *
* NOTE: It is important that the timer start/stop overhead be * NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code. * determined when porting or modifying this code.
@@ -27,7 +27,7 @@
#include <bsp.h> #include <bsp.h>
volatile uint32_t Timer_interrupts; 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)) #define TIMER_REGS ((altera_avalon_timer_regs*)NIOS2_IO_BASE(TIMER_BASE))
@@ -37,7 +37,7 @@ void timerisr( void )
Timer_interrupts++; Timer_interrupts++;
} }
void benchmark_timerinitialize( void ) void benchmark_timer_initialize( void )
{ {
uint32_t old_ie; 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 * AVG_OVEREHAD is the overhead for starting and stopping the timer. It
* is usually deducted from the number returned. * 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 */ #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_wraps;
uint32_t timer_snap; uint32_t timer_snap;
@@ -128,24 +128,14 @@ int benchmark_timerread( void )
if(total < LEAST_VALID) return 0; 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; return total;
} }
/* void benchmark_timer_disable_subtracting_average_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(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -23,13 +23,13 @@
uint64_t Timer_driver_Start_time; 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 clicks;
uint64_t total64; uint64_t total64;
@@ -61,7 +61,7 @@ int benchmark_timerread()
total = (uint32_t) total64; 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 */ return total; /* in "clicks" of the decrementer units */
if ( total < BSP_TIMER_LEAST_VALID ) if ( total < BSP_TIMER_LEAST_VALID )
@@ -70,14 +70,9 @@ int benchmark_timerread()
return BSP_Convert_decrementer(total - BSP_TIMER_AVG_OVERHEAD); return BSP_Convert_decrementer(total - BSP_TIMER_AVG_OVERHEAD);
} }
rtems_status_code benchmark_timerempty_function( void ) void benchmark_timer_disable_subtracting_average_overhead(
{
return RTEMS_SUCCESSFUL;
}
void benchmark_timerdisable_subtracting_average_overhead(
rtems_boolean find_flag rtems_boolean find_flag
) )
{ {
benchmark_timerfind_average_overhead = find_flag; benchmark_timer_find_average_overhead = find_flag;
} }

View File

@@ -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> 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Rename timer driver methods to follow RTEMS * timer/timer.c: Rename timer driver methods to follow RTEMS

View File

@@ -22,12 +22,12 @@
uint32_t Timer_interrupts; uint32_t Timer_interrupts;
bool benchmark_timerfind_average_overhead; bool benchmark_timer_find_average_overhead;
/* External assembler interrupt handler routine */ /* External assembler interrupt handler routine */
extern rtems_isr timerisr(rtems_vector_number vector); extern rtems_isr timerisr(rtems_vector_number vector);
/* benchmark_timerinitialize -- /* benchmark_timer_initialize --
* Initialize timer 2 for accurate time measurement. * Initialize timer 2 for accurate time measurement.
* *
* PARAMETERS: * PARAMETERS:
@@ -37,13 +37,13 @@ extern rtems_isr timerisr(rtems_vector_number vector);
* none * none
*/ */
void void
benchmark_timerinitialize(void) benchmark_timer_initialize(void)
{ {
return; 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. * FIND_AVG_OVERHEAD * instructs the routine to return the "raw" count.
* *
@@ -59,7 +59,7 @@ benchmark_timerinitialize(void)
/* This value is in microseconds. */ /* This value is in microseconds. */
#define LEAST_VALID 1 /* Don't trust a clicks value lower than this */ #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. * Read timer value in microsecond units since timer start.
* *
* PARAMETERS: * PARAMETERS:
@@ -69,30 +69,14 @@ benchmark_timerinitialize(void)
* number of microseconds since timer has been started * number of microseconds since timer has been started
*/ */
int int
benchmark_timerread( void ) benchmark_timer_read( void )
{ {
return 0; return 0;
} }
/* benchmark_timerempty_function -- /* benchmark_timer_disable_subtracting_average_overhead --
* 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 --
* This routine is invoked by the "Check Timer" (tmck) test in the * 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 * subtract the overhead required to initialize and read the benchmark
* timer. * timer.
* *
@@ -103,7 +87,7 @@ benchmark_timerempty_function(void)
* none * none
*/ */
void 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;
} }