mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
sched/sched/sched.h: Make naming of all internal names consistent:
1. Add internal scheduler functions should begin with nxsched_, not sched_ 2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
4b44b628ea
commit
f92dba212d
@@ -74,11 +74,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||
* it should also be true that rtcb == tcb.
|
||||
*/
|
||||
|
||||
switch_needed = sched_removereadytorun(tcb);
|
||||
switch_needed = nxsched_remove_readytorun(tcb);
|
||||
|
||||
/* Add the task to the specified blocked task list */
|
||||
|
||||
sched_addblocked(tcb, (tstate_t)task_state);
|
||||
nxsched_add_blocked(tcb, (tstate_t)task_state);
|
||||
|
||||
/* If there are any pending tasks, then add them to the ready-to-run
|
||||
* task list now
|
||||
@@ -86,7 +86,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
switch_needed |= sched_mergepending();
|
||||
switch_needed |= nxsched_merge_pending();
|
||||
}
|
||||
|
||||
/* Now, perform the context switch if one is needed */
|
||||
|
||||
@@ -56,7 +56,7 @@ void up_release_pending(void)
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
if (sched_mergepending())
|
||||
if (nxsched_merge_pending())
|
||||
{
|
||||
/* The currently active task has changed! We will need to switch
|
||||
* contexts.
|
||||
|
||||
@@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
sinfo("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just
|
||||
* nxsched_remove_readytorun will return true if we just
|
||||
* remove the head of the ready to run list.
|
||||
*/
|
||||
|
||||
switch_needed = sched_removereadytorun(tcb);
|
||||
switch_needed = nxsched_remove_readytorun(tcb);
|
||||
|
||||
/* Setup up the new task priority */
|
||||
|
||||
tcb->sched_priority = (uint8_t)priority;
|
||||
|
||||
/* Return the task to the specified blocked task list.
|
||||
* sched_addreadytorun will return true if the task was
|
||||
* nxsched_add_readytorun will return true if the task was
|
||||
* added to the new list. We will need to perform a context
|
||||
* switch only if the EXCLUSIVE or of the two calls is non-zero
|
||||
* (i.e., one and only one the calls changes the head of the
|
||||
* ready-to-run list).
|
||||
*/
|
||||
|
||||
switch_needed ^= sched_addreadytorun(tcb);
|
||||
switch_needed ^= nxsched_add_readytorun(tcb);
|
||||
|
||||
/* Now, perform the context switch if one is needed */
|
||||
|
||||
@@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
sched_mergepending();
|
||||
nxsched_merge_pending();
|
||||
}
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
@@ -64,13 +64,13 @@ void up_unblock_task(struct tcb_s *tcb)
|
||||
|
||||
/* Remove the task from the blocked task list */
|
||||
|
||||
sched_removeblocked(tcb);
|
||||
nxsched_remove_blocked(tcb);
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
* ready-to-run task list
|
||||
*/
|
||||
|
||||
if (sched_addreadytorun(tcb))
|
||||
if (nxsched_add_readytorun(tcb))
|
||||
{
|
||||
/* The currently active task has changed! We need to do
|
||||
* a context switch to the new task.
|
||||
|
||||
Reference in New Issue
Block a user