Add scheduler resume/suspend calls to all implementations of up_release_pending()

This commit is contained in:
Gregory Nutt
2015-07-26 10:13:29 -06:00
parent 37969b8279
commit eddf8161a5
14 changed files with 255 additions and 246 deletions
+17 -17
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,18 +49,6 @@
#include "group/group.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -87,11 +75,16 @@ void up_release_pending(void)
/* sched_lock(); */
if (sched_mergepending())
{
/* The currently active task has changed! We will need to
* switch contexts. First check if we are operating in
* interrupt context:
/* The currently active task has changed! We will need to switch
* contexts.
*
* Update scheduler parameters.
*/
sched_suspend_scheduler(rtcb);
/* Are we operating in interrupt context? */
if (current_regs)
{
/* Yes, then we have to do things differently.
@@ -105,7 +98,10 @@ void up_release_pending(void)
*/
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
* changes will be made when the interrupt returns.
@@ -133,6 +129,10 @@ void up_release_pending(void)
(void)group_addrenv(nexttcb);
#endif
/* Update scheduler parameters */
sched_resume_scheduler(nexttcb);
/* Then switch contexts */
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);