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

SMP fixes

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2017-12-21 12:31:04 +00:00 committed by Gregory Nutt
commit 4e64e6b3c3
2 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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