diff options
author | Dmitriy Korovkin <dmitriy.korovkin@windriver.com> | 2016-10-19 17:31:38 -0400 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-10-22 01:27:00 +0000 |
commit | 05d4b23f22f0797a88231232e68ea7412eb7401f (patch) | |
tree | 85b75071e95ceb862da48e4c7f318bbc83b8fd78 /arch | |
parent | 497a3411d074c6772d88b60ef15d8d01d898f569 (diff) |
arc: Fix RGF_NUM_BANKS==1 and NUM_IRQ_PRIO_LEVELS>1 problem
Define _firq_scratch_restore, needed when CONFIG_RGF_NUM_BANKS==1
outside of CONFIG_NUM_IRQ_PRIO_LEVELS > 1 clause.
Change-Id: I82eef11a005a35f38a064ce3ce1d6521d6428958
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/core/fast_irq.S | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/arch/arc/core/fast_irq.S b/arch/arc/core/fast_irq.S index d031c719b..6c44359fe 100644 --- a/arch/arc/core/fast_irq.S +++ b/arch/arc/core/fast_irq.S @@ -44,6 +44,14 @@ SECTION_VAR(NOINIT, _firq_stack) GDATA(saved_r0) #endif +.macro _firq_return +#if CONFIG_RGF_NUM_BANKS == 1 + b _firq_scratch_restore +#else + rtie +#endif +.endm + /** * * @brief Work to be done before handing control to a FIRQ ISR @@ -132,34 +140,7 @@ SECTION_FUNC(TEXT, _firq_exit) breq r3, 1, _check_if_current_is_the_task -#if CONFIG_RGF_NUM_BANKS == 1 -_firq_scratch_restore: - add sp,sp,4 /* don't need r0 from stack */ - pop_s r1 - pop_s r2 - pop_s r3 - pop r4 - pop r5 - pop r6 - pop r7 - pop r8 - pop r9 - pop r10 - pop r11 - pop_s r12 - pop_s r13 - pop_s blink - pop_s r0 - sr r0, [_ARC_V2_LP_END] - pop_s r0 - sr r0, [_ARC_V2_LP_START] - pop_s r0 - mov lp_count,r0 - ld r0,[saved_r0] - add sp,sp,8 /* don't need ilink & status32_po from stack */ -#endif - rtie - + _firq_return #endif .balign 4 @@ -168,21 +149,13 @@ _check_if_current_is_the_task: ld_s r0, [r2, __tTCS_flags_OFFSET] and.f r0, r0, PREEMPTIBLE bnz _check_if_a_fiber_is_ready -#if CONFIG_RGF_NUM_BANKS == 1 - b _firq_scratch_restore -#else - rtie -#endif + _firq_return .balign 4 _check_if_a_fiber_is_ready: ld_s r0, [r1, __tNANO_fiber_OFFSET] /* incoming fiber in r0 */ brne r0, 0, _firq_reschedule -#if CONFIG_RGF_NUM_BANKS == 1 - b _firq_scratch_restore -#else - rtie -#endif + _firq_return .balign 4 _firq_reschedule: @@ -291,6 +264,35 @@ _firq_no_reschedule: /* LP registers are already restored, just switch back to bank 0 */ rtie +#if CONFIG_RGF_NUM_BANKS == 1 +.balign 4 +_firq_scratch_restore: + add sp,sp,4 /* don't need r0 from stack */ + pop_s r1 + pop_s r2 + pop_s r3 + pop r4 + pop r5 + pop r6 + pop r7 + pop r8 + pop r9 + pop r10 + pop r11 + pop_s r12 + pop_s r13 + pop_s blink + pop_s r0 + sr r0, [_ARC_V2_LP_END] + pop_s r0 + sr r0, [_ARC_V2_LP_START] + pop_s r0 + mov lp_count,r0 + ld r0,[saved_r0] + add sp,sp,8 /* don't need ilink & status32_po from stack */ + rtie +#endif + /** * * @brief Install the FIRQ stack in register bank 1 if CONFIG_RGF_NUM_BANK!=1 |