[PATCH 1/3] score: Use consistent type for SMP messages

Daniel Cederman cederman at gaisler.com
Mon Jul 7 07:37:57 UTC 2014


Broadcast and single send had different types so I picked the one with a 
defined length since we are doing bit operations on it. But I can change 
to unsigned long instead.

Daniel Cederman
Software Engineer
Aeroflex Gaisler AB
Aeroflex Microelectronic Solutions – HiRel
Kungsgatan 12
SE-411 19 Gothenburg, Sweden
Phone: +46 31 7758665
cederman at gaisler.com
www.Aeroflex.com/Gaisler

On 2014-07-07 08:50, Sebastian Huber wrote:
> I had a closer look at the change, and it makes no sense.  If you look at
>
> void _SMP_Send_message( uint32_t cpu_index, unsigned long message )
> {
>    Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
>
>    _Atomic_Fetch_or_ulong( &cpu->message, message, ATOMIC_ORDER_RELAXED );
>
>    _CPU_SMP_Send_interrupt( cpu_index );
> }
>
> you see that the message parameter is used by _Atomic_Fetch_or_ulong().
> So the type must be unsigned long and not uint32_t.
>
> On 2014-07-03 11:37, Daniel Cederman wrote:
>> ---
>>   cpukit/score/include/rtems/score/smpimpl.h |    2 +-
>>   cpukit/score/src/smp.c                     |    2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/cpukit/score/include/rtems/score/smpimpl.h
>> b/cpukit/score/include/rtems/score/smpimpl.h
>> index e2fee39..ba16c8f 100644
>> --- a/cpukit/score/include/rtems/score/smpimpl.h
>> +++ b/cpukit/score/include/rtems/score/smpimpl.h
>> @@ -159,7 +159,7 @@ static inline void
>> _SMP_Inter_processor_interrupt_handler( void )
>>    *  @param[in] cpu_index The target processor of the message.
>>    *  @param[in] message The message.
>>    */
>> -void _SMP_Send_message( uint32_t cpu_index, unsigned long message );
>> +void _SMP_Send_message( uint32_t cpu_index, uint32_t message );
>>
>>   /**
>>    *  @brief Request of others CPUs.
>> diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
>> index f0554fe..59448a0 100644
>> --- a/cpukit/score/src/smp.c
>> +++ b/cpukit/score/src/smp.c
>> @@ -153,7 +153,7 @@ void _SMP_Request_shutdown( void )
>>     _Giant_Drop( self_cpu );
>>   }
>>
>> -void _SMP_Send_message( uint32_t cpu_index, unsigned long message )
>> +void _SMP_Send_message( uint32_t cpu_index, uint32_t message )
>>   {
>>     Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
>>
>>
>
>


More information about the devel mailing list