mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +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
@@ -91,11 +91,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
|
||||
@@ -103,7 +103,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 */
|
||||
|
||||
@@ -74,7 +74,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.
|
||||
|
||||
@@ -85,25 +85,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 */
|
||||
|
||||
@@ -116,7 +116,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
sched_mergepending();
|
||||
nxsched_merge_pending();
|
||||
}
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
@@ -83,13 +83,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.
|
||||
|
||||
@@ -91,11 +91,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
|
||||
@@ -103,7 +103,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 */
|
||||
|
||||
@@ -76,7 +76,7 @@ void up_release_pending(void)
|
||||
|
||||
/* sched_lock(); */
|
||||
|
||||
if (sched_mergepending())
|
||||
if (nxsched_merge_pending())
|
||||
{
|
||||
/* The currently active task has changed! We will need to switch
|
||||
* contexts. Update scheduler parameters.
|
||||
|
||||
@@ -85,24 +85,24 @@ 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 remove the
|
||||
* 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 added to the
|
||||
* 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 */
|
||||
|
||||
@@ -115,7 +115,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
||||
|
||||
if (g_pendingtasks.head)
|
||||
{
|
||||
sched_mergepending();
|
||||
nxsched_merge_pending();
|
||||
}
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
@@ -83,13 +83,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