2017-02-09 09:16:29 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <toolchain.h>
|
2017-06-17 23:30:47 +08:00
|
|
|
#include <linker/sections.h>
|
2017-02-09 09:16:29 +08:00
|
|
|
#include <sw_isr_table.h>
|
|
|
|
#include <arch/cpu.h>
|
|
|
|
|
2017-02-14 01:56:25 +08:00
|
|
|
/* There is an additional member at the end populated by the linker script
|
|
|
|
* which indicates the number of interrupts specified
|
|
|
|
*/
|
|
|
|
struct int_list_header {
|
2017-04-21 02:30:33 +08:00
|
|
|
u32_t table_size;
|
|
|
|
u32_t offset;
|
2017-02-14 01:56:25 +08:00
|
|
|
};
|
|
|
|
|
2017-02-09 09:16:29 +08:00
|
|
|
/* These values are not included in the resulting binary, but instead form the
|
|
|
|
* header of the initList section, which is used by gen_isr_tables.py to create
|
|
|
|
* the vector and sw isr tables,
|
|
|
|
*/
|
2017-02-14 01:56:25 +08:00
|
|
|
_GENERIC_SECTION(.irq_info) struct int_list_header _iheader = {
|
|
|
|
.table_size = IRQ_TABLE_SIZE,
|
|
|
|
.offset = CONFIG_GEN_IRQ_START_VECTOR,
|
|
|
|
};
|
2017-02-09 09:16:29 +08:00
|
|
|
|
|
|
|
/* These are placeholder tables. They will be replaced by the real tables
|
|
|
|
* generated by gen_isr_tables.py.
|
2018-05-09 18:00:24 +08:00
|
|
|
*
|
2018-05-16 20:08:47 +08:00
|
|
|
* _irq_spurious and _isr_wrapper are used as placeholder values to
|
|
|
|
* ensure that they are not optimized out in the first link. The first
|
|
|
|
* link must contain the same symbols as the second one for the code
|
|
|
|
* generation to work.
|
2017-02-09 09:16:29 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Some arches don't use a vector table, they have a common exception entry
|
|
|
|
* point for all interrupts. Don't generate a table in this case.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_GEN_IRQ_VECTOR_TABLE
|
2017-04-21 02:30:33 +08:00
|
|
|
u32_t __irq_vector_table _irq_vector_table[IRQ_TABLE_SIZE] = {
|
2018-05-16 20:08:47 +08:00
|
|
|
[0 ...(IRQ_TABLE_SIZE - 1)] = (u32_t)&_isr_wrapper,
|
2017-02-09 09:16:29 +08:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* If there are no interrupts at all, or all interrupts are of the 'direct'
|
|
|
|
* type and bypass the _sw_isr_table, then do not generate one.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_GEN_SW_ISR_TABLE
|
|
|
|
struct _isr_table_entry __sw_isr_table _sw_isr_table[IRQ_TABLE_SIZE] = {
|
2018-05-09 18:00:24 +08:00
|
|
|
[0 ...(IRQ_TABLE_SIZE - 1)] = {(void *)0x42, (void *)&_irq_spurious},
|
2017-02-09 09:16:29 +08:00
|
|
|
};
|
|
|
|
#endif
|