zephyr/arch
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
..
arc arc: fix stack corruption caused by firq handling 2016-06-01 14:25:01 +00:00
arm nrf52: Auto generate Intel Hex kernel image 2016-05-29 03:27:27 -07:00
nios2 build: Introduce concept of SoC specific build flags 2016-05-27 10:04:29 -05:00
x86 build: Introduce concept of SoC specific build flags 2016-05-27 10:04:29 -05:00
Kconfig Cleanup whitespace in Kconfig files 2016-05-25 13:28:07 -05:00
Makefile arch/Makefile: simplify 2016-04-27 21:40:19 +00:00