arch/arm/src/lc823450: Add SP_DMB() into lc823450_testset.c
In lc823450, ldrex and strex are not supported. So we implemented up_testset() with H/W Mutex. However, there was a bug in memory access order. This change ensures correct memory access order in up_testset() for lc823450. Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
eef12f1f91
commit
5414d68161
@ -95,12 +95,15 @@ spinlock_t up_testset(volatile FAR spinlock_t *lock)
|
||||
}
|
||||
while (getreg32(MUTEX_REG_MUTEX0) != val);
|
||||
|
||||
SP_DMB();
|
||||
|
||||
ret = *lock;
|
||||
|
||||
if (ret == SP_UNLOCKED)
|
||||
{
|
||||
*lock = SP_LOCKED;
|
||||
}
|
||||
SP_DMB();
|
||||
|
||||
val = (up_cpu_index() << 16) | 0x0;
|
||||
putreg32(val, MUTEX_REG_MUTEX0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user