Update static IDT generation to use IRQ priority

Updates the 'gen_idt' tool to generate a mapping of IRQ numbers to
interrupt vector IDs, thereby allowing the IRQ priority to be utilized
when statically connecting an interrupt.

Change-Id: I2e54ceb65145682820dfbd8ca1ee6ec68d71ce1a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
Peter Mitsis 2015-10-09 16:23:25 -04:00 committed by Anas Nashif
commit 47888a31db
10 changed files with 190 additions and 60 deletions

View file

@ -78,19 +78,23 @@ initial_link()
# ${1} input file (${KERNEL_NAME}.elf)
# ${2} output file (staticIdt.o)
# ${3} output file (int_vector_alloc)
# ${4} output file (irq_int_vector_map)
gen_idt()
{
test -z $OUTPUT_FORMAT && OUTPUT_FORMAT=elf32-i386
test -z $OUTPUT_ARCH && OUTPUT_ARCH=i386
${OBJCOPY} -I $OUTPUT_FORMAT -O binary -j intList ${1} isrList.bin
${GENIDT} -i isrList.bin -n ${CONFIG_IDT_NUM_VECTORS:-256} \
-o staticIdt.bin -b ${3}.bin
-o staticIdt.bin -b ${3}.bin -m ${4}.bin
${OBJCOPY} -I binary -B $OUTPUT_ARCH -O $OUTPUT_FORMAT \
--rename-section .data=staticIdt staticIdt.bin ${2}
${OBJCOPY} -I binary -B $OUTPUT_ARCH -O $OUTPUT_FORMAT \
--rename-section .data=${3} ${3}.bin ${3}.o
${OBJCOPY} -I binary -B $OUTPUT_ARCH -O $OUTPUT_FORMAT \
--rename-section .data=${4} ${4}.bin ${4}.o
rm -f staticIdt.bin
rm -f ${3}.bin
rm -f ${4}.bin
rm -f isrList.bin
}
@ -100,9 +104,10 @@ gen_idt()
# ${3} - input file (staticIdt.o)
# ${4} - output file
# ${5} - additional input file if applicable
# ${6} - additional input file if applicable
zephyr_link()
{
${LD} -T ${2} @${1} ${3} ${5} -o ${4}
${LD} -T ${2} @${1} ${3} ${5} ${6} -o ${4}
${OBJCOPY} --set-section-flags intList=noload ${4} elf.tmp
${OBJCOPY} -R intList elf.tmp ${4}
rm elf.tmp
@ -266,10 +271,10 @@ fi
if [ "${SRCARCH}" = "x86" ]; then
info SIDT ${KERNEL_NAME}.elf
gen_idt ${KERNEL_NAME}.elf staticIdt.o int_vector_alloc
gen_idt ${KERNEL_NAME}.elf staticIdt.o int_vector_alloc irq_int_vector_map
linker_command final-linker.cmd -DFINAL_LINK
zephyr_link ${KERNEL_NAME}.lnk final-linker.cmd staticIdt.o \
${KERNEL_NAME}.elf int_vector_alloc.o
${KERNEL_NAME}.elf int_vector_alloc.o irq_int_vector_map.o
fi
info BIN ${KERNEL_NAME}.bin