mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Add scheduler resume/suspend calls to all implementations of up_release_pending()
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/arm/up_releasepending.c
|
* arch/arm/src/arm/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -85,11 +73,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -103,7 +96,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -125,7 +121,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -136,6 +131,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_fullcontextrestore(rtcb->xcp.regs);
|
up_fullcontextrestore(rtcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv6-m/up_releasepending.c
|
* arch/arm/src/armv6-m/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,18 +46,6 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -84,10 +72,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to switch
|
/* The currently active task has changed! We will need to
|
||||||
* contexts. First check if we are operating in interrupt context.
|
* switch contexts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently. Just copy the
|
/* Yes, then we have to do things differently. Just copy the
|
||||||
@@ -101,7 +95,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -112,11 +109,16 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
/* Switch context to the context of the task at the head of the
|
/* Switch context to the context of the task at the head of the
|
||||||
* ready to run list.
|
* ready to run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
|
||||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||||
|
|
||||||
/* up_switchcontext forces a context switch to the task at the
|
/* up_switchcontext forces a context switch to the task at the
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-a/arm_releasepending.c
|
* arch/arm/src/armv7-a/arm_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -86,10 +74,15 @@ void up_release_pending(void)
|
|||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to
|
||||||
* switch contexts. First check if we are operating in
|
* switch contexts.
|
||||||
* interrupt context:
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -103,7 +96,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -125,7 +121,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -136,6 +131,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_fullcontextrestore(rtcb->xcp.regs);
|
up_fullcontextrestore(rtcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-m/up_releasepending.c
|
* arch/arm/src/armv7-m/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,18 +46,6 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -85,9 +73,15 @@ void up_release_pending(void)
|
|||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to switch
|
/* The currently active task has changed! We will need to switch
|
||||||
* contexts. First check if we are operating in interrupt context.
|
* contexts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently. Just copy the
|
/* Yes, then we have to do things differently. Just copy the
|
||||||
@@ -101,7 +95,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -112,11 +109,16 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
/* Switch context to the context of the task at the head of the
|
/* Switch context to the context of the task at the head of the
|
||||||
* ready to run list.
|
* ready to run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
|
||||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||||
|
|
||||||
/* up_switchcontext forces a context switch to the task at the
|
/* up_switchcontext forces a context switch to the task at the
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/avr/up_releasepending.c
|
* arch/avr/src/avr/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,18 +46,6 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -84,11 +72,14 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -102,7 +93,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
@@ -113,11 +107,16 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
/* Switch context to the context of the task at the head of the
|
/* Switch context to the context of the task at the head of the
|
||||||
* ready to run list.
|
* ready to run list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
|
||||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||||
|
|
||||||
/* up_switchcontext forces a context switch to the task at the
|
/* up_switchcontext forces a context switch to the task at the
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/avr32/up_releasepending.c
|
* arch/avr/src/avr32/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -85,11 +73,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -103,7 +96,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -131,6 +127,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(nexttcb);
|
(void)group_addrenv(nexttcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
/* Then switch contexs */
|
/* Then switch contexs */
|
||||||
|
|
||||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/hc/src/common/up_releasepending.c
|
* arch/hc/src/common/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -84,11 +72,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -102,7 +95,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -124,7 +120,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -135,6 +130,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_fullcontextrestore(rtcb->xcp.regs);
|
up_fullcontextrestore(rtcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/mips/src/mips32/up_releasepending.c
|
* arch/mips/src/mips32/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -49,18 +49,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -87,11 +75,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -105,7 +98,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -133,6 +129,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(nexttcb);
|
(void)group_addrenv(nexttcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||||
|
|||||||
+17
-3
@@ -408,9 +408,18 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
/* Merge the g_pendingtasks list into the g_readytorun task list */
|
||||||
|
|
||||||
if (sched_mergepending()) {
|
if (sched_mergepending())
|
||||||
/* The currently active task has changed! */
|
{
|
||||||
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
struct tcb_s *nexttcb = (struct tcb_s*)g_readytorun.head;
|
||||||
|
|
||||||
|
/* The currently active task has changed! We will need to switch
|
||||||
|
* contexts.
|
||||||
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
* running task is closed down gracefully (data caches dump,
|
* running task is closed down gracefully (data caches dump,
|
||||||
@@ -420,7 +429,12 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(nexttcb);
|
(void)group_addrenv(nexttcb);
|
||||||
#endif
|
#endif
|
||||||
// context switch
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(nexttcb);
|
||||||
|
|
||||||
|
/* context switch */
|
||||||
|
|
||||||
up_switchcontext(rtcb, nexttcb);
|
up_switchcontext(rtcb, nexttcb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/sh/src/common/up_releasepending.c
|
* arch/sh/src/common/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -85,11 +73,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -103,7 +96,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -125,7 +121,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -136,6 +131,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_fullcontextrestore(rtcb->xcp.regs);
|
up_fullcontextrestore(rtcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/sim/src/up_releasepending.c
|
* arch/sim/src/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -46,18 +46,6 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -84,10 +72,17 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! Copy the exception context
|
/* The currently active task has changed! We will need to switch
|
||||||
* into the TCB of the task that was currently active. if up_setjmp
|
* contexts.
|
||||||
* returns a non-zero value, then this is really the previously
|
*
|
||||||
* running task restarting!
|
* Update scheduler parameters.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Copy the exception context into the TCB of the task that was
|
||||||
|
* currently active. if up_setjmp returns a non-zero value, then
|
||||||
|
* this is really the previously running task restarting!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!up_setjmp(rtcb->xcp.regs))
|
if (!up_setjmp(rtcb->xcp.regs))
|
||||||
@@ -111,6 +106,10 @@ void up_release_pending(void)
|
|||||||
rtcb->xcp.sigdeliver = NULL;
|
rtcb->xcp.sigdeliver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_longjmp(rtcb->xcp.regs, 1);
|
up_longjmp(rtcb->xcp.regs, 1);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/arm/up_releasepending.c
|
* arch/arm/src/arm/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -47,18 +47,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -85,11 +73,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (current_regs)
|
if (current_regs)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -103,7 +96,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts. Any necessary address environment
|
/* Then switch contexts. Any necessary address environment
|
||||||
* changes will be made when the interrupt returns.
|
* changes will be made when the interrupt returns.
|
||||||
@@ -125,7 +121,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (struct tcb_s*)g_readytorun.head;
|
rtcb = (struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -136,6 +131,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
up_fullcontextrestore(rtcb->xcp.regs);
|
up_fullcontextrestore(rtcb->xcp.regs);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* common/up_releasepending.c
|
* common/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -48,18 +48,6 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -86,11 +74,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (IN_INTERRUPT)
|
if (IN_INTERRUPT)
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -104,7 +97,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then setup so that the context will be performed on exit
|
/* Then setup so that the context will be performed on exit
|
||||||
* from the interrupt.
|
* from the interrupt.
|
||||||
@@ -126,7 +122,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/z80/src/common/up_releasepending.c
|
* arch/z80/src/common/up_releasepending.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -50,18 +50,6 @@
|
|||||||
#include "group/group.h"
|
#include "group/group.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -88,11 +76,16 @@ void up_release_pending(void)
|
|||||||
/* sched_lock(); */
|
/* sched_lock(); */
|
||||||
if (sched_mergepending())
|
if (sched_mergepending())
|
||||||
{
|
{
|
||||||
/* The currently active task has changed! We will need to
|
/* The currently active task has changed! We will need to switch
|
||||||
* switch contexts. First check if we are operating in
|
* contexts.
|
||||||
* interrupt context:
|
*
|
||||||
|
* Update scheduler parameters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
sched_suspend_scheduler(rtcb);
|
||||||
|
|
||||||
|
/* Are we operating in interrupt context? */
|
||||||
|
|
||||||
if (IN_INTERRUPT())
|
if (IN_INTERRUPT())
|
||||||
{
|
{
|
||||||
/* Yes, then we have to do things differently.
|
/* Yes, then we have to do things differently.
|
||||||
@@ -106,7 +99,10 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then setup so that the context will be performed on exit
|
/* Then setup so that the context will be performed on exit
|
||||||
* from the interrupt. Any necessary address environment
|
* from the interrupt. Any necessary address environment
|
||||||
@@ -129,7 +125,6 @@ void up_release_pending(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
rtcb = (FAR struct tcb_s*)g_readytorun.head;
|
||||||
slldbg("New Active Task TCB=%p\n", rtcb);
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARCH_ADDRENV
|
#ifdef CONFIG_ARCH_ADDRENV
|
||||||
/* Make sure that the address environment for the previously
|
/* Make sure that the address environment for the previously
|
||||||
@@ -140,6 +135,10 @@ void up_release_pending(void)
|
|||||||
|
|
||||||
(void)group_addrenv(rtcb);
|
(void)group_addrenv(rtcb);
|
||||||
#endif
|
#endif
|
||||||
|
/* Update scheduler parameters */
|
||||||
|
|
||||||
|
sched_resume_scheduler(rtcb);
|
||||||
|
|
||||||
/* Then switch contexts */
|
/* Then switch contexts */
|
||||||
|
|
||||||
RESTORE_USERCONTEXT(rtcb);
|
RESTORE_USERCONTEXT(rtcb);
|
||||||
|
|||||||
Reference in New Issue
Block a user