zephyr/arch/xtensa/core/xtensa_intgen.tmpl
Andy Ross 7de010b5e5 xtensa: Interrupt generator script and output for qemu & esp32
This python script reads the core-isa.h interrupt definitions (via
running a template file through the toolchain preprocessor to generate
an input file) and emits a fully populated, optimized C handling code
that binary searches only the declared interrupts at a given level and
correctly detects spurious interrupts (and/or incorrect core-isa.h
definitions).

The generated code, alas, turns out not to be any faster than simply
searching the interrupt mask with CLZ (er, NSAU in xtensese), though
it could be faster in theory if the compiler made different choices,
see comments.  But I like this for the robustness of the fully
populated search trees and the checking of level vs. mask.

This simply commits the script output into the source tree, including
some checking code to force a build error if the toolchain changes the
headers incompatibly.  It would be better long term to have these
headers be generated at build time, but that requires more cmake fu
than I have.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00

44 lines
1.8 KiB
Cheetah

#include <xtensa/config/core-isa.h>
/*
* Not a C source code file.
*
* Intended to be preprocessed only, to produce output for
* interpretation by the xtensa-int-handlers.py script. Literally all
* this does is emit records for which interrupts are at which level,
* available per-hardware by an SDK-provided core-isa.h file.
*/
__xtensa_int_level_magic__ 0 XCHAL_INT0_LEVEL
__xtensa_int_level_magic__ 1 XCHAL_INT1_LEVEL
__xtensa_int_level_magic__ 2 XCHAL_INT2_LEVEL
__xtensa_int_level_magic__ 3 XCHAL_INT3_LEVEL
__xtensa_int_level_magic__ 4 XCHAL_INT4_LEVEL
__xtensa_int_level_magic__ 5 XCHAL_INT5_LEVEL
__xtensa_int_level_magic__ 6 XCHAL_INT6_LEVEL
__xtensa_int_level_magic__ 7 XCHAL_INT7_LEVEL
__xtensa_int_level_magic__ 8 XCHAL_INT8_LEVEL
__xtensa_int_level_magic__ 9 XCHAL_INT9_LEVEL
__xtensa_int_level_magic__ 10 XCHAL_INT10_LEVEL
__xtensa_int_level_magic__ 11 XCHAL_INT11_LEVEL
__xtensa_int_level_magic__ 12 XCHAL_INT12_LEVEL
__xtensa_int_level_magic__ 13 XCHAL_INT13_LEVEL
__xtensa_int_level_magic__ 14 XCHAL_INT14_LEVEL
__xtensa_int_level_magic__ 15 XCHAL_INT15_LEVEL
__xtensa_int_level_magic__ 16 XCHAL_INT16_LEVEL
__xtensa_int_level_magic__ 17 XCHAL_INT17_LEVEL
__xtensa_int_level_magic__ 18 XCHAL_INT18_LEVEL
__xtensa_int_level_magic__ 19 XCHAL_INT19_LEVEL
__xtensa_int_level_magic__ 20 XCHAL_INT20_LEVEL
__xtensa_int_level_magic__ 21 XCHAL_INT21_LEVEL
__xtensa_int_level_magic__ 22 XCHAL_INT22_LEVEL
__xtensa_int_level_magic__ 23 XCHAL_INT23_LEVEL
__xtensa_int_level_magic__ 24 XCHAL_INT24_LEVEL
__xtensa_int_level_magic__ 25 XCHAL_INT25_LEVEL
__xtensa_int_level_magic__ 26 XCHAL_INT26_LEVEL
__xtensa_int_level_magic__ 27 XCHAL_INT27_LEVEL
__xtensa_int_level_magic__ 28 XCHAL_INT28_LEVEL
__xtensa_int_level_magic__ 29 XCHAL_INT29_LEVEL
__xtensa_int_level_magic__ 30 XCHAL_INT30_LEVEL
__xtensa_int_level_magic__ 31 XCHAL_INT31_LEVEL