arm: use gen_isr_tables mechanism for interrupts
This replaces the hard-coded vector table, as well as the software ISR table created by the linker. Now both are generated in build via script. Issue: ZEP-1038, ZEP-1165 Change-Id: Ie6faaf8f7ea3a7a25ecb542f6cf7740836ad7da3 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
1927b3d020
commit
e7acd3224c
8 changed files with 33 additions and 177 deletions
|
@ -1,13 +1,10 @@
|
|||
ccflags-y += -I$(srctree)/kernel/include
|
||||
asflags-y := ${ccflags-y}
|
||||
|
||||
obj-y = exc_exit.o irq_init.o \
|
||||
swap.o \
|
||||
fault.o \
|
||||
irq_manage.o thread.o cpu_idle.o \
|
||||
fault_s.o isr_wrapper.o \
|
||||
fatal.o sys_fatal_error_handler.o thread_abort.o
|
||||
obj-y = exc_exit.o irq_init.o swap.o fault.o irq_manage.o thread.o \
|
||||
cpu_idle.o fault_s.o fatal.o sys_fatal_error_handler.o thread_abort.o
|
||||
|
||||
obj-$(CONFIG_GEN_SW_ISR_TABLE) += isr_wrapper.o
|
||||
obj-$(CONFIG_CPLUSPLUS) += __aeabi_atexit.o
|
||||
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
|
||||
obj-$(CONFIG_CPU_CORTEX_M) += cortex_m/
|
||||
|
|
|
@ -212,45 +212,8 @@ config IRQ_OFFLOAD
|
|||
run in interrupt context. Adds some overhead to context switching.
|
||||
Mainly useful for test cases.
|
||||
|
||||
config SW_ISR_TABLE
|
||||
bool
|
||||
prompt "Enable software interrupt handler table"
|
||||
config GEN_ISR_TABLES
|
||||
default y
|
||||
help
|
||||
Enable an interrupt handler table implemented in software. This
|
||||
table, unlike ISRs connected directly in the vector table, allow
|
||||
a parameter to be passed to the interrupt handlers. Also, invoking
|
||||
the exeception/interrupt exit stub is automatically done.
|
||||
|
||||
config IRQ_VECTOR_TABLE_CUSTOM
|
||||
bool
|
||||
prompt "Projects provide a custom static IRQ part of vector table"
|
||||
depends on !SW_ISR_TABLE
|
||||
default n
|
||||
help
|
||||
Projects, not the board, provide the IRQ part of the vector table.
|
||||
|
||||
This is the table of interrupt handlers with the best potential
|
||||
performance, but is the less flexible.
|
||||
|
||||
The ISRs are installed directly in the vector table, thus are
|
||||
directly called by the CPU when an interrupt is taken. This adds
|
||||
the least overhead when handling an interrupt.
|
||||
|
||||
Downsides:
|
||||
|
||||
- ISRs cannot have a parameter
|
||||
- ISRs cannot be connected at runtime
|
||||
- ISRs must notify the kernel manually by invoking _IntExit() when
|
||||
then are about to return.
|
||||
|
||||
config IRQ_VECTOR_TABLE_SOC
|
||||
bool
|
||||
# omit prompt to signify a "hidden" option
|
||||
depends on SW_ISR_TABLE || !IRQ_VECTOR_TABLE_CUSTOM
|
||||
default y
|
||||
help
|
||||
Not user-selectable, helps build system logic.
|
||||
|
||||
config ZERO_LATENCY_IRQS
|
||||
bool
|
||||
|
|
|
@ -9,5 +9,3 @@ obj-y = vector_table.o reset.o \
|
|||
nmi_on_reset.o prep_c.o scs.o scb.o nmi.o \
|
||||
exc_manage.o
|
||||
|
||||
obj-$(CONFIG_IRQ_VECTOR_TABLE_SOC) += irq_vector_table.o
|
||||
obj-$(CONFIG_SW_ISR_TABLE) += sw_isr_table.o
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Intel Corporation.
|
||||
* Copyright (c) 2014 Wind River Systems, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief IRQ part of vector table
|
||||
*
|
||||
* This file contains the IRQ part of the vector table. It is meant to be used
|
||||
* for one of two cases:
|
||||
*
|
||||
* a) When software-managed ISRs (SW_ISR_TABLE) is enabled, and in that case it
|
||||
* binds _isr_wrapper() to all the IRQ entries in the vector table.
|
||||
*
|
||||
* b) When the platform is written so that device ISRs are installed directly in
|
||||
* the vector table, they are enumerated here.
|
||||
*/
|
||||
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
extern void _isr_wrapper(void);
|
||||
typedef void (*vth)(void); /* Vector Table Handler */
|
||||
|
||||
#if defined(CONFIG_SW_ISR_TABLE)
|
||||
|
||||
vth __irq_vector_table _irq_vector_table[CONFIG_NUM_IRQS] = {
|
||||
[0 ...(CONFIG_NUM_IRQS - 1)] = _isr_wrapper,
|
||||
};
|
||||
|
||||
#elif !defined(CONFIG_IRQ_VECTOR_TABLE_CUSTOM)
|
||||
|
||||
extern void _irq_spurious(void);
|
||||
|
||||
/* placeholders: fill with real ISRs */
|
||||
vth __irq_vector_table _irq_vector_table[CONFIG_NUM_IRQS] = {
|
||||
[0 ...(CONFIG_NUM_IRQS - 1)] = _irq_spurious,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_SW_ISR_TABLE */
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2015 Wind River Systems, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief ISR table for static ISR declarations for ARM
|
||||
*
|
||||
* Software ISR table for ARM
|
||||
*/
|
||||
|
||||
#include <toolchain.h>
|
||||
#include <sections.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
_ASM_FILE_PROLOGUE
|
||||
|
||||
/*
|
||||
* enable preprocessor features, such
|
||||
* as %expr - evaluate the expression and use it as a string
|
||||
*/
|
||||
.altmacro
|
||||
|
||||
/*
|
||||
* Define an ISR table entry
|
||||
* Define symbol as weak and give the section .gnu.linkonce
|
||||
* prefix. This allows linker overload the symbol and the
|
||||
* whole section by the one defined by a device driver
|
||||
*/
|
||||
.macro _isr_table_entry_declare index
|
||||
WDATA(_isr_irq\index)
|
||||
.section .gnu.linkonce.isr_irq\index
|
||||
_isr_irq\index: .word 0xABAD1DEA, _irq_spurious
|
||||
.endm
|
||||
|
||||
/*
|
||||
* Declare the ISR table
|
||||
*/
|
||||
.macro _isr_table_declare from, to
|
||||
counter = \from
|
||||
.rept (\to - \from + 1)
|
||||
_isr_table_entry_declare %counter
|
||||
counter = counter + 1
|
||||
.endr
|
||||
.endm
|
||||
|
||||
GTEXT(_irq_spurious)
|
||||
GDATA(_sw_isr_table)
|
||||
|
||||
.section .isr_irq0
|
||||
.align
|
||||
_sw_isr_table:
|
||||
|
||||
_isr_table_declare 0 CONFIG_NUM_IRQS
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue