nios2: use gen_isr_tables mechanism
Change-Id: If1ffcedf86a015789b42e7aec45dae3cc58f74fa Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
122467e9ee
commit
c99c686b2c
6 changed files with 30 additions and 67 deletions
|
@ -5,6 +5,9 @@ OUTPUT_OBJ := isr_tables.o
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
OUTPUT_FORMAT := elf32-littlearm
|
OUTPUT_FORMAT := elf32-littlearm
|
||||||
OUTPUT_ARCH := arm
|
OUTPUT_ARCH := arm
|
||||||
|
else ifeq ($(ARCH),nios2)
|
||||||
|
OUTPUT_FORMAT := elf32-littlenios2
|
||||||
|
OUTPUT_ARCH := nios2
|
||||||
else
|
else
|
||||||
$(error Output formats not defined for this architecture)
|
$(error Output formats not defined for this architecture)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -37,6 +37,16 @@ config XIP
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config GEN_ISR_TABLES
|
||||||
|
default y
|
||||||
|
|
||||||
|
config GEN_IRQ_VECTOR_TABLE
|
||||||
|
default n
|
||||||
|
|
||||||
|
config NUM_IRQS
|
||||||
|
int
|
||||||
|
default 32
|
||||||
|
|
||||||
config IRQ_OFFLOAD
|
config IRQ_OFFLOAD
|
||||||
bool "Enable IRQ offload"
|
bool "Enable IRQ offload"
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -3,6 +3,6 @@ ccflags-y += -I$(srctree)/arch/$(ARCH)/include
|
||||||
|
|
||||||
obj-y += reset.o irq_manage.o fatal.o swap.o thread.o \
|
obj-y += reset.o irq_manage.o fatal.o swap.o thread.o \
|
||||||
cpu_idle.o irq_offload.o prep_c.o crt0.o \
|
cpu_idle.o irq_offload.o prep_c.o crt0.o \
|
||||||
exception.o sw_isr_table.o cache.o
|
exception.o cache.o
|
||||||
|
|
||||||
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
|
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
/* sw_isr_table.S - ISR table for static ISR declarations for ARC */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <toolchain.h>
|
|
||||||
#include <sections.h>
|
|
||||||
#include <arch/cpu.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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)
|
|
||||||
_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 NIOS2_NIRQ
|
|
|
@ -74,14 +74,12 @@ typedef unsigned int vaddr_t;
|
||||||
*/
|
*/
|
||||||
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
|
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
|
||||||
({ \
|
({ \
|
||||||
enum { IRQ = irq_p }; \
|
_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
|
||||||
static struct _isr_table_entry _CONCAT(_isr_irq, irq_p) \
|
|
||||||
__attribute__ ((used)) \
|
|
||||||
__attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
|
|
||||||
{isr_param_p, isr_p}; \
|
|
||||||
irq_p; \
|
irq_p; \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
extern void _irq_spurious(void *unused);
|
||||||
|
|
||||||
static ALWAYS_INLINE unsigned int _arch_irq_lock(void)
|
static ALWAYS_INLINE unsigned int _arch_irq_lock(void)
|
||||||
{
|
{
|
||||||
unsigned int key, tmp;
|
unsigned int key, tmp;
|
||||||
|
|
|
@ -61,6 +61,9 @@ MEMORY
|
||||||
RESET (rx) : ORIGIN = _RESET_VECTOR, LENGTH = 0x20
|
RESET (rx) : ORIGIN = _RESET_VECTOR, LENGTH = 0x20
|
||||||
FLASH (rx) : ORIGIN = _RESET_VECTOR + 0x20 , LENGTH = (_ROM_SIZE - 0x20)
|
FLASH (rx) : ORIGIN = _RESET_VECTOR + 0x20 , LENGTH = (_ROM_SIZE - 0x20)
|
||||||
SRAM (wx) : ORIGIN = _EXC_VECTOR, LENGTH = _RAM_SIZE - (_EXC_VECTOR - _RAM_ADDR)
|
SRAM (wx) : ORIGIN = _EXC_VECTOR, LENGTH = _RAM_SIZE - (_EXC_VECTOR - _RAM_ADDR)
|
||||||
|
/* Used by and documented in include/linker/intlist.ld */
|
||||||
|
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -69,6 +72,9 @@ MEMORY
|
||||||
{
|
{
|
||||||
RESET (wx) : ORIGIN = _RESET_VECTOR, LENGTH = 0x20
|
RESET (wx) : ORIGIN = _RESET_VECTOR, LENGTH = 0x20
|
||||||
SRAM (wx) : ORIGIN = _EXC_VECTOR, LENGTH = _RAM_SIZE - (_EXC_VECTOR - _RAM_ADDR)
|
SRAM (wx) : ORIGIN = _EXC_VECTOR, LENGTH = _RAM_SIZE - (_EXC_VECTOR - _RAM_ADDR)
|
||||||
|
|
||||||
|
/* Used by and documented in include/linker/intlist.ld */
|
||||||
|
IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -158,18 +164,9 @@ SECTIONS
|
||||||
|
|
||||||
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_GEN_SW_ISR_TABLE
|
||||||
KEEP(*(.isr_irq*))
|
KEEP(*(SW_ISR_TABLE))
|
||||||
|
#endif
|
||||||
/* sections for IRQ0-9 */
|
|
||||||
KEEP(*(SORT(.gnu.linkonce.isr_irq[0-9])))
|
|
||||||
|
|
||||||
/* sections for IRQ10-99 */
|
|
||||||
KEEP(*(SORT(.gnu.linkonce.isr_irq[0-9][0-9])))
|
|
||||||
|
|
||||||
/* sections for IRQ100-999 */
|
|
||||||
KEEP(*(SORT(.gnu.linkonce.isr_irq[0-9][0-9][0-9])))
|
|
||||||
|
|
||||||
*(.data)
|
*(.data)
|
||||||
*(".data.*")
|
*(".data.*")
|
||||||
|
|
||||||
|
@ -241,6 +238,10 @@ SECTIONS
|
||||||
#ifdef CONFIG_CUSTOM_SECTIONS_LD
|
#ifdef CONFIG_CUSTOM_SECTIONS_LD
|
||||||
/* Located in project source directory */
|
/* Located in project source directory */
|
||||||
#include <custom-sections.ld>
|
#include <custom-sections.ld>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_GEN_ISR_TABLES
|
||||||
|
#include <linker/intlist.ld>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue