diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-26 15:09:10 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-29 09:51:22 +0200 |
commit | 03b7789ec7d0ffd3621ea4c20d564d2a93e182a5 (patch) | |
tree | 660264446f43759a40ae5ab1d8d01eaaee7485b2 /cpukit/score | |
parent | bsps/mips: Delete unused files (diff) | |
download | rtems-03b7789ec7d0ffd3621ea4c20d564d2a93e182a5.tar.bz2 |
score: Statically initialize _ISR_Vector_table
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/cpu/arm/rtems/score/cpu.h | 4 | ||||
-rw-r--r-- | cpukit/score/cpu/bfin/cpu_asm.S | 5 | ||||
-rw-r--r-- | cpukit/score/cpu/h8300/cpu_asm.S | 4 | ||||
-rw-r--r-- | cpukit/score/cpu/i386/rtems/score/cpu.h | 7 | ||||
-rw-r--r-- | cpukit/score/cpu/m68k/cpu_asm.S | 9 | ||||
-rw-r--r-- | cpukit/score/cpu/mips/cpu_asm.S | 1 | ||||
-rw-r--r-- | cpukit/score/cpu/mips/rtems/score/cpu.h | 9 | ||||
-rw-r--r-- | cpukit/score/cpu/nios2/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/cpu/nios2/nios2-initialize-vectors.c | 25 | ||||
-rw-r--r-- | cpukit/score/cpu/nios2/rtems/score/cpu.h | 2 | ||||
-rw-r--r-- | cpukit/score/cpu/no_cpu/rtems/score/cpu.h | 17 | ||||
-rw-r--r-- | cpukit/score/cpu/powerpc/rtems/score/cpu.h | 10 | ||||
-rw-r--r-- | cpukit/score/cpu/v850/rtems/score/cpu.h | 19 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/isr.h | 14 | ||||
-rw-r--r-- | cpukit/score/src/isr.c | 12 |
15 files changed, 26 insertions, 113 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h index ccf8c9a834..cb9dc7c409 100644 --- a/cpukit/score/cpu/arm/rtems/score/cpu.h +++ b/cpukit/score/cpu/arm/rtems/score/cpu.h @@ -171,10 +171,6 @@ #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 -#define CPU_INTERRUPT_NUMBER_OF_VECTORS 8 - -#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1) - #define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE #define CPU_STACK_MINIMUM_SIZE (1024 * 4) diff --git a/cpukit/score/cpu/bfin/cpu_asm.S b/cpukit/score/cpu/bfin/cpu_asm.S index d594f9223f..015caef448 100644 --- a/cpukit/score/cpu/bfin/cpu_asm.S +++ b/cpukit/score/cpu/bfin/cpu_asm.S @@ -359,9 +359,8 @@ vectorIDLoop: if !cc jump vectorIDLoop; [--sp] = r2; - p0.h = SYM(_ISR_Vector_table); - p0.l = SYM(_ISR_Vector_table); - r2 = [p0]; + r2.h = SYM(_ISR_Vector_table); + r2.l = SYM(_ISR_Vector_table); r1 = r0 << 2; r1 = r1 + r2; p0 = r1; diff --git a/cpukit/score/cpu/h8300/cpu_asm.S b/cpukit/score/cpu/h8300/cpu_asm.S index 0dc79a952b..9e89a83420 100644 --- a/cpukit/score/cpu/h8300/cpu_asm.S +++ b/cpukit/score/cpu/h8300/cpu_asm.S @@ -133,12 +133,10 @@ nested: /* Vector to ISR */ - mov.l @SYM(_ISR_Vector_table),er1 mov er0,er2 ; copy vector shll.l er2 shll.l er2 ; vector = vector * 4 (sizeof(int)) - add.l er2,er1 - mov.l @er1,er1 + mov.l @(SYM(_ISR_Vector_table), er2),er1 jsr @er1 ; er0 = arg1 =vector orc #0xc0,ccr diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index be22d9e217..a9957cbe62 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -316,13 +316,6 @@ SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context; #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024 /* - * i386 family supports 256 distinct vectors. - */ - -#define CPU_INTERRUPT_NUMBER_OF_VECTORS 256 -#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1) - -/* * This is defined if the port has a special way to report the ISR nesting * level. Most ports maintain the variable _ISR_Nest_level. */ diff --git a/cpukit/score/cpu/m68k/cpu_asm.S b/cpukit/score/cpu/m68k/cpu_asm.S index 4db6723db7..a31c1588a4 100644 --- a/cpukit/score/cpu/m68k/cpu_asm.S +++ b/cpukit/score/cpu/m68k/cpu_asm.S @@ -276,13 +276,8 @@ SYM (_ISR_Handler): addql #1,ISR_NEST_LEVEL | one nest level deeper - movel SYM (_ISR_Vector_table),a0 | a0= base of RTEMS table -#if ( M68K_HAS_PREINDEXING == 1 ) - movel (a0,d0:w:1),a0 | a0 = address of user routine -#else - addal d0,a0 | a0 = address of vector - movel (a0),a0 | a0 = address of user routine -#endif + lea SYM(_ISR_Vector_table),a0 + movel (a0,d0),a0 | a0 = address of user routine lsrl #2,d0 | d0 = vector number movel d0,a7@- | push vector number diff --git a/cpukit/score/cpu/mips/cpu_asm.S b/cpukit/score/cpu/mips/cpu_asm.S index 3450451ada..c58aee1e50 100644 --- a/cpukit/score/cpu/mips/cpu_asm.S +++ b/cpukit/score/cpu/mips/cpu_asm.S @@ -583,7 +583,6 @@ FRAME(_CPU_Context_restore,sp,0,ra) ENDFRAME(_CPU_Context_restore) .extern _Thread_Dispatch -.extern _ISR_Vector_table /* void _DBG_Handler() * diff --git a/cpukit/score/cpu/mips/rtems/score/cpu.h b/cpukit/score/cpu/mips/rtems/score/cpu.h index b8719697c5..392a995917 100644 --- a/cpukit/score/cpu/mips/rtems/score/cpu.h +++ b/cpukit/score/cpu/mips/rtems/score/cpu.h @@ -660,15 +660,6 @@ SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context; #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 /* - * This defines the number of entries in the ISR_Vector_table managed - * by RTEMS. - */ - -extern unsigned int mips_interrupt_number_of_vectors; -#define CPU_INTERRUPT_NUMBER_OF_VECTORS (mips_interrupt_number_of_vectors) -#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1) - -/* * Should be large enough to run all RTEMS tests. This ensures * that a "reasonable" small application should not have any problems. */ diff --git a/cpukit/score/cpu/nios2/Makefile.am b/cpukit/score/cpu/nios2/Makefile.am index 62286cd754..6004467228 100644 --- a/cpukit/score/cpu/nios2/Makefile.am +++ b/cpukit/score/cpu/nios2/Makefile.am @@ -33,7 +33,6 @@ libscorecpu_a_SOURCES += nios2-fatal-halt.c libscorecpu_a_SOURCES += nios2-iic-low-level.S libscorecpu_a_SOURCES += nios2-iic-irq.c libscorecpu_a_SOURCES += nios2-initialize.c -libscorecpu_a_SOURCES += nios2-initialize-vectors.c libscorecpu_a_SOURCES += nios2-isr-get-level.c libscorecpu_a_SOURCES += nios2-isr-install-raw-handler.c libscorecpu_a_SOURCES += nios2-isr-install-vector.c diff --git a/cpukit/score/cpu/nios2/nios2-initialize-vectors.c b/cpukit/score/cpu/nios2/nios2-initialize-vectors.c deleted file mode 100644 index da1ee4be1c..0000000000 --- a/cpukit/score/cpu/nios2/nios2-initialize-vectors.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2011 embedded brains GmbH - * - * Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de) - * - * COPYRIGHT (c) 1989-2006 - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#ifdef HAVE_CONFIG_H - #include "config.h" -#endif - -#include <rtems/score/isr.h> - -#include <string.h> - -void _CPU_Initialize_vectors( void ) -{ - memset(_ISR_Vector_table, 0, sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS); -} diff --git a/cpukit/score/cpu/nios2/rtems/score/cpu.h b/cpukit/score/cpu/nios2/rtems/score/cpu.h index 6c62a1f8d5..fcfef8d461 100644 --- a/cpukit/score/cpu/nios2/rtems/score/cpu.h +++ b/cpukit/score/cpu/nios2/rtems/score/cpu.h @@ -192,7 +192,7 @@ typedef struct { uint32_t ipending; } CPU_Exception_frame; -void _CPU_Initialize_vectors( void ); +#define _CPU_Initialize_vectors() /** * @brief Macro to disable interrupts. diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h index 959fb58a6d..fbf207ad80 100644 --- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h +++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h @@ -686,19 +686,24 @@ SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context; /** * @ingroup CPUInterrupt * - * This defines the number of entries in the @ref _ISR_Vector_table managed - * by RTEMS. + * This defines the number of entries in the _ISR_Vector_table managed by RTEMS + * in case CPU_SIMPLE_VECTORED_INTERRUPTS is defined to TRUE. It must be a + * compile-time constant. * - * Port Specific Information: - * - * XXX document implementation including references if appropriate + * It must be undefined in case CPU_SIMPLE_VECTORED_INTERRUPTS is defined to + * FALSE. */ #define CPU_INTERRUPT_NUMBER_OF_VECTORS 32 /** * @ingroup CPUInterrupt * - * This defines the highest interrupt vector number for this port. + * This defines the highest interrupt vector number for this port in case + * CPU_SIMPLE_VECTORED_INTERRUPTS is defined to TRUE. It must be less than + * CPU_INTERRUPT_NUMBER_OF_VECTORS. It may be not a compile-time constant. + * + * It must be undefined in case CPU_SIMPLE_VECTORED_INTERRUPTS is defined to + * FALSE. */ #define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1) diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index 3130b3535e..3a51b3112b 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -599,16 +599,6 @@ SCORE_EXTERN struct { #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 /* - * This defines the number of entries in the ISR_Vector_table managed - * by RTEMS. - * - * NOTE: CPU_INTERRUPT_NUMBER_OF_VECTORS and - * CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER are only used on - * Simple Vectored Architectures and thus are not defined - * for this architecture. - */ - -/* * This is defined if the port has a special way to report the ISR nesting * level. Most ports maintain the variable _ISR_Nest_level. Note that * this is not an option - RTEMS/score _relies_ on _ISR_Nest_level diff --git a/cpukit/score/cpu/v850/rtems/score/cpu.h b/cpukit/score/cpu/v850/rtems/score/cpu.h index 35ed6e6e31..7234d67a96 100644 --- a/cpukit/score/cpu/v850/rtems/score/cpu.h +++ b/cpukit/score/cpu/v850/rtems/score/cpu.h @@ -549,25 +549,6 @@ typedef struct { */ #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 -/* XXX this should not be needed on PIC architectures */ -/* XXX evaluate removing it */ -#if 0 -/** - * This defines the number of entries in the @ref _ISR_Vector_table managed - * by RTEMS. - * - * Port Specific Information: - * - * XXX document implementation including references if appropriate - */ -#define CPU_INTERRUPT_NUMBER_OF_VECTORS 32 -#endif - -/** - * This defines the highest interrupt vector number for this port. - */ -#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1) - /** * This is defined if the port has a special way to report the ISR nesting * level. Most ports maintain the variable @a _ISR_Nest_level. diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h index f1ac5ae32f..dcb25e1dff 100644 --- a/cpukit/score/include/rtems/score/isr.h +++ b/cpukit/score/include/rtems/score/isr.h @@ -71,22 +71,10 @@ typedef ISR_Handler ( *ISR_Handler_entry )( #endif /** - * This constant promotes out the number of vectors truly supported by - * the current CPU being used. This is usually the number of distinct vectors - * the cpu can vector. - */ -#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS - -/** - * This constant promotes out the highest valid interrupt vector number. - */ -#define ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER - -/** * The following declares the Vector Table. Application * interrupt service routines are vectored by the ISR Handler via this table. */ -SCORE_EXTERN ISR_Handler_entry *_ISR_Vector_table; +extern ISR_Handler_entry _ISR_Vector_table[ CPU_INTERRUPT_NUMBER_OF_VECTORS ]; #endif /** diff --git a/cpukit/score/src/isr.c b/cpukit/score/src/isr.c index 07f3e61f5a..1ae6e5900d 100644 --- a/cpukit/score/src/isr.c +++ b/cpukit/score/src/isr.c @@ -26,15 +26,19 @@ #include <rtems/score/wkspace.h> #include <rtems/config.h> +#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) + ISR_Handler_entry _ISR_Vector_table[ CPU_INTERRUPT_NUMBER_OF_VECTORS ]; +#elif defined(CPU_INTERRUPT_NUMBER_OF_VECTORS) + #error "CPU_INTERRUPT_NUMBER_OF_VECTORS is defined for non-simple vectored interrupts" +#elif defined(CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER) + #error "CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER is defined for non-simple vectored interrupts" +#endif + void _ISR_Handler_initialization( void ) { _ISR_Nest_level = 0; #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) - _ISR_Vector_table = _Workspace_Allocate_or_fatal_error( - sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS - ); - _CPU_Initialize_vectors(); #endif |