summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-27 16:31:02 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-27 16:31:02 -0600
commita32bc5d688125095b309e96e32245736d8f61781 (patch)
treebc865f6c4196a702eb877ee203e8e223562f1619
parentdce98ad7cd0742cc258a2ed9200c6a76fbfb329f (diff)
downloadnuttx-a32bc5d688125095b309e96e32245736d8f61781.tar.gz
nuttx-a32bc5d688125095b309e96e32245736d8f61781.tar.bz2
nuttx-a32bc5d688125095b309e96e32245736d8f61781.zip
Add ADDRENV support to ALL implmentations of _exit()
-rw-r--r--nuttx/arch/arm/src/common/up_exit.c13
-rw-r--r--nuttx/arch/avr/src/common/up_exit.c13
-rw-r--r--nuttx/arch/hc/src/common/up_exit.c13
-rw-r--r--nuttx/arch/mips/src/common/up_exit.c13
-rw-r--r--nuttx/arch/rgmp/src/nuttx.c10
-rw-r--r--nuttx/arch/sh/src/common/up_exit.c13
-rw-r--r--nuttx/arch/x86/src/common/up_exit.c13
-rw-r--r--nuttx/arch/z80/src/common/up_exit.c13
8 files changed, 94 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/common/up_exit.c b/nuttx/arch/arm/src/common/up_exit.c
index 1b67a0790..1c8a09f8f 100644
--- a/nuttx/arch/arm/src/common/up_exit.c
+++ b/nuttx/arch/arm/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_exit.c
*
- * Copyright (C) 2007-2009, 201-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 201-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -162,6 +163,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/avr/src/common/up_exit.c b/nuttx/arch/avr/src/common/up_exit.c
index 9b89b3a73..74c3d7367 100644
--- a/nuttx/arch/avr/src/common/up_exit.c
+++ b/nuttx/arch/avr/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/common/up_exit.c
*
- * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -162,6 +163,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/hc/src/common/up_exit.c b/nuttx/arch/hc/src/common/up_exit.c
index 507d69b34..0ec462e7e 100644
--- a/nuttx/arch/hc/src/common/up_exit.c
+++ b/nuttx/arch/hc/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/common/up_exit.c
*
- * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -162,6 +163,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/mips/src/common/up_exit.c b/nuttx/arch/mips/src/common/up_exit.c
index abcfbad6e..0126aa444 100644
--- a/nuttx/arch/mips/src/common/up_exit.c
+++ b/nuttx/arch/mips/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/mips/src/common/up_exit.c
*
- * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -164,6 +165,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c
index 2d7ab192e..386e588c9 100644
--- a/nuttx/arch/rgmp/src/nuttx.c
+++ b/nuttx/arch/rgmp/src/nuttx.c
@@ -453,6 +453,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_switchcontext(NULL, tcb);
diff --git a/nuttx/arch/sh/src/common/up_exit.c b/nuttx/arch/sh/src/common/up_exit.c
index bfe56dcb7..6fcd8dd80 100644
--- a/nuttx/arch/sh/src/common/up_exit.c
+++ b/nuttx/arch/sh/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_exit.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
@@ -50,6 +50,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -163,6 +164,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/x86/src/common/up_exit.c b/nuttx/arch/x86/src/common/up_exit.c
index 8af643fcd..7c7af45a5 100644
--- a/nuttx/arch/x86/src/common/up_exit.c
+++ b/nuttx/arch/x86/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_exit.c
*
- * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -162,6 +163,16 @@ void _exit(int status)
tcb = (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(tcb);
+#endif
+
/* Then switch contexts */
up_fullcontextrestore(tcb->xcp.regs);
diff --git a/nuttx/arch/z80/src/common/up_exit.c b/nuttx/arch/z80/src/common/up_exit.c
index fb79e3641..de7f0360a 100644
--- a/nuttx/arch/z80/src/common/up_exit.c
+++ b/nuttx/arch/z80/src/common/up_exit.c
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_exit.c
*
- * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-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
@@ -52,6 +52,7 @@
#include "chip/chip.h"
#include "task/task.h"
#include "sched/sched.h"
+#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
@@ -166,6 +167,16 @@ void _exit(int status)
tcb = (FAR struct tcb_s*)g_readytorun.head;
slldbg("New Active Task TCB=%p\n", tcb);
+#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(tcb);
+#endif
+
/* Then switch contexts */
RESTORE_USERCONTEXT(tcb);