summaryrefslogtreecommitdiff
path: root/nuttx/arch/rgmp
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-27 16:15:46 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-27 16:15:46 -0600
commitdce98ad7cd0742cc258a2ed9200c6a76fbfb329f (patch)
treed188b9ab09e76dfd794de8268bdd324669323fa9 /nuttx/arch/rgmp
parentab0dbac1c5db6d0e53609e539686ae1c9024ec63 (diff)
downloadnuttx-dce98ad7cd0742cc258a2ed9200c6a76fbfb329f.tar.gz
nuttx-dce98ad7cd0742cc258a2ed9200c6a76fbfb329f.tar.bz2
nuttx-dce98ad7cd0742cc258a2ed9200c6a76fbfb329f.zip
Add ADDRENV support to ALL implementations of up_unblock_task()
Diffstat (limited to 'nuttx/arch/rgmp')
-rw-r--r--nuttx/arch/rgmp/src/nuttx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c
index a7a6a2915..2d7ab192e 100644
--- a/nuttx/arch/rgmp/src/nuttx.c
+++ b/nuttx/arch/rgmp/src/nuttx.c
@@ -288,6 +288,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
warn("Disable preemption failed for task block itself\n");
sched_mergepending();
}
+
nexttcb = (struct tcb_s*)g_readytorun.head;
#ifdef CONFIG_ARCH_ADDRENV
@@ -344,8 +345,19 @@ void up_unblock_task(struct tcb_s *tcb)
// g_readytorun task list.
if (sched_addreadytorun(tcb) && !up_interrupt_context()) {
/* The currently active task has changed! */
+
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
+
+#ifdef CONFIG_ARCH_ADDRENV
+ // Make sure that the address environment for the previously
+ // running task is closed down gracefully (data caches dump,
+ // MMU flushed) and set up the address environment for the new
+ // thread at the head of the ready-to-run list.
+
+ (void)group_addrenv(nexttcb);
+#endif
// context switch
+
up_switchcontext(rtcb, nexttcb);
}
}