zephyr/arch/arc/core
Chuck Jordan 6c86ed85fe arc: fix stack corruption caused by firq handling
There are a few problems with the code being repaired here.
1. A seti was used to re-enable all interrupts, even though the
thread being switched to may have had certain interrupt priorities masked.
2. saved status32 already has SC bit if thats wanted, so its ok to just
restore status32 as-is w/o needing to and off anything.
3. the code is difficult to write using kflag and seti because as you
restore registers, there aren't any to use. But we can exploit a
trick where we pretend an interrupt has occured by setting a bit in
AUX_IRQ_ACT, and then use RTIE instruction to restore status32
atomically with branching to return address. Something about the way
this code was written was causing stack corruptings and crashes in an
application that uses a high rate of both FIRQ and Regular interrupts.

Change-Id: Ia7166d51f0e750c07832ab115b7151ce37ee0278
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-01 14:25:01 +00:00
..
offsets arc: improved saving of lp_<count,start,end> using GPRs 2016-05-29 22:23:13 +00:00
Makefile errno: implement _get_errno() in common code 2016-05-04 17:04:14 +00:00
atomic.S arc: add atomic operations for ARC EM family processors 2016-02-05 20:25:16 -05:00
cpu_idle.S arc: Uses of .nd on various branches not wanted 2016-05-26 10:45:53 +00:00
fast_irq.S arc: improved saving of lp_<count,start,end> using GPRs 2016-05-29 22:23:13 +00:00
fatal.c Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
fault.c Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
fault_s.S arc: trap handler, used by irq_offload, now handles thread switch 2016-05-27 21:11:24 +00:00
irq_manage.c irq: formalize external zephyr interrupt API 2016-02-26 15:53:22 +00:00
irq_offload.c irq_offload: ARC implementation 2016-02-05 20:24:55 -05:00
irq_vector_table.c arc: move vector and sw isr table to core code 2016-03-08 09:58:20 -08:00
isr_wrapper.S arc: Uses of .nd on various branches not wanted 2016-05-26 10:45:53 +00:00
prep_c.c arc: disable i-cache in early init because ARC CPUs start with it on 2016-05-24 00:02:17 +00:00
regular_irq.S arc: trap handler, used by irq_offload, now handles thread switch 2016-05-27 21:11:24 +00:00
reset.S arc: Add linker command file for Harvard architecture 2016-05-15 01:48:41 +00:00
sw_isr_table.S arc: move vector and sw isr table to core code 2016-03-08 09:58:20 -08:00
swap.S arc: fix stack corruption caused by firq handling 2016-06-01 14:25:01 +00:00
swap_macros.h arc: do lr and sr instructions together, avoid instruction pipeline bubble 2016-05-09 20:56:52 +00:00
sys_fatal_error_handler.c nanokernel: tighten _is_thread_essential() 2016-05-03 17:42:54 +00:00
thread.c kernel: Init back pointer to microkernel task 2016-05-04 22:51:33 +00:00
thread_entry_wrapper.S Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
vector_table.c arc: Set __start entry point to be same as __reset 2016-05-05 22:12:56 +00:00