2017-02-07 07:41:00 +08:00
|
|
|
ifeq ($(KBUILD_VERBOSE),1)
|
2017-07-15 03:48:35 +08:00
|
|
|
GENIDT_EXTRA_ARGS := --verbose
|
2017-02-07 07:41:00 +08:00
|
|
|
else
|
|
|
|
GENIDT_EXTRA_ARGS :=
|
|
|
|
endif
|
|
|
|
|
2017-07-15 03:48:35 +08:00
|
|
|
GENIDT := $(srctree)/scripts/gen_idt.py
|
2017-02-07 07:41:00 +08:00
|
|
|
|
|
|
|
OUTPUT_FORMAT ?= elf32-i386
|
|
|
|
OUTPUT_ARCH ?= i386
|
|
|
|
|
|
|
|
quiet_cmd_gen_idt = SIDT $@
|
|
|
|
cmd_gen_idt = \
|
|
|
|
( \
|
2017-07-15 03:48:35 +08:00
|
|
|
$(GENIDT) --kernel $(PREBUILT_KERNEL) \
|
|
|
|
--output-idt staticIdt.bin \
|
|
|
|
--vector-map irq_int_vector_map.bin \
|
|
|
|
$(GENIDT_EXTRA_ARGS) && \
|
2017-02-07 07:41:00 +08:00
|
|
|
$(OBJCOPY) -I binary -B $(OUTPUT_ARCH) -O $(OUTPUT_FORMAT) \
|
|
|
|
--rename-section .data=staticIdt staticIdt.bin staticIdt.o && \
|
|
|
|
$(OBJCOPY) -I binary -B $(OUTPUT_ARCH) -O $(OUTPUT_FORMAT) \
|
|
|
|
--rename-section .data=irq_int_vector_map irq_int_vector_map.bin \
|
|
|
|
irq_int_vector_map.o && \
|
2017-07-15 03:48:35 +08:00
|
|
|
rm staticIdt.bin irq_int_vector_map.bin \
|
2017-02-07 07:41:00 +08:00
|
|
|
)
|
|
|
|
|
2017-04-20 00:55:22 +08:00
|
|
|
staticIdt.o: $(PREBUILT_KERNEL) $(GENIDT)
|
2017-02-07 07:41:00 +08:00
|
|
|
$(call cmd,gen_idt)
|
|
|
|
|
2017-05-13 04:27:50 +08:00
|
|
|
irq_int_vector_map.o: staticIdt.o
|
2017-02-07 07:41:00 +08:00
|
|
|
|
2017-05-13 04:27:50 +08:00
|
|
|
GENERATED_KERNEL_OBJECT_FILES += staticIdt.o irq_int_vector_map.o
|
2017-02-07 07:41:00 +08:00
|
|
|
|