arch: arc: fix the bug that idle thread blocks other threads

* for COOP_SCHED case, i.e., PREEMPT_ENABLED is not enabled, the
  idle thread will block other threads which is not correct.

* remove the check of PREEMPT_ENABLED in the epilogue of irq and
  exception handling. Let the scheduler (should_preempt()) decide
  whether the thread should be preempted.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
This commit is contained in:
Wayne Ren 2020-02-13 14:22:37 +08:00 committed by Andrew Boie
parent c6d37eba7b
commit 0d7769f3b8
3 changed files with 0 additions and 14 deletions

View file

@ -155,8 +155,6 @@ SECTION_FUNC(TEXT, _firq_exit)
bl z_check_stack_sentinel
#endif
#ifdef CONFIG_PREEMPT_ENABLED
#ifdef CONFIG_SMP
bl z_arc_smp_switch_in_isr
/* r0 points to new thread, r1 points to old thread */
@ -171,8 +169,6 @@ SECTION_FUNC(TEXT, _firq_exit)
#endif
/* fall to no rescheduling */
#endif /* CONFIG_PREEMPT_ENABLED */
.balign 4
_firq_no_reschedule:
pop sp
@ -186,8 +182,6 @@ _firq_no_reschedule:
#endif
rtie
#ifdef CONFIG_PREEMPT_ENABLED
.balign 4
_firq_reschedule:
pop sp
@ -353,5 +347,3 @@ _firq_return_from_firq:
/* LP registers are already restored, just switch back to bank 0 */
rtie
#endif /* CONFIG_PREEMPT_ENABLED */

View file

@ -114,7 +114,6 @@ _exc_return:
* exception comes out, thread context?irq_context?nest irq context?
*/
#ifdef CONFIG_PREEMPT_ENABLED
#ifdef CONFIG_SMP
bl z_arc_smp_switch_in_isr
breq r0, 0, _exc_return_from_exc
@ -187,7 +186,6 @@ _exc_return:
/* Assumption: r2 has current thread */
b _rirq_common_interrupt_swap
#endif
_exc_return_from_exc:
ld_s r0, [sp, ___isf_t_pc_OFFSET]

View file

@ -266,8 +266,6 @@ SECTION_FUNC(TEXT, _rirq_exit)
bl z_check_stack_sentinel
#endif
#ifdef CONFIG_PREEMPT_ENABLED
#ifdef CONFIG_SMP
bl z_arc_smp_switch_in_isr
/* r0 points to new thread, r1 points to old thread */
@ -404,8 +402,6 @@ _rirq_return_from_coop:
/* rtie will pop the rest from the stack */
rtie
#endif /* CONFIG_PREEMPT_ENABLED */
.balign 4
_rirq_return_from_firq:
_rirq_return_from_rirq: