diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index 1b67a079023..1c8a09f8f0a 100644 --- a/arch/arm/src/common/up_exit.c +++ b/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 * * 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/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 9b89b3a7301..74c3d7367c8 100644 --- a/arch/avr/src/common/up_exit.c +++ b/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 * * 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/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index 507d69b34f5..0ec462e7e32 100644 --- a/arch/hc/src/common/up_exit.c +++ b/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 * * 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/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index abcfbad6ed4..0126aa44478 100644 --- a/arch/mips/src/common/up_exit.c +++ b/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 * * 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/arch/rgmp/src/nuttx.c b/arch/rgmp/src/nuttx.c index 2d7ab192ef4..386e588c922 100644 --- a/arch/rgmp/src/nuttx.c +++ b/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/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c index bfe56dcb766..6fcd8dd803c 100644 --- a/arch/sh/src/common/up_exit.c +++ b/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 * * 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/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index 8af643fcdb1..7c7af45a56f 100644 --- a/arch/x86/src/common/up_exit.c +++ b/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 * * 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/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index fb79e364104..de7f0360ae8 100644 --- a/arch/z80/src/common/up_exit.c +++ b/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 * * 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);