arc: fix stack corruption caused by firq handling
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 <c464ed312fa6f818297227c7e5018fc9f4bd95ad@synopsys.com>

fractalclone/zephyr-riscv,punitvara/zephyr,runchip/zephyr-cc3200,galak/zephyr,ldts/zephyr,mirzak/zephyr-os,rsalveti/zephyr,bigdinotech/zephyr,finikorg/zephyr,tidyjiang8/zephyr-doc,aceofall/zephyr-iotos,erwango/zephyr,Vudentz/zephyr,holtmann/zephyr,runchip/zephyr-cc3200,ldts/zephyr,runchip/zephyr-cc3220,explora26/zephyr,sharronliu/zephyr,zephyrproject-rtos/zephyr,erwango/zephyr,galak/zephyr,Vudentz/zephyr,tidyjiang8/zephyr-doc,tidyjiang8/zephyr-doc,kraj/zephyr,sharronliu/zephyr,explora26/zephyr,runchip/zephyr-cc3220,punitvara/zephyr,punitvara/zephyr,mirzak/zephyr-os,fbsder/zephyr,aceofall/zephyr-iotos,nashif/zephyr,mbolivar/zephyr,runchip/zephyr-cc3220,pklazy/zephyr,nashif/zephyr,tidyjiang8/zephyr-doc,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,mbolivar/zephyr,erwango/zephyr,runchip/zephyr-cc3220,galak/zephyr,fractalclone/zephyr-riscv,ldts/zephyr,bboozzoo/zephyr,fbsder/zephyr,tidyjiang8/zephyr-doc,rsalveti/zephyr,mbolivar/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,pklazy/zephyr,sharronliu/zephyr,GiulianoFranchetto/zephyr,fbsder/zephyr,Vudentz/zephyr,zephyriot/zephyr,runchip/zephyr-cc3200,fractalclone/zephyr-riscv,holtmann/zephyr,nashif/zephyr,rsalveti/zephyr,bboozzoo/zephyr,bigdinotech/zephyr,zephyriot/zephyr,holtmann/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,kraj/zephyr,zephyriot/zephyr,ldts/zephyr,zephyriot/zephyr,explora26/zephyr,bboozzoo/zephyr,bigdinotech/zephyr,punitvara/zephyr,pklazy/zephyr,aceofall/zephyr-iotos,zephyrproject-rtos/zephyr,erwango/zephyr,finikorg/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,pklazy/zephyr,nashif/zephyr,mbolivar/zephyr,kraj/zephyr,ldts/zephyr,runchip/zephyr-cc3200,fbsder/zephyr,rsalveti/zephyr,sharronliu/zephyr,mbolivar/zephyr,finikorg/zephyr,fbsder/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,kraj/zephyr,bboozzoo/zephyr,punitvara/zephyr,Vudentz/zephyr,pklazy/zephyr,bboozzoo/zephyr,explora26/zephyr,rsalveti/zephyr,mirzak/zephyr-os,galak/zephyr,erwango/zephyr,aceofall/zephyr-iotos,fractalclone/zephyr-riscv,fractalclone/zephyr-riscv,bigdinotech/zephyr,holtmann/zephyr,sharronliu/zephyr,mirzak/zephyr-os,finikorg/zephyr,holtmann/zephyr,explora26/zephyr,runchip/zephyr-cc3200,mirzak/zephyr-os,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,runchip/zephyr-cc3220,bigdinotech/zephyr