Rename accumulatedCount to clock_accumulated_count

Updating local variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I80ccb884f1ffd8f3740cd9298787462485b08024
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
Yonattan Louise 2015-05-11 14:57:46 -05:00 committed by Anas Nashif
parent 79a1e38f20
commit 7770ec2db1
4 changed files with 23 additions and 23 deletions

View File

@ -65,7 +65,7 @@ The ARCv2 processor timer provides a 32-bit incrementing, wrap-to-zero counter.
#define _ARC_V2_TMR_CTRL_IP 0x8 /* interrupt pending flag */
/* running total of timer count */
static uint32_t accumulatedCount = 0;
static uint32_t clock_accumulated_count = 0;
/*******************************************************************************
@ -148,7 +148,7 @@ void _timer_int_handler(void *unused)
/* clear the interrupt by writing 0 to IP bit of the control register */
_arc_v2_aux_reg_write(_ARC_V2_TMR0_CONTROL, zero_ip_bit);
accumulatedCount += sys_clock_hw_cycles_per_tick;
clock_accumulated_count += sys_clock_hw_cycles_per_tick;
_nano_ticks++;
@ -212,7 +212,7 @@ void timer_driver(
uint32_t timer_read(void)
{
return (accumulatedCount + count_get());
return (clock_accumulated_count + count_get());
}
#if defined(CONFIG_SYSTEM_TIMER_DISABLE)

View File

@ -69,7 +69,7 @@ extern struct nano_stack _k_command_stack;
#endif /* CONFIG_MICROKERNEL */
/* running total of timer count */
static uint32_t accumulatedCount = 0;
static uint32_t clock_accumulated_count = 0;
/*
* A board support package's board.h header must provide definitions for the
@ -340,13 +340,13 @@ void _TIMER_INT_HANDLER(void *unused)
}
/* accumulate total counter value */
accumulatedCount += defaultLoadVal * _sys_idle_elapsed_ticks;
clock_accumulated_count += defaultLoadVal * _sys_idle_elapsed_ticks;
#else /* !CONFIG_TICKLESS_IDLE */
/*
* No tickless idle:
* Update the total tick count and announce this tick to the kernel.
*/
accumulatedCount += sys_clock_hw_cycles_per_tick;
clock_accumulated_count += sys_clock_hw_cycles_per_tick;
nano_isr_stack_push(&_k_command_stack, TICK_EVENT);
#endif /* CONFIG_TICKLESS_IDLE */
@ -369,7 +369,7 @@ void _TIMER_INT_HANDLER(void *unused)
#else /* !CONFIG_ADVANCED_POWER_MANAGEMENT */
/* accumulate total counter value */
accumulatedCount += sys_clock_hw_cycles_per_tick;
clock_accumulated_count += sys_clock_hw_cycles_per_tick;
#ifdef CONFIG_MICROKERNEL
/*
@ -694,7 +694,7 @@ void timer_driver(int priority /* priority parameter is ignored by this driver
uint32_t timer_read(void)
{
return accumulatedCount + (__scs.systick.strvr - __scs.systick.stcvr);
return clock_accumulated_count + (__scs.systick.strvr - __scs.systick.stcvr);
}
#ifdef CONFIG_SYSTEM_TIMER_DISABLE

View File

@ -130,7 +130,7 @@ SYS_INT_REGISTER(_loApicTimerIntStub, LOAPIC_TIMER_IRQ, LOAPIC_TIMER_INT_PRI);
static uint32_t __noinit counterLoadVal; /* computed counter 0
initial count value */
static uint32_t accumulatedCount = 0;
static uint32_t clock_accumulated_count = 0;
#if defined(TIMER_SUPPORTS_TICKLESS)
static uint32_t _IdleOrigCount = 0;
@ -322,7 +322,7 @@ void _timer_int_handler(void *unused /* parameter is not used */
_sys_idle_elapsed_ticks++;
/* accumulate total counter value */
accumulatedCount += counterLoadVal * _sys_idle_elapsed_ticks;
clock_accumulated_count += counterLoadVal * _sys_idle_elapsed_ticks;
/*
* If we transistion from 0 elapsed ticks to 1 we need to announce the
@ -336,7 +336,7 @@ void _timer_int_handler(void *unused /* parameter is not used */
#else
/* accumulate total counter value */
accumulatedCount += counterLoadVal;
clock_accumulated_count += counterLoadVal;
#if defined(CONFIG_MICROKERNEL)
/* announce tick into the microkernel */
@ -636,13 +636,13 @@ uint32_t timer_read(void)
#if !defined(TIMER_SUPPORTS_TICKLESS)
/* counter is a down counter so need to subtact from counterLoadVal */
val = accumulatedCount - _loApicTimerGetRemaining() + counterLoadVal;
val = clock_accumulated_count - _loApicTimerGetRemaining() + counterLoadVal;
#else
/*
* counter is a down counter so need to subtact from what was programmed
* in the reload register
*/
val = accumulatedCount - _loApicTimerGetRemaining() +
val = clock_accumulated_count - _loApicTimerGetRemaining() +
_loApicTimerGetCount();
#endif

View File

@ -133,7 +133,7 @@ static NANO_CPU_INT_STUB_DECL(_i8253IntStub);
#endif
static uint16_t __noinit counterLoadVal; /* computed counter */
static volatile uint32_t accumulatedCount = 0;
static volatile uint32_t clock_accumulated_count = 0;
static uint16_t _currentLoadVal = 0;
#if defined(TIMER_SUPPORTS_TICKLESS)
@ -289,7 +289,7 @@ void _timer_int_handler(void *unusedArg /* not used */
}
/* accumulate total counter value */
accumulatedCount += counterLoadVal * _sys_idle_elapsed_ticks;
clock_accumulated_count += counterLoadVal * _sys_idle_elapsed_ticks;
#else
#if defined(CONFIG_MICROKERNEL)
@ -298,20 +298,20 @@ void _timer_int_handler(void *unusedArg /* not used */
#endif
/* accumulate total counter value */
accumulatedCount += counterLoadVal;
clock_accumulated_count += counterLoadVal;
#endif /* TIMER_SUPPORTS_TICKLESS */
/*
* Algorithm tries to compensate lost interrupts if any happened and
* prevent the timer from counting backwards
* ULONG_MAX / 2 is the maximal value that oldCount can be more than
* accumulatedCount. If it is more -- consider it as an accumulatedCount
* clock_accumulated_count. If it is more -- consider it as an clock_accumulated_count
* wrap and do not try to compensate.
*/
if (accumulatedCount < oldCount) {
uint32_t tmp = oldCount - accumulatedCount;
if (clock_accumulated_count < oldCount) {
uint32_t tmp = oldCount - clock_accumulated_count;
if ((tmp >= counterLoadVal) && (tmp < (ULONG_MAX / 2))) {
accumulatedCount += tmp - tmp % counterLoadVal;
clock_accumulated_count += tmp - tmp % counterLoadVal;
}
}
@ -569,20 +569,20 @@ uint32_t timer_read(void)
#endif
/* counters are down counters so need to subtact from counterLoadVal */
newCount = accumulatedCount + _currentLoadVal - _i8253CounterRead();
newCount = clock_accumulated_count + _currentLoadVal - _i8253CounterRead();
/*
* This algorithm fixes the situation when the timer counter reset
* happened before the timer interrupt (due to possible interrupt
* disable)
*/
if ((newCount < oldCount) && (accumulatedCount == oldAcc)) {
if ((newCount < oldCount) && (clock_accumulated_count == oldAcc)) {
uint32_t tmp = oldCount - newCount;
newCount += tmp - tmp % _currentLoadVal + _currentLoadVal;
}
oldCount = newCount;
oldAcc = accumulatedCount;
oldAcc = clock_accumulated_count;
#ifdef CONFIG_INT_LATENCY_BENCHMARK
/*