zephyr/arch
Watson Zeng 249aa62c27 arch: arc: fix for hs eret has no copy of pc in interrupt entry
According to the PRMs of both ARC EM & ARC HS families on entry
to Fast IRQ handler ARC hardware saves PC (Program Counter) value
of where processor was right before jumping to the IRQ handler into
2 registers: ILINK & ERET.

But it turned out in case of ARC HS (at least in configuration with
Fast IRQs & 1 register bank) only ILINK was populated with the
previous PC, while in Zephyr we relied on what we read out of ERET.
That lead to funny issues when CPU returned from IRQ handling
to some unexpected location.

And now with that precious knowledge we're switching to return
address recovery from ILINK so that with both families of ARC
processors (EM & HS) we may get reliably good results.

The wrapper is few cycles shorter/faster as well, as we may shave off
another extra instruction for transferring ERET value from its AUX reg
to a scratch core register to be later stored in the memory.

+----+---------------+---------------+--------------+
|    | FIRQ          | RIRQ          | RIRQ(Secure) |
+----+---------------+---------------+--------------+
| HS | ILINK=PC      | ILINK=PC      | NULL         |
+----+---------------+---------------+--------------+
| EM | ILINK=ERET=PC | ILINK=ERET=PC | ILINK=PC     |
+----+---------------+---------------+--------------+

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-11-26 14:19:28 +01:00
..
arc arch: arc: fix for hs eret has no copy of pc in interrupt entry 2020-11-26 14:19:28 +01:00
arm aarch64: error: Handle software-generated fatal exceptions 2020-11-25 12:02:11 +02:00
common timing: do not repeatedly do init()/start()/stop() 2020-11-11 23:55:49 -05:00
nios2 nios2: fix register saving during thread switch instrumentation 2020-11-11 23:55:49 -05:00
posix tracing: roll thread switch in/out into thread stats functions 2020-11-11 23:55:49 -05:00
riscv arch: mem protect Kconfig cleanups 2020-11-18 08:02:08 -05:00
sparc SPARC: add support for the tracing subsystem 2020-11-18 10:31:26 +01:00
x86 drivers/pcie: Change pcie_get_mbar() to return size and flags 2020-11-20 09:36:22 +02:00
xtensa tracing: roll thread switch in/out into thread stats functions 2020-11-11 23:55:49 -05:00
CMakeLists.txt cmake: fix include directories to work with out-of-tree arch 2020-08-05 08:06:07 -04:00
Kconfig arch: mem protect Kconfig cleanups 2020-11-18 08:02:08 -05:00