From 46f05b92b20bd5d38bb952f6aaad6a7783ce36c9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 5 Apr 2017 11:28:46 +0200 Subject: SMP: Simplify SMP multicast actions --- cpukit/score/include/rtems/score/processormask.h | 31 ++++++++++++++++++++++++ cpukit/score/include/rtems/score/smpimpl.h | 8 +++--- 2 files changed, 34 insertions(+), 5 deletions(-) (limited to 'cpukit/score/include/rtems') diff --git a/cpukit/score/include/rtems/score/processormask.h b/cpukit/score/include/rtems/score/processormask.h index 5a78dd33c6..8ee869a895 100644 --- a/cpukit/score/include/rtems/score/processormask.h +++ b/cpukit/score/include/rtems/score/processormask.h @@ -62,6 +62,37 @@ extern "C" { */ typedef uint32_t Processor_mask[ PROCESSOR_MASK_FIELD_COUNT ]; +RTEMS_INLINE_ROUTINE void _Processor_mask_Zero( Processor_mask mask ) +{ + size_t i; + + for ( i = 0; i < PROCESSOR_MASK_FIELD_COUNT; ++i ) { + mask[ i ] = 0; + } +} + +RTEMS_INLINE_ROUTINE bool _Processor_mask_Is_zero( const Processor_mask mask ) +{ + size_t i; + + for ( i = 0; i < PROCESSOR_MASK_FIELD_COUNT; ++i ) { + if ( mask[ i ] != 0 ) { + return false; + } + } + + return true; +} + +RTEMS_INLINE_ROUTINE void _Processor_mask_Assign( Processor_mask dst, const Processor_mask src ) +{ + size_t i; + + for ( i = 0; i < PROCESSOR_MASK_FIELD_COUNT; ++i ) { + dst[ i ] = src[ i ]; + } +} + RTEMS_INLINE_ROUTINE void _Processor_mask_Set( Processor_mask mask, uint32_t index ) { mask[ PROCESSOR_MASK_FIELD( index ) ] |= PROCESSOR_MASK_BIT( index ); diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h index 1651a5ecc6..f85251e8b0 100644 --- a/cpukit/score/include/rtems/score/smpimpl.h +++ b/cpukit/score/include/rtems/score/smpimpl.h @@ -237,14 +237,12 @@ void _SMP_Send_message_broadcast( * * The sending processor may be part of the set. * - * @param[in] setsize The size of the set of target processors of the message. - * @param[in] cpus The set of target processors of the message. + * @param[in] targets The set of processors to send the message. * @param[in] message The message. */ void _SMP_Send_message_multicast( - const size_t setsize, - const cpu_set_t *cpus, - unsigned long message + const Processor_mask targets, + unsigned long message ); typedef void ( *SMP_Action_handler )( void *arg ); -- cgit v1.2.3