2017-02-09 09:16:29 +08:00
|
|
|
GEN_ISR_TABLE := $(srctree)/arch/common/gen_isr_tables.py
|
|
|
|
OUTPUT_SRC := isr_tables.c
|
|
|
|
OUTPUT_OBJ := isr_tables.o
|
|
|
|
|
2017-02-14 02:11:54 +08:00
|
|
|
ifeq ($(ARCH),riscv32)
|
|
|
|
OUTPUT_FORMAT := elf32-littleriscv
|
2017-02-09 09:16:29 +08:00
|
|
|
else
|
2017-02-14 02:11:54 +08:00
|
|
|
OUTPUT_FORMAT := elf32-little$(ARCH)
|
2017-02-09 09:16:29 +08:00
|
|
|
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)
|
|
|
|
|
2017-05-13 04:27:50 +08:00
|
|
|
GENERATED_KERNEL_OBJECT_FILES += $(OUTPUT_OBJ)
|