diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-22 07:46:53 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-22 08:34:45 +0200 |
commit | 3380ee8194ec35506b88257f369e88d1d26350f1 (patch) | |
tree | f2b84dc6ddc0d66e044b012bde6cb036828d5bf6 /cpukit/score/src/threaddispatchdisablelevel.c | |
parent | score: Fix warning (diff) | |
download | rtems-3380ee8194ec35506b88257f369e88d1d26350f1.tar.bz2 |
score: Use common names for per-CPU variables
Use "cpu" for an arbitrary Per_CPU_Control variable.
Use "cpu_self" for the Per_CPU_Control of the current processor.
Use "cpu_index" for an arbitrary processor index.
Use "cpu_index_self" for the processor index of the current processor.
Use "cpu_count" for the processor count obtained via
_SMP_Get_processor_count().
Use "cpu_max" for the processor maximum obtained by
rtems_configuration_get_maximum_processors().
Diffstat (limited to 'cpukit/score/src/threaddispatchdisablelevel.c')
-rw-r--r-- | cpukit/score/src/threaddispatchdisablelevel.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/cpukit/score/src/threaddispatchdisablelevel.c b/cpukit/score/src/threaddispatchdisablelevel.c index 1a17aeeaf9..3b7837c1cb 100644 --- a/cpukit/score/src/threaddispatchdisablelevel.c +++ b/cpukit/score/src/threaddispatchdisablelevel.c @@ -34,40 +34,40 @@ static Giant_Control _Giant = { .nest_level = 0 }; -static void _Giant_Do_acquire( Per_CPU_Control *self_cpu ) +static void _Giant_Do_acquire( Per_CPU_Control *cpu_self ) { Giant_Control *giant = &_Giant; - if ( giant->owner_cpu != self_cpu ) { - _SMP_lock_Acquire( &giant->lock, &self_cpu->Giant_lock_context ); - giant->owner_cpu = self_cpu; + if ( giant->owner_cpu != cpu_self ) { + _SMP_lock_Acquire( &giant->lock, &cpu_self->Giant_lock_context ); + giant->owner_cpu = cpu_self; giant->nest_level = 1; } else { ++giant->nest_level; } } -static void _Giant_Do_release( Per_CPU_Control *self_cpu ) +static void _Giant_Do_release( Per_CPU_Control *cpu_self ) { Giant_Control *giant = &_Giant; --giant->nest_level; if ( giant->nest_level == 0 ) { giant->owner_cpu = NO_OWNER_CPU; - _SMP_lock_Release( &giant->lock, &self_cpu->Giant_lock_context ); + _SMP_lock_Release( &giant->lock, &cpu_self->Giant_lock_context ); } } -void _Giant_Drop( Per_CPU_Control *self_cpu ) +void _Giant_Drop( Per_CPU_Control *cpu_self ) { Giant_Control *giant = &_Giant; _Assert( _ISR_Get_level() != 0 ); - if ( giant->owner_cpu == self_cpu ) { + if ( giant->owner_cpu == cpu_self ) { giant->nest_level = 0; giant->owner_cpu = NO_OWNER_CPU; - _SMP_lock_Release( &giant->lock, &self_cpu->Giant_lock_context ); + _SMP_lock_Release( &giant->lock, &cpu_self->Giant_lock_context ); } } @@ -75,7 +75,7 @@ uint32_t _Thread_Dispatch_increment_disable_level( void ) { ISR_Level isr_level; uint32_t disable_level; - Per_CPU_Control *self_cpu; + Per_CPU_Control *cpu_self; _ISR_Disable_without_giant( isr_level ); @@ -83,14 +83,14 @@ uint32_t _Thread_Dispatch_increment_disable_level( void ) * We must obtain the processor after interrupts are disabled to prevent * thread migration. */ - self_cpu = _Per_CPU_Get(); + cpu_self = _Per_CPU_Get(); - _Giant_Do_acquire( self_cpu ); + _Giant_Do_acquire( cpu_self ); - disable_level = self_cpu->thread_dispatch_disable_level; - _Profiling_Thread_dispatch_disable( self_cpu, disable_level ); + disable_level = cpu_self->thread_dispatch_disable_level; + _Profiling_Thread_dispatch_disable( cpu_self, disable_level ); ++disable_level; - self_cpu->thread_dispatch_disable_level = disable_level; + cpu_self->thread_dispatch_disable_level = disable_level; _ISR_Enable_without_giant( isr_level ); @@ -101,19 +101,19 @@ uint32_t _Thread_Dispatch_decrement_disable_level( void ) { ISR_Level isr_level; uint32_t disable_level; - Per_CPU_Control *self_cpu; + Per_CPU_Control *cpu_self; _ISR_Disable_without_giant( isr_level ); - self_cpu = _Per_CPU_Get(); - disable_level = self_cpu->thread_dispatch_disable_level; + cpu_self = _Per_CPU_Get(); + disable_level = cpu_self->thread_dispatch_disable_level; --disable_level; - self_cpu->thread_dispatch_disable_level = disable_level; + cpu_self->thread_dispatch_disable_level = disable_level; - _Giant_Do_release( self_cpu ); - _Assert( disable_level != 0 || _Giant.owner_cpu != self_cpu ); + _Giant_Do_release( cpu_self ); + _Assert( disable_level != 0 || _Giant.owner_cpu != cpu_self ); - _Profiling_Thread_dispatch_enable( self_cpu, disable_level ); + _Profiling_Thread_dispatch_enable( cpu_self, disable_level ); _ISR_Enable_without_giant( isr_level ); return disable_level; |