diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-31 18:18:17 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-31 18:18:17 +0000 |
commit | 25c62b02bc8fc9e66c1735e562e91acaa94abbe3 (patch) | |
tree | 1310e9509ef176a712ba98e4b2664da7d9cc4d63 /c/src/lib/libbsp/i386 | |
parent | 2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-25c62b02bc8fc9e66c1735e562e91acaa94abbe3.tar.bz2 |
2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
* timer/timer.c: Eliminate empty function from every benchmark timer
driver. Fix spelling.
Diffstat (limited to 'c/src/lib/libbsp/i386')
-rw-r--r-- | c/src/lib/libbsp/i386/i386ex/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/i386ex/timer/timer.c | 19 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/timer/timer.c | 64 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/ts_386ex/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/ts_386ex/timer/timer.c | 23 |
6 files changed, 57 insertions, 64 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/ChangeLog b/c/src/lib/libbsp/i386/i386ex/ChangeLog index 4266931270..b876f1b4d6 100644 --- a/c/src/lib/libbsp/i386/i386ex/ChangeLog +++ b/c/src/lib/libbsp/i386/i386ex/ChangeLog @@ -1,5 +1,10 @@ 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 programming conventions. diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c index 0dfd77a437..ccaef6585d 100644 --- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c +++ b/c/src/lib/libbsp/i386/i386ex/timer/timer.c @@ -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; } diff --git a/c/src/lib/libbsp/i386/pc386/ChangeLog b/c/src/lib/libbsp/i386/pc386/ChangeLog index 667294fb76..1c1e4b3d23 100644 --- a/c/src/lib/libbsp/i386/pc386/ChangeLog +++ b/c/src/lib/libbsp/i386/pc386/ChangeLog @@ -1,5 +1,10 @@ 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 programming conventions. diff --git a/c/src/lib/libbsp/i386/pc386/timer/timer.c b/c/src/lib/libbsp/i386/pc386/timer/timer.c index f1f7cd41b4..52903e934d 100644 --- a/c/src/lib/libbsp/i386/pc386/timer/timer.c +++ b/c/src/lib/libbsp/i386/pc386/timer/timer.c @@ -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; diff --git a/c/src/lib/libbsp/i386/ts_386ex/ChangeLog b/c/src/lib/libbsp/i386/ts_386ex/ChangeLog index 5cf2bee835..dc8cebb907 100644 --- a/c/src/lib/libbsp/i386/ts_386ex/ChangeLog +++ b/c/src/lib/libbsp/i386/ts_386ex/ChangeLog @@ -1,5 +1,10 @@ 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 programming conventions. diff --git a/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c b/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c index 0746869648..5ab4188797 100644 --- a/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c +++ b/c/src/lib/libbsp/i386/ts_386ex/timer/timer.c @@ -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; } /* |