diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-06 21:34:32 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-06 21:34:32 +0000 |
commit | 51341b9f7069bc9c18a18cb8e4e7f66a3a27365a (patch) | |
tree | 9303669632179fa7f09ccc0b3d63157c4094b85d /nuttx/arch/pjrc-8051/src/up_unblocktask.c | |
parent | 36be54817fe1d8879f26b7f0e1797e8ba23e8a0f (diff) | |
download | px4-nuttx-51341b9f7069bc9c18a18cb8e4e7f66a3a27365a.tar.gz px4-nuttx-51341b9f7069bc9c18a18cb8e4e7f66a3a27365a.tar.bz2 px4-nuttx-51341b9f7069bc9c18a18cb8e4e7f66a3a27365a.zip |
Basic 8052 context switching is working
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@39 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/pjrc-8051/src/up_unblocktask.c')
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_unblocktask.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nuttx/arch/pjrc-8051/src/up_unblocktask.c b/nuttx/arch/pjrc-8051/src/up_unblocktask.c index 1db56f3b7..3f09d7ce5 100644 --- a/nuttx/arch/pjrc-8051/src/up_unblocktask.c +++ b/nuttx/arch/pjrc-8051/src/up_unblocktask.c @@ -122,7 +122,7 @@ void up_unblock_task(FAR _TCB *tcb) * Just copy the current stack into the OLD rtcb. */ - up_savestack(&rtcb->xcp); + up_savestack(&rtcb->xcp, g_irqtos); /* Restore the exception context of the rtcb at the (new) head * of the g_readytorun task list. @@ -131,9 +131,11 @@ void up_unblock_task(FAR _TCB *tcb) rtcb = (FAR _TCB*)g_readytorun.head; dbg("New Active Task TCB=%p\n", rtcb); - /* Then switch contexts */ + /* Then setup so that the context will be performed on exit + * from the interrupt. + */ - up_restorestack(&rtcb->xcp); + g_irqcontext = &rtcb->xcp; } /* We are not in an interrupt andler. Copy the user C context |