Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Xtensa cores do not support NMI #67853

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 19 additions & 6 deletions arch/xtensa/core/xtensa-asm2-util.S
Expand Up @@ -298,27 +298,40 @@ _handle_excint:

DEF_EXCINT 1, _handle_excint, xtensa_excint1_c

#if XCHAL_NMILEVEL >= 2
/* In code below we are using XCHAL_NMILEVEL and XCHAL_NUM_INTLEVELS
* (whichever is higher), since not all Xtensa configurations support
* NMI. In such case we will use XCHAL_NUM_INTLEVELS.
*/
#if XCHAL_HAVE_NMI
#define MAX_INTR_LEVEL XCHAL_NMILEVEL
#elif XCHAL_HAVE_INTERRUPTS
#define MAX_INTR_LEVEL XCHAL_NUM_INTLEVELS
#else
#error Xtensa core with no interrupt support is used
#define MAX_INTR_LEVEL 0
#endif

#if MAX_INTR_LEVEL >= 2
DEF_EXCINT 2, _handle_excint, xtensa_int2_c
#endif

#if XCHAL_NMILEVEL >= 3
#if MAX_INTR_LEVEL >= 3
DEF_EXCINT 3, _handle_excint, xtensa_int3_c
#endif

#if XCHAL_NMILEVEL >= 4
#if MAX_INTR_LEVEL >= 4
DEF_EXCINT 4, _handle_excint, xtensa_int4_c
#endif

#if XCHAL_NMILEVEL >= 5
#if MAX_INTR_LEVEL >= 5
DEF_EXCINT 5, _handle_excint, xtensa_int5_c
#endif

#if XCHAL_NMILEVEL >= 6
#if MAX_INTR_LEVEL >= 6
DEF_EXCINT 6, _handle_excint, xtensa_int6_c
#endif

#if XCHAL_NMILEVEL >= 7
#if MAX_INTR_LEVEL >= 7
DEF_EXCINT 7, _handle_excint, xtensa_int7_c
#endif

Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/xtensa-asm2-s.h
Expand Up @@ -306,7 +306,7 @@ _do_call_\@:
* execution) while we muck with the windows and decrement the nested
* count. The restore will unmask them correctly.
*/
rsil a0, XCHAL_NMILEVEL
rsil a0, XCHAL_NUM_INTLEVELS

/* Decrement nest count */
rsr.\SR a3
Expand Down