summaryrefslogtreecommitdiff
path: root/nuttx/arch/sh
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-27 15:36:52 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-27 15:36:52 -0600
commit7bda7a5e0cf009da5d0ace3d23efe7a2a2f70dc5 (patch)
treeb07288035e690f4dc36943e4e5795e98f8a23fe2 /nuttx/arch/sh
parent3bca5b16412b62536ce746774c4482871fae7852 (diff)
downloadpx4-nuttx-7bda7a5e0cf009da5d0ace3d23efe7a2a2f70dc5.tar.gz
px4-nuttx-7bda7a5e0cf009da5d0ace3d23efe7a2a2f70dc5.tar.bz2
px4-nuttx-7bda7a5e0cf009da5d0ace3d23efe7a2a2f70dc5.zip
Add ADDRENV support to all implementations of up_block_task()
Diffstat (limited to 'nuttx/arch/sh')
-rw-r--r--nuttx/arch/sh/src/common/up_blocktask.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/nuttx/arch/sh/src/common/up_blocktask.c b/nuttx/arch/sh/src/common/up_blocktask.c
index 0cfe03267..db097e8ee 100644
--- a/nuttx/arch/sh/src/common/up_blocktask.c
+++ b/nuttx/arch/sh/src/common/up_blocktask.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_blocktask.c
*
- * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
#include <nuttx/arch.h>
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -138,6 +139,16 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
/* Then switch contexts */
current_regs = rtcb->xcp.regs;
+
+#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(rtcb);
+#endif
}
/* Copy the user C context into the TCB at the (old) head of the
@@ -153,6 +164,15 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
rtcb = (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(rtcb);
+#endif
/* Then switch contexts */
up_fullcontextrestore(rtcb->xcp.regs);