zephyr/arch/common/Makefile.gen_isr_tables
Leandro Pereira 27ea2d8eb7 arch: xtensa: Convert Xtensa port to use gen_isr_table
The Xtensa port was the only one remaining to be converted to the new
way of connecting interrupts in Zephyr.  Some things are still
unconverted, mainly the exception table, and this will be performed
another time.

Of note: _irq_priority_set() isn't called on _ARCH_IRQ_CONNECT(), since
IRQs can't change priority on Xtensa: while the architecture has the
concept of interrupt priority levels, each line has a fixed level and
can't be changed.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-09 12:26:14 -07:00

43 lines
1.1 KiB
Makefile

GEN_ISR_TABLE := $(srctree)/arch/common/gen_isr_tables.py
OUTPUT_SRC := isr_tables.c
OUTPUT_OBJ := isr_tables.o
ifeq ($(ARCH),riscv32)
OUTPUT_FORMAT := elf32-littleriscv
else ifeq ($(ARCH),xtensa)
OUTPUT_FORMAT := elf32-xtensa-le
else
OUTPUT_FORMAT := elf32-little$(ARCH)
endif
GEN_ISR_TABLE_EXTRA_ARGS :=
ifeq ($(KBUILD_VERBOSE),1)
GEN_ISR_TABLE_EXTRA_ARGS += --debug
endif
ifeq ($(CONFIG_GEN_SW_ISR_TABLE),y)
GEN_ISR_TABLE_EXTRA_ARGS += --sw-isr-table
endif
ifeq ($(CONFIG_GEN_IRQ_VECTOR_TABLE),y)
GEN_ISR_TABLE_EXTRA_ARGS += --vector-table
endif
# Rule to extract the .intList section from the $(PREBUILT_KERNEL) binary
# and create the source file $(OUTPUT_SRC). This is a C file which contains
# the interrupt tables.
quiet_cmd_gen_irq = IRQ $@
cmd_gen_irq = \
( \
$(OBJCOPY) -I $(OUTPUT_FORMAT) -O binary --only-section=.intList \
$< isrList.bin && \
$(GEN_ISR_TABLE) --output-source $@ \
--intlist isrList.bin $(GEN_ISR_TABLE_EXTRA_ARGS) \
)
$(OUTPUT_SRC): $(PREBUILT_KERNEL) $(GEN_ISR_TABLE)
$(call cmd,gen_irq)
GENERATED_KERNEL_OBJECT_FILES += $(OUTPUT_OBJ)