summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-29 09:50:47 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-29 09:50:47 +0200
commit9bb3ce3918261c5392abbe4b65902e5d4b6dff07 (patch)
treea0ce25f5619672f3afd222cfe79460e88858d2da /cpukit/score/src/smp.c
parentarm/raspberrypi: resolve BSP warnings. (diff)
downloadrtems-9bb3ce3918261c5392abbe4b65902e5d4b6dff07.tar.bz2
score: Fix SMP message handling
According to the C11 standard only atomic read-modify-write operations guarantee that the last value written in modification order is read, see "7.17.3 Order and consistency". Thus we must use a read-modify-write in _SMP_Inter_processor_interrupt_handler() to make sure we read an up-to-date message.
Diffstat (limited to 'cpukit/score/src/smp.c')
-rw-r--r--cpukit/score/src/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index e26de42e68..d6aad85e76 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -167,7 +167,7 @@ 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 );
+ _Atomic_Fetch_or_ulong( &cpu->message, message, ATOMIC_ORDER_RELEASE );
_CPU_SMP_Send_interrupt( cpu_index );
}