diff options
-rw-r--r-- | nuttx/arch/arm/src/common/up_reprioritizertr.c | 19 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_reprioritizertr.c | 19 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_reprioritizertr.c | 19 | ||||
-rw-r--r-- | nuttx/arch/sim/src/up_reprioritizertr.c | 19 | ||||
-rw-r--r-- | nuttx/arch/z16/src/common/up_reprioritizertr.c | 19 | ||||
-rw-r--r-- | nuttx/arch/z80/src/common/up_reprioritizertr.c | 19 |
6 files changed, 18 insertions, 96 deletions
diff --git a/nuttx/arch/arm/src/common/up_reprioritizertr.c b/nuttx/arch/arm/src/common/up_reprioritizertr.c index edc2f9e1f..2fb7eb631 100644 --- a/nuttx/arch/arm/src/common/up_reprioritizertr.c +++ b/nuttx/arch/arm/src/common/up_reprioritizertr.c @@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; diff --git a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c index 97d5682e0..eef37c16f 100644 --- a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c +++ b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c @@ -85,27 +85,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; diff --git a/nuttx/arch/sh/src/common/up_reprioritizertr.c b/nuttx/arch/sh/src/common/up_reprioritizertr.c index 58ba7a0d6..230dbfff7 100644 --- a/nuttx/arch/sh/src/common/up_reprioritizertr.c +++ b/nuttx/arch/sh/src/common/up_reprioritizertr.c @@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; diff --git a/nuttx/arch/sim/src/up_reprioritizertr.c b/nuttx/arch/sim/src/up_reprioritizertr.c index f68ff2a82..307369bf3 100644 --- a/nuttx/arch/sim/src/up_reprioritizertr.c +++ b/nuttx/arch/sim/src/up_reprioritizertr.c @@ -85,27 +85,14 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; diff --git a/nuttx/arch/z16/src/common/up_reprioritizertr.c b/nuttx/arch/z16/src/common/up_reprioritizertr.c index 5692ac12c..f94d30ad0 100644 --- a/nuttx/arch/z16/src/common/up_reprioritizertr.c +++ b/nuttx/arch/z16/src/common/up_reprioritizertr.c @@ -89,27 +89,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; diff --git a/nuttx/arch/z80/src/common/up_reprioritizertr.c b/nuttx/arch/z80/src/common/up_reprioritizertr.c index 73272553e..0b71e510f 100644 --- a/nuttx/arch/z80/src/common/up_reprioritizertr.c +++ b/nuttx/arch/z80/src/common/up_reprioritizertr.c @@ -90,27 +90,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority) { /* Verify that the caller is sane */ -#if CONFIG_DEBUG /* We only check parameters when debug is enabled */ - if (priority < SCHED_PRIORITY_MIN || + if (tcb->task_state < FIRST_READY_TO_RUN_STATE || + tcb->task_state > LAST_READY_TO_RUN_STATE || + priority < SCHED_PRIORITY_MIN || priority > SCHED_PRIORITY_MAX) { PANIC(OSERR_BADREPRIORITIZESTATE); } 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; boolean switch_needed; |