diff options
author | Max Filippov | 2020-07-06 02:31:59 +0200 |
---|---|---|
committer | Max Filippov | 2020-08-21 21:48:14 +0200 |
commit | a7d479ee51c5911c93ee931efe4c2413b54c8756 (patch) | |
tree | b20ef102ab90ee39b39f71df5208f08899bf5c42 /target/xtensa/overlay_tool.h | |
parent | target/xtensa: make opcode properties more dynamic (diff) | |
download | qemu-a7d479ee51c5911c93ee931efe4c2413b54c8756.tar.gz qemu-a7d479ee51c5911c93ee931efe4c2413b54c8756.tar.xz qemu-a7d479ee51c5911c93ee931efe4c2413b54c8756.zip |
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>
Diffstat (limited to 'target/xtensa/overlay_tool.h')
-rw-r--r-- | target/xtensa/overlay_tool.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h index a994e69b6e..eb9f08af0b 100644 --- a/target/xtensa/overlay_tool.h +++ b/target/xtensa/overlay_tool.h @@ -216,6 +216,9 @@ #define XTHAL_INTTYPE_IDMA_ERR INTTYPE_IDMA_ERR #define XTHAL_INTTYPE_GS_ERR INTTYPE_GS_ERR +#ifndef XCHAL_NMILEVEL +#define XCHAL_NMILEVEL (XCHAL_NUM_INTLEVELS + 1) +#endif #define INTERRUPT(i) { \ .level = XCHAL_INT ## i ## _LEVEL, \ @@ -305,7 +308,8 @@ #define INTERRUPTS_SECTION \ .ninterrupt = XCHAL_NUM_INTERRUPTS, \ - .nlevel = XCHAL_NUM_INTLEVELS, \ + .nlevel = XCHAL_NUM_INTLEVELS + XCHAL_HAVE_NMI, \ + .nmi_level = XCHAL_NMILEVEL, \ .interrupt_vector = INTERRUPT_VECTORS, \ .level_mask = LEVEL_MASKS, \ .inttype_mask = INTTYPE_MASKS, \ |