From 3dfe55ee154b6053e936e7b458206b71aad51caa Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 3 Jul 2017 11:46:12 +0200 Subject: score: Use for Processor_mask Implement the Processor_mask via . Provide _Processor_mask_To_uint32_t() to enable its use in device specific routines, e.g. interrupt affinity register in an interrupt controller. Update #3059. --- cpukit/score/src/smp.c | 8 ++++---- cpukit/score/src/smpmulticastaction.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 434483c5ad..a69b7ed46a 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -101,7 +101,7 @@ static void _SMP_Start_processors( uint32_t cpu_count ) cpu->Scheduler.control = scheduler; cpu->Scheduler.context = context; - _Processor_mask_Set( _SMP_Online_processors, cpu_index ); + _Processor_mask_Set( &_SMP_Online_processors, cpu_index ); } } } @@ -217,7 +217,7 @@ void _SMP_Send_message_broadcast( unsigned long message ) for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { if ( cpu_index != cpu_index_self - && _Processor_mask_Is_set( _SMP_Online_processors, cpu_index ) + && _Processor_mask_Is_set( &_SMP_Online_processors, cpu_index ) ) { _SMP_Send_message( cpu_index, message ); } @@ -225,8 +225,8 @@ void _SMP_Send_message_broadcast( unsigned long message ) } void _SMP_Send_message_multicast( - const Processor_mask targets, - unsigned long message + const Processor_mask *targets, + unsigned long message ) { uint32_t cpu_count = _SMP_Get_processor_count(); diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c index a7c63498a3..73b15001ab 100644 --- a/cpukit/score/src/smpmulticastaction.c +++ b/cpukit/score/src/smpmulticastaction.c @@ -47,12 +47,12 @@ void _SMP_Multicast_actions_process( void ) while ( !_Chain_Is_tail( &_SMP_Multicast.Actions, &node->Node ) ) { next = (SMP_Multicast_action *) _Chain_Next( &node->Node ); - if ( _Processor_mask_Is_set( node->targets, cpu_self_index ) ) { - _Processor_mask_Clear( node->targets, cpu_self_index ); + if ( _Processor_mask_Is_set( &node->targets, cpu_self_index ) ) { + _Processor_mask_Clear( &node->targets, cpu_self_index ); ( *node->handler )( node->arg ); - if ( _Processor_mask_Is_zero( node->targets ) ) { + if ( _Processor_mask_Is_zero( &node->targets ) ) { _Chain_Extract_unprotected( &node->Node ); _Atomic_Store_ulong( &node->done, 1, ATOMIC_ORDER_RELEASE ); } @@ -106,13 +106,13 @@ void _SMP_Multicast_action( } if( cpus == NULL ) { - _Processor_mask_Assign( targets, _SMP_Online_processors ); + _Processor_mask_Assign( &targets, &_SMP_Online_processors ); } else { - _Processor_mask_Zero( targets ); + _Processor_mask_Zero( &targets ); for ( i = 0; i < _SMP_Get_processor_count(); ++i ) { if ( CPU_ISSET_S( i, setsize, cpus ) ) { - _Processor_mask_Set( targets, i ); + _Processor_mask_Set( &targets, i ); } } } @@ -120,14 +120,14 @@ void _SMP_Multicast_action( _Chain_Initialize_node( &node.Node ); node.handler = handler; node.arg = arg; - _Processor_mask_Assign( node.targets, targets ); + _Processor_mask_Assign( &node.targets, &targets ); _Atomic_Store_ulong( &node.done, 0, ATOMIC_ORDER_RELAXED ); _SMP_lock_ISR_disable_and_acquire( &_SMP_Multicast.Lock, &lock_context ); _Chain_Prepend_unprotected( &_SMP_Multicast.Actions, &node.Node ); _SMP_lock_Release_and_ISR_enable( &_SMP_Multicast.Lock, &lock_context ); - _SMP_Send_message_multicast( targets, SMP_MESSAGE_MULTICAST_ACTION ); + _SMP_Send_message_multicast( &targets, SMP_MESSAGE_MULTICAST_ACTION ); _SMP_Multicasts_try_process(); while ( _Atomic_Load_ulong( &node.done, ATOMIC_ORDER_ACQUIRE ) == 0 ) { -- cgit v1.2.3