mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:04:17 +08:00
Back out part of the last change -- that was a bad idea
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1585 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
@@ -85,27 +85,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
@@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
@@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
_TCB *rtcb = (_TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
@@ -89,27 +89,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
@@ -90,27 +90,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
|
|||||||
{
|
{
|
||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
#if CONFIG_DEBUG /* We only check parameters when debug is enabled */
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
if (priority < SCHED_PRIORITY_MIN ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
||||||
|
priority < SCHED_PRIORITY_MIN ||
|
||||||
priority > SCHED_PRIORITY_MAX)
|
priority > SCHED_PRIORITY_MAX)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE)
|
|
||||||
{
|
|
||||||
/* This is a hack and needs to be fixed.. here some taks is reprioritizing
|
|
||||||
* another task that is not running. Here we just set the priority of
|
|
||||||
* the task -- BUT some of the other states are also prioritized and the
|
|
||||||
* waiting task should also be re-ordered in the prioritized wiating list.
|
|
||||||
* As a consequence, the other task is still waiting at the lower priority.
|
|
||||||
*/
|
|
||||||
|
|
||||||
tcb->sched_priority = priority;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
|
||||||
boolean switch_needed;
|
boolean switch_needed;
|
||||||
|
|||||||
Reference in New Issue
Block a user