mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
sched: remove param in nxsched_remove_readytorun
after text data bss dec hex filename 269732 51065 63335 384132 5dc84 nuttx before text data bss dec hex filename 269784 51065 63335 384184 5dcb8 nuttx size -50 Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
+1
-1
@@ -325,7 +325,7 @@ int nxthread_create(FAR const char *name, uint8_t ttype, int priority,
|
||||
/* Task list manipulation functions */
|
||||
|
||||
bool nxsched_add_readytorun(FAR struct tcb_s *rtrtcb);
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *rtrtcb, bool merge);
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *rtrtcb);
|
||||
void nxsched_remove_self(FAR struct tcb_s *rtrtcb);
|
||||
bool nxsched_add_prioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list);
|
||||
void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2,
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcb - Points to the TCB that is ready-to-run
|
||||
* merge - Merge pending list or not
|
||||
*
|
||||
* Returned Value:
|
||||
* true if the currently active task (the head of the ready-to-run list)
|
||||
@@ -63,7 +62,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb, bool merge)
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb)
|
||||
{
|
||||
FAR dq_queue_t *tasklist;
|
||||
bool doswitch = false;
|
||||
@@ -99,17 +98,12 @@ bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb, bool merge)
|
||||
|
||||
rtcb->task_state = TSTATE_TASK_INVALID;
|
||||
|
||||
if (list_pendingtasks()->head && merge)
|
||||
{
|
||||
doswitch |= nxsched_merge_pending();
|
||||
}
|
||||
|
||||
return doswitch;
|
||||
}
|
||||
|
||||
void nxsched_remove_self(FAR struct tcb_s *tcb)
|
||||
{
|
||||
nxsched_remove_readytorun(tcb, true);
|
||||
nxsched_remove_readytorun(tcb);
|
||||
}
|
||||
#endif /* !CONFIG_SMP */
|
||||
|
||||
@@ -121,7 +115,6 @@ void nxsched_remove_self(FAR struct tcb_s *tcb)
|
||||
*
|
||||
* Input Parameters:
|
||||
* rtcb - Points to the TCB that is ready-to-run
|
||||
* merge - Merge pending list or not
|
||||
*
|
||||
* Returned Value:
|
||||
* true if the currently active task (the head of the ready-to-run list)
|
||||
@@ -284,10 +277,8 @@ void nxsched_remove_self(FAR struct tcb_s *tcb)
|
||||
}
|
||||
}
|
||||
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *tcb, bool merge)
|
||||
bool nxsched_remove_readytorun(FAR struct tcb_s *tcb)
|
||||
{
|
||||
bool doswitch = false;
|
||||
|
||||
if (tcb->task_state == TSTATE_TASK_RUNNING)
|
||||
{
|
||||
DEBUGASSERT(tcb->cpu == this_cpu());
|
||||
@@ -307,7 +298,7 @@ bool nxsched_remove_readytorun(FAR struct tcb_s *tcb, bool merge)
|
||||
{
|
||||
g_delivertasks[i] = NULL;
|
||||
tcb->task_state = TSTATE_TASK_INVALID;
|
||||
goto finish;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,12 +318,6 @@ bool nxsched_remove_readytorun(FAR struct tcb_s *tcb, bool merge)
|
||||
tcb->task_state = TSTATE_TASK_INVALID;
|
||||
}
|
||||
|
||||
finish:
|
||||
if (list_pendingtasks()->head && merge)
|
||||
{
|
||||
doswitch |= nxsched_merge_pending();
|
||||
}
|
||||
|
||||
return doswitch;
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
@@ -64,7 +64,7 @@ bool nxsched_reprioritize_rtr(FAR struct tcb_s *tcb, int priority)
|
||||
* remove the head of the ready to run list.
|
||||
*/
|
||||
|
||||
switch_needed = nxsched_remove_readytorun(tcb, false);
|
||||
switch_needed = nxsched_remove_readytorun(tcb);
|
||||
|
||||
/* Setup up the new task priority */
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ static inline void nxsched_running_setpriority(FAR struct tcb_s *tcb,
|
||||
|
||||
do
|
||||
{
|
||||
bool check = nxsched_remove_readytorun(nxttcb, false);
|
||||
bool check = nxsched_remove_readytorun(nxttcb);
|
||||
DEBUGASSERT(check == false);
|
||||
UNUSED(check);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ static int nxsched_suspend_handler(FAR void *cookie)
|
||||
tcb->flags = arg->saved_flags;
|
||||
}
|
||||
|
||||
nxsched_remove_readytorun(tcb, false);
|
||||
nxsched_remove_readytorun(tcb);
|
||||
|
||||
tcb->task_state = TSTATE_TASK_STOPPED;
|
||||
dq_addlast((FAR dq_entry_t *)tcb, &g_stoppedtasks);
|
||||
@@ -172,7 +172,12 @@ void nxsched_suspend(FAR struct tcb_s *tcb)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
switch_needed = nxsched_remove_readytorun(tcb, true);
|
||||
switch_needed = nxsched_remove_readytorun(tcb);
|
||||
|
||||
if (list_pendingtasks()->head)
|
||||
{
|
||||
switch_needed |= nxsched_merge_pending();
|
||||
}
|
||||
|
||||
/* Add the task to the specified blocked task list */
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ static int restart_handler(FAR void *cookie)
|
||||
tcb->flags = arg->saved_flags;
|
||||
}
|
||||
|
||||
nxsched_remove_readytorun(tcb, false);
|
||||
nxsched_remove_readytorun(tcb);
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
||||
@@ -117,7 +117,7 @@ static void nxtask_reset_task(FAR struct tcb_s *tcb, bool remove)
|
||||
|
||||
if (remove)
|
||||
{
|
||||
nxsched_remove_readytorun(tcb, false);
|
||||
nxsched_remove_readytorun(tcb);
|
||||
}
|
||||
|
||||
/* Deallocate anything left in the TCB's signal queues */
|
||||
|
||||
@@ -66,7 +66,7 @@ static int terminat_handler(FAR void *cookie)
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
nxsched_remove_readytorun(tcb, false);
|
||||
nxsched_remove_readytorun(tcb);
|
||||
|
||||
leave_critical_section(flags);
|
||||
return OK;
|
||||
@@ -164,7 +164,7 @@ int nxtask_terminate(pid_t pid)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nxsched_remove_readytorun(dtcb, false);
|
||||
nxsched_remove_readytorun(dtcb);
|
||||
}
|
||||
|
||||
dtcb->task_state = task_state;
|
||||
|
||||
Reference in New Issue
Block a user