Add ADDRENV support to ALL implmentations of _exit()

This commit is contained in:
Gregory Nutt 2014-08-27 16:31:02 -06:00
parent 7055bce8b4
commit 756054d745
8 changed files with 94 additions and 7 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);