From cd198764ba41f2316e0c4007f0aba1b1ed1322a5 Mon Sep 17 00:00:00 2001 From: Chuck Jordan Date: Fri, 2 Dec 2016 13:38:51 -0800 Subject: [PATCH] arc: branch too far when STACK_CHECKING enabled. A build error was resulting if CONFIG_ARC_STACK_CHECKING is enabled. There is a breq that was too far. Adding conditional code to re-arrange the branching so that it can be done. See ZEP-1116. Change-Id: Idea85817b2e05617bbaa4450437aa74c5737e213 Signed-off-by: Chuck Jordan --- arch/arc/core/regular_irq.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arc/core/regular_irq.S b/arch/arc/core/regular_irq.S index 21fd06c0930..81860c752c7 100644 --- a/arch/arc/core/regular_irq.S +++ b/arch/arc/core/regular_irq.S @@ -144,8 +144,16 @@ SECTION_FUNC(TEXT, _rirq_exit) /* scheduler locked ? do not schedule */ ld_s r0, [r2, _thread_offset_to_sched_locked] +#ifdef CONFIG_ARC_STACK_CHECKING + brle.d r0, 0, _rirq_reschedule_check + ld sp, [r2, _thread_offset_to_sp] + b _rirq_no_reschedule + /* This branch is a bit far */ +_rirq_reschedule_check: +#else brgt.d r0, 0, _rirq_no_reschedule ld sp, [r2, _thread_offset_to_sp] +#endif /* check if the current thread needs to be rescheduled */ push_s r2