forked from Imagelibrary/rtems
SMP: Fix and optimize thread dispatching
According to the C11 and C++11 memory models only a read-modify-write operation guarantees that we read the last value written in modification order. Avoid the sequential consistent thread fence and instead use the inter-processor interrupt to set the thread dispatch necessary indicator.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2014 embedded brains GmbH.
|
||||
* Copyright (c) 2008-2015 embedded brains GmbH.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Dornierstr. 4
|
||||
@@ -206,6 +206,13 @@ static inline void ppc_synchronize_data(void)
|
||||
__asm__ volatile ("sync");
|
||||
}
|
||||
|
||||
static inline void ppc_light_weight_synchronize(void)
|
||||
{
|
||||
RTEMS_COMPILER_MEMORY_BARRIER();
|
||||
|
||||
__asm__ volatile ("lwsync");
|
||||
}
|
||||
|
||||
static inline void ppc_synchronize_instructions(void)
|
||||
{
|
||||
RTEMS_COMPILER_MEMORY_BARRIER();
|
||||
|
||||
Reference in New Issue
Block a user