From 35f52a69829e2a1e3180949ca38592d2b13034de Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 31 Aug 2008 16:07:58 +0000 Subject: 2008-08-31 Joel Sherrill * timer/timer.c: Rename timer driver methods to follow RTEMS programming conventions. --- c/src/lib/libbsp/i386/pc386/timer/timer.c | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'c/src/lib/libbsp/i386/pc386/timer/timer.c') diff --git a/c/src/lib/libbsp/i386/pc386/timer/timer.c b/c/src/lib/libbsp/i386/pc386/timer/timer.c index 57c50f2eca..f1f7cd41b4 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 Timer_driver_Find_average_overhead = TRUE; +rtems_boolean benchmark_timerfind_average_overhead = TRUE; volatile unsigned int fastLoop1ms, slowLoop1ms; -void (*Timer_initialize_function)(void) = 0; -uint32_t (*Read_timer_function)(void) = 0; +void (*benchmark_timerinitialize_function)(void) = 0; +uint32_t (*benchmark_timerread_function)(void) = 0; void (*Timer_exit_function)(void) = 0; /*-------------------------------------------------------------------------+ @@ -112,7 +112,7 @@ tsc_timer_exit(void) } /* tsc_timer_exit */ /*-------------------------------------------------------------------------+ -| Function: Timer_initialize +| Function: benchmark_timerinitialize | Description: Timer initialization routine. | Global Variables: Ttimer_val. | Arguments: None. @@ -133,9 +133,9 @@ tsc_timer_initialize(void) } /* tsc_timer_initialize */ /*-------------------------------------------------------------------------+ -| Function: Read_timer +| Function: benchmark_timerread | Description: Read hardware timer value. -| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead. +| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ @@ -146,7 +146,7 @@ tsc_read_timer(void) total = (uint32_t)(rdtsc() - Ttimer_val); - if (Timer_driver_Find_average_overhead) + if (benchmark_timerfind_average_overhead) return total; else if (total < LEAST_VALID) return 0; /* below timer resolution */ @@ -222,7 +222,7 @@ i386_timer_exit(void) } /* Timer_exit */ /*-------------------------------------------------------------------------+ -| Function: Timer_initialize +| Function: benchmark_timerinitialize | Description: Timer initialization routine. | Global Variables: Ttimer_val. | Arguments: None. @@ -248,12 +248,12 @@ i386_timer_initialize(void) while (Ttimer_val == 0) continue; Ttimer_val = 0; -} /* Timer_initialize */ +} /* benchmark_timerinitialize */ /*-------------------------------------------------------------------------+ -| Function: Read_timer +| Function: benchmark_timerread | Description: Read hardware timer value. -| Global Variables: Ttimer_val, Timer_driver_Find_average_overhead. +| Global Variables: Ttimer_val, benchmark_timerfind_average_overhead. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ @@ -269,7 +269,7 @@ i386_read_timer(void) clicks = (msb << 8) | lsb; total = (Ttimer_val * US_PER_ISR) + (US_PER_ISR - TICK_TO_US(clicks)); - if (Timer_driver_Find_average_overhead) + if (benchmark_timerfind_average_overhead) return total; else if (total < LEAST_VALID) return 0; /* below timer resolution */ @@ -283,7 +283,7 @@ i386_read_timer(void) */ void -Timer_initialize(void) +benchmark_timerinitialize(void) { static rtems_boolean First = TRUE; @@ -292,27 +292,27 @@ Timer_initialize(void) #if defined(DEBUG) printk("TSC: timer initialization\n"); #endif /* DEBUG */ - Timer_initialize_function = &tsc_timer_initialize; - Read_timer_function = &tsc_read_timer; + benchmark_timerinitialize_function = &tsc_timer_initialize; + benchmark_timerread_function = &tsc_read_timer; Timer_exit_function = &tsc_timer_exit; } else { #if defined(DEBUG) printk("ISR: timer initialization\n"); #endif /* DEBUG */ - Timer_initialize_function = &i386_timer_initialize; - Read_timer_function = &i386_read_timer; + benchmark_timerinitialize_function = &i386_timer_initialize; + benchmark_timerread_function = &i386_read_timer; Timer_exit_function = &i386_timer_exit; } First = FALSE; } - (*Timer_initialize_function)(); + (*benchmark_timerinitialize_function)(); } uint32_t -Read_timer(void) +benchmark_timerread(void) { - return (*Read_timer_function)(); + return (*benchmark_timerread_function)(); } void @@ -322,29 +322,29 @@ Timer_exit(void) } /*-------------------------------------------------------------------------+ -| Function: Empty_function +| Function: benchmark_timerempty_function | Description: Empty function used in time tests. | Global Variables: None. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ -rtems_status_code Empty_function(void) +rtems_status_code benchmark_timerempty_function(void) { return RTEMS_SUCCESSFUL; } /* Empty function */ /*-------------------------------------------------------------------------+ -| Function: Set_find_average_overhead -| Description: Set internal Timer_driver_Find_average_overhead flag value. -| Global Variables: Timer_driver_Find_average_overhead. +| Function: benchmark_timerdisable_subtracting_average_overhead +| Description: Set internal benchmark_timerfind_average_overhead flag value. +| Global Variables: benchmark_timerfind_average_overhead. | Arguments: find_flag - new value of the flag. | Returns: Nothing. +--------------------------------------------------------------------------*/ void -Set_find_average_overhead(rtems_boolean find_flag) +benchmark_timerdisable_subtracting_average_overhead(rtems_boolean find_flag) { - Timer_driver_Find_average_overhead = find_flag; -} /* Set_find_average_overhead */ + benchmark_timerfind_average_overhead = find_flag; +} /* benchmark_timerdisable_subtracting_average_overhead */ static unsigned short lastLoadedValue; -- cgit v1.2.3