Merged in masayuki2009/nuttx.nuttx/smp_fixes (pull request #561)
SMP fixes Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
commit
4e64e6b3c3
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user