Skip to content

Commit

Permalink
arch/xtensa: xtensa_intgen.py: Emit handlers for all levels
Browse files Browse the repository at this point in the history
The original code would (unsurprisingly) only emit handler functions
for interrupt levels with interrupts associated with them.  But it
turns out that it's possible to configure an xtensa device with an
empty-but-otherwise-real interrupt level (specifically mt8195 has a
"Level 3" interrupt not associated with any input IRQS, it's one level
above EXCM_LEVEL and one level below the DEBUG exception).

This script is old, and not set up to parse the full core-isa.h
directly, so modifying it to detect this condition is difficult.
Instead, just emit all 15 possible interrupt handlers, even empty
ones.  The extra stubs are harmless as they'll be dropped if uncalled.

Signed-off-by: Andy Ross <[email protected]>
  • Loading branch information
andyross authored and nashif committed May 21, 2024
1 parent 03cafbd commit bcf6b27
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions arch/xtensa/core/xtensa_intgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,11 @@ def emit_int_handler(ints):
cprint("#endif")
cprint("")

# Populate empty levels just for sanity. The second-to-last interrupt
# level (usually "debug") typically doesn't have any associated
# vectors, but we don't have any way to know that a-prioi.
max = 0
for lvl in ints_by_lvl:
if lvl > max:
max = lvl
# Populate all theoretical levels just in case. Odd cores have been
# seen in the wild with "empty" interrupt levels that exist in the
# hardware but without any interrupts associated with them. The
# unused handlers will be ignored if uncalled.
max = 15

for lvl in range(0, max+1):
if not lvl in ints_by_lvl:
Expand Down

0 comments on commit bcf6b27

Please sign in to comment.