zephyr/include/linker/intlist.ld
Andrew Boie 1927b3d020 gen_isr_tables: New static interrupt build mechanism
This is a new mechanism for generating interrupt tables which will
be useful on many architectures. It replaces the old linker-based
mechanism for creating these tables and has a couple advantages:

 1) It is now possible to use enums as the IRQ line argument to
    IRQ_CONNECT(), which should ease CMSIS integration.
 2) The vector table itself is now generated, which lets us place
    interrupts directly into the vector table without having to
    hard-code them. This is a feature we have long enjoyed on x86
    and will enable 'direct' interrupts.
 3) More code is common, requiring less arch-specific code to
    support.

This patch introduces the common code for this mechanism. Follow-up
patches will enable it on various arches.

Issue: ZEP-1038, ZEP-1165
Change-Id: I9acd6e0de8b438fa9293f2e00563628f7510168a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-11 01:27:58 +00:00

53 lines
1.6 KiB
Text

/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/* This creates a special section which is not included by the final binary,
* instead it is consumed by the gen_isr_tables.py script.
*
* What we create here is a data structure:
*
* struct {
* void *spurious_irq_handler;
* void *sw_irq_handler;
* uint32_t num_isrs;
* uint32_t num_vectors;
* struct _isr_list isrs[]; <- of size num_isrs
* }
*
* Which indicates the memory address of the spurious IRQ handler and the
* number of isrs that were defined, the total number of IRQ lines in the
* system, followed by an appropriate number of instances of
* struct _isr_list. See include/sw_isr_table.h
*
* You will need to declare a bogus memory region for IDT_LIST. It doesn't
* matter where this region goes as it is stripped from the final ELF image.
* The address doesn't even have to be valid on the target. However, it
* shouldn't overlap any other regions. On most arches the following should be
* fine:
*
* MEMORY {
* .. other regions ..
* IDT_LIST : ORIGIN = 0xfffff7ff, LENGTH = 2K
* }
*/
/* We don't set NOLOAD here, as objcopy will not let us extract the intList
* section into a file if we do so; the resulting file is 0 bytes. We do so
* with objcopy in Makefile.gen_isr_tables after we have extracted the
* information we need.
*/
SECTION_PROLOGUE(.intList,,)
{
KEEP(*(.irq.spurious))
KEEP(*(.irq.handler))
LONG((__INT_LIST_END__ - __INT_LIST_START__) / __ISR_LIST_SIZEOF)
KEEP(*(.irq.tablesize))
__INT_LIST_START__ = .;
KEEP(*(.intList))
__INT_LIST_END__ = .;
} GROUP_LINK_IN(IDT_LIST)