summaryrefslogtreecommitdiff
path: root/nuttx/arch/z80
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 /nuttx/arch/z80
parentdce98ad7cd0742cc258a2ed9200c6a76fbfb329f (diff)
downloadnuttx-a32bc5d688125095b309e96e32245736d8f61781.tar.gz
nuttx-a32bc5d688125095b309e96e32245736d8f61781.tar.bz2
nuttx-a32bc5d688125095b309e96e32245736d8f61781.zip
Add ADDRENV support to ALL implmentations of _exit()
Diffstat (limited to 'nuttx/arch/z80')
-rw-r--r--nuttx/arch/z80/src/common/up_exit.c13
1 files changed, 12 insertions, 1 deletions
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);