target/xtensa: implement NMI support
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 6 Jul 2020 00:31:59 +0000 (17:31 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 21 Aug 2020 19:48:14 +0000 (12:48 -0700)
commita7d479ee51c5911c93ee931efe4c2413b54c8756
treeb20ef102ab90ee39b39f71df5208f08899bf5c42
parent91dc2b2d12a0343f37a3ab425f2912ae0ce18187
target/xtensa: implement NMI support

When NMI is configured it is taken regardless of INTENABLE SR contents,
PS.INTLEVEL or PS.EXCM. It is cleared automatically once it's taken.

Add nmi_level to XtensaConfig, puth there NMI level from the overlay or
XCHAL_NUM_INTLEVELS + 1 when NMI is not configured. Add NMI mask to
INTENABLE SR and limit CINTLEVEL to nmi_level - 1 when determining
pending IRQ level in check_interrupt(). Always take and clear pending
interrupt at nmi_level in the handle_interrupt().

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/xtensa/pic_cpu.c
target/xtensa/cpu.h
target/xtensa/exc_helper.c
target/xtensa/overlay_tool.h