Skip to content
Snippets Groups Projects
Commit 5414d681 authored by Masatoshi.Tateishi's avatar Masatoshi.Tateishi Committed by Masayuki Ishikawa
Browse files

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: default avatarMasayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
parent eef12f1f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment