summaryrefslogtreecommitdiff
path: root/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/pjrc-8051/src/up_reprioritizertr.c')
-rw-r--r--nuttx/arch/pjrc-8051/src/up_reprioritizertr.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
index dbb9db3c4..39c1cf508 100644
--- a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
+++ b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
@@ -136,28 +136,26 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
/* Are we in an interrupt handler? */
- if (g_ininterrupt)
+ if (g_irqtos)
{
-#if 0
-# warning REVISIT
/* Yes, then we have to do things differently.
* Just copy the current registers into the OLD rtcb.
*/
- up_copystate(&tcb->xcp, current_regs);
+ up_savestack(&tcb->xcp);
/* Restore the exception context of the rtcb at the (new) head
* of the g_readytorun task list.
*/
- rtcb = (_TCB*)g_readytorun.head;
+ rtcb = (FAR _TCB*)g_readytorun.head;
dbg("New Active Task TCB=%p\n", rtcb);
/* Then switch contexts */
- up_copystate(current_regs, &tcb->xcp);
-#endif
+ up_restorestack(&tcb->xcp);
}
+
/* Copy the exception context into the TCB at the (old) head of the
* g_readytorun Task list. if up_savecontext returns a non-zero
* value, then this is really the previously running task restarting!