SMP: Fix some debug assertion problems when DEBUG is enabled; Partial fix for one bring-up issue
This commit is contained in:
parent
64b3ce8775
commit
3f7f58de9d
2
arch
2
arch
@ -1 +1 @@
|
|||||||
Subproject commit a6ad88a85c9e4c6ab633fb53f53603539206a57c
|
Subproject commit 4abb8523390cecded97fe325448213983e47aedf
|
@ -94,9 +94,21 @@ static const char g_idlename[] = "CPUn Idle"
|
|||||||
|
|
||||||
int os_idletask(int argc, FAR char *argv[])
|
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 */
|
/* Enter the IDLE loop */
|
||||||
|
|
||||||
sdbg("CPU%d: Beginning Idle Loop\n");
|
sdbg("CPU%d: Beginning Idle Loop\n", this_cpu());
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* Perform garbage collection (if it is not being done by the worker
|
/* 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));
|
DEBUGVERIFY(group_allocate(itcb, itcb->cmn.flags));
|
||||||
#endif
|
#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
|
#ifdef HAVE_TASK_GROUP
|
||||||
/* Complete initialization of the IDLE group. Suppress retention
|
/* Complete initialization of the IDLE group. Suppress retention
|
||||||
* of child status in the IDLE group.
|
* of child status in the IDLE group.
|
||||||
|
@ -251,7 +251,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
|
|||||||
* CPU and avoids such complexities.
|
* 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);
|
lock->sp_cpu == this_cpu() && lock->sp_count > 0);
|
||||||
|
|
||||||
/* Do we already hold the lock? */
|
/* Do we already hold the lock? */
|
||||||
@ -260,7 +260,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
|
|||||||
#else
|
#else
|
||||||
/* The alternative is to allow the lock to be released from any CPU */
|
/* 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);
|
lock->sp_count > 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
|
|||||||
#else /* CONFIG_SMP */
|
#else /* CONFIG_SMP */
|
||||||
/* Just mark the spinlock unlocked */
|
/* 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;
|
lock->sp_lock = SP_UNLOCKED;
|
||||||
|
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
Loading…
Reference in New Issue
Block a user