diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-10 08:25:32 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-11 10:58:09 +0100 |
commit | d50acdbb6c8213114ce887a56daea02697c9e1a1 (patch) | |
tree | e48fb252786992308fa2dd6337c8a02db35bd10b /cpukit/score/src/smp.c | |
parent | sapi: Use one SMP lock for all chains (diff) | |
download | rtems-d50acdbb6c8213114ce887a56daea02697c9e1a1.tar.bz2 |
score: Add local context to SMP lock API
Add a local context structure to the SMP lock API for acquire and
release pairs. This context can be used to store the ISR level and
profiling information. It may be later used to enable more
sophisticated lock algorithms, e.g. MCS locks.
There is only one lock that cannot be used with a local context. This
is the per-CPU lock since here we would have to transfer the local
context through a context switch which is very complicated.
Diffstat (limited to 'cpukit/score/src/smp.c')
-rw-r--r-- | cpukit/score/src/smp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index e56073d281..40d2ac3088 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -32,7 +32,7 @@ void _SMP_Handler_initialize( void ) for ( cpu = 0 ; cpu < max_cpus; ++cpu ) { Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu ); - _ISR_lock_Initialize( &per_cpu->lock ); + _SMP_ticket_lock_Initialize( &per_cpu->Lock ); } /* @@ -69,8 +69,7 @@ void _SMP_Start_multitasking_on_secondary_processor( void ) void _SMP_Request_shutdown( void ) { - uint32_t self = _SMP_Get_current_processor(); - Per_CPU_Control *self_cpu = _Per_CPU_Get_by_index( self ); + Per_CPU_Control *self_cpu = _Per_CPU_Get(); _Per_CPU_State_change( self_cpu, PER_CPU_STATE_SHUTDOWN ); @@ -80,7 +79,7 @@ void _SMP_Request_shutdown( void ) * In case the executing thread still holds SMP locks, then other processors * already waiting for this SMP lock will spin forever. */ - _Giant_Drop( self ); + _Giant_Drop( self_cpu ); } void _SMP_Send_message( uint32_t cpu, uint32_t message ) |