mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Cannot use dbg() macro in middle of context switch if output is to console driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@88 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -95,6 +95,8 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|
||||||
|
lldbg("Blocking TCB=%p\n", tcb);
|
||||||
|
|
||||||
/* Remove the tcb task from the ready-to-run list. If we
|
/* Remove the tcb task from the ready-to-run list. If we
|
||||||
* are blocking the task at the head of the task list (the
|
* are blocking the task at the head of the task list (the
|
||||||
* most likely case), then a context switch to the next
|
* most likely case), then a context switch to the next
|
||||||
@@ -136,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -155,7 +157,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ void up_release_pending(void)
|
|||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
dbg("From TCB=%p\n", rtcb);
|
lldbg("From TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|
||||||
dbg("TCB=%p PRI=%d\n", tcb, priority);
|
lldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||||
|
|
||||||
/* Remove the tcb task from the ready-to-run list.
|
/* Remove the tcb task from the ready-to-run list.
|
||||||
* sched_removereadytorun will return TRUE if we just
|
* sched_removereadytorun will return TRUE if we just
|
||||||
@@ -149,7 +149,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
void up_unblock_task(_TCB *tcb)
|
void up_unblock_task(_TCB *tcb)
|
||||||
{
|
{
|
||||||
/* Verify that the context switch can be performed */
|
/* Verify that the context switch can be performed */
|
||||||
|
|
||||||
if ((tcb->task_state < FIRST_BLOCKED_STATE) ||
|
if ((tcb->task_state < FIRST_BLOCKED_STATE) ||
|
||||||
(tcb->task_state > LAST_BLOCKED_STATE))
|
(tcb->task_state > LAST_BLOCKED_STATE))
|
||||||
{
|
{
|
||||||
@@ -89,7 +90,7 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
dbg("Unblocking TCB=%p\n", tcb);
|
lldbg("Unblocking TCB=%p\n", tcb);
|
||||||
|
|
||||||
/* Remove the task from the blocked task list */
|
/* Remove the task from the blocked task list */
|
||||||
|
|
||||||
@@ -128,14 +129,14 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_copystate(current_regs, rtcb->xcp.regs);
|
up_copystate(current_regs, rtcb->xcp.regs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We are not in an interrupt andler. Copy the user C context
|
/* We are not in an interrupt handler. Copy the user C context
|
||||||
* into the TCB of the task that was previously active. if
|
* into the TCB of the task that was previously active. if
|
||||||
* up_saveusercontext returns a non-zero value, then this is really the
|
* up_saveusercontext returns a non-zero value, then this is really the
|
||||||
* previously running task restarting!
|
* previously running task restarting!
|
||||||
@@ -149,7 +150,7 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|
||||||
|
lldbg("Blocking TCB=%p\n", tcb);
|
||||||
|
|
||||||
/* Remove the tcb task from the ready-to-run list. If we
|
/* Remove the tcb task from the ready-to-run list. If we
|
||||||
* are blocking the task at the head of the task list (the
|
* are blocking the task at the head of the task list (the
|
||||||
* most likely case), then a context switch to the next
|
* most likely case), then a context switch to the next
|
||||||
@@ -136,7 +138,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -155,7 +157,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ void up_release_pending(void)
|
|||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
dbg("From TCB=%p\n", rtcb);
|
lldbg("From TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|
||||||
dbg("TCB=%p PRI=%d\n", tcb, priority);
|
lldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||||
|
|
||||||
/* Remove the tcb task from the ready-to-run list.
|
/* Remove the tcb task from the ready-to-run list.
|
||||||
* sched_removereadytorun will return TRUE if we just
|
* sched_removereadytorun will return TRUE if we just
|
||||||
@@ -149,7 +149,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
|
|
||||||
dbg("Unblocking TCB=%p\n", tcb);
|
lldbg("Unblocking TCB=%p\n", tcb);
|
||||||
|
|
||||||
/* Remove the task from the blocked task list */
|
/* Remove the task from the blocked task list */
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ void up_unblock_task(_TCB *tcb)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (_TCB*)g_readytorun.head;
|
rtcb = (_TCB*)g_readytorun.head;
|
||||||
dbg("New Active Task TCB=%p\n", rtcb);
|
lldbg("New Active Task TCB=%p\n", rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user