Skip to content
Snippets Groups Projects
Commit 4e64e6b3 authored by Masayuki Ishikawa's avatar Masayuki Ishikawa Committed by Gregory Nutt
Browse files

Merged in masayuki2009/nuttx.nuttx/smp_fixes (pull request #561)


SMP fixes

Approved-by: default avatarGregory Nutt <gnutt@nuttx.org>
parents 52fccefe e1f71f98
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);
......
......@@ -165,8 +165,9 @@ void spin_unlock(FAR volatile spinlock_t *lock)
sched_note_spinunlock(this_task(), lock);
#endif
*lock = SP_UNLOCKED;
SP_DMB();
*lock = SP_UNLOCKED;
SP_DSB();
}
#endif
......
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