SMP: Fix some debug assertion problems when DEBUG is enabled; Partial fix for one bring-up issue

This commit is contained in:
Gregory Nutt 2016-02-12 17:13:38 -06:00
parent 64b3ce8775
commit 3f7f58de9d
3 changed files with 17 additions and 13 deletions

2
arch

@ -1 +1 @@
Subproject commit a6ad88a85c9e4c6ab633fb53f53603539206a57c
Subproject commit 4abb8523390cecded97fe325448213983e47aedf

View File

@ -94,9 +94,21 @@ static const char g_idlename[] = "CPUn Idle"
int os_idletask(int argc, FAR char *argv[])
{
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0
/* Finish TCB initialization */
FAR struct task_tcb_s *rtcb = (FAR struct task_tcb_s *)this_task();
/* Create stdout, stderr, stdin on the IDLE task. These will be
* inherited by all of the threads created by the IDLE task.
*/
DEBUGVERIFY(group_setupidlefiles(rtcb));
#endif
/* Enter the IDLE loop */
sdbg("CPU%d: Beginning Idle Loop\n");
sdbg("CPU%d: Beginning Idle Loop\n", this_cpu());
for (; ; )
{
/* Perform garbage collection (if it is not being done by the worker
@ -210,14 +222,6 @@ static FAR void *os_idletcb_setup(int cpu, main_t idletask, pid_t pid)
DEBUGVERIFY(group_allocate(itcb, itcb->cmn.flags));
#endif
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0
/* Create stdout, stderr, stdin on the IDLE task. These will be
* inherited by all of the threads created by the IDLE task.
*/
DEBUGVERIFY(group_setupidlefiles(itcb));
#endif
#ifdef HAVE_TASK_GROUP
/* Complete initialization of the IDLE group. Suppress retention
* of child status in the IDLE group.

View File

@ -251,7 +251,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
* CPU and avoids such complexities.
*/
DEBUGASSERT(lock != NULL && lock->sp-lock = SP_LOCKED &&
DEBUGASSERT(lock != NULL && lock->sp_lock == SP_LOCKED &&
lock->sp_cpu == this_cpu() && lock->sp_count > 0);
/* Do we already hold the lock? */
@ -260,7 +260,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
#else
/* The alternative is to allow the lock to be released from any CPU */
DEBUGASSERT(lock != NULL && lock->sp-lock = SP_LOCKED &&
DEBUGASSERT(lock != NULL && lock->sp_lock == SP_LOCKED &&
lock->sp_count > 0);
#endif
@ -286,7 +286,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
#else /* CONFIG_SMP */
/* Just mark the spinlock unlocked */
DEBUGASSERT(lock != NULL && lock->sp-lock = SP_LOCKED);
DEBUGASSERT(lock != NULL && lock->sp_lock == SP_LOCKED);
lock->sp_lock = SP_UNLOCKED;
#endif /* CONFIG_SMP */