41 lines
1.0 KiB
Makefile
41 lines
1.0 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
|
|
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)
|