diff options
Diffstat (limited to 'bsps/sparc/leon3')
-rw-r--r-- | bsps/sparc/leon3/include/bsp.h | 2 | ||||
-rw-r--r-- | bsps/sparc/leon3/include/tm27.h | 24 | ||||
-rw-r--r-- | bsps/sparc/leon3/mpci/mpisr.c | 9 | ||||
-rw-r--r-- | bsps/sparc/leon3/start/bspsmp.c | 18 |
4 files changed, 41 insertions, 12 deletions
diff --git a/bsps/sparc/leon3/include/bsp.h b/bsps/sparc/leon3/include/bsp.h index 6a96b91bf6..82f1f9f8ac 100644 --- a/bsps/sparc/leon3/include/bsp.h +++ b/bsps/sparc/leon3/include/bsp.h @@ -52,6 +52,8 @@ extern "C" { /* SPARC CPU variant: LEON3 */ #define LEON3 1 +#define BSP_FEATURE_IRQ_EXTENSION + /* * BSP provides its own Idle thread body */ diff --git a/bsps/sparc/leon3/include/tm27.h b/bsps/sparc/leon3/include/tm27.h index 00921d4880..7b73bc4dbd 100644 --- a/bsps/sparc/leon3/include/tm27.h +++ b/bsps/sparc/leon3/include/tm27.h @@ -57,14 +57,28 @@ #else /* use a regular asynchronous trap */ #define TEST_INTERRUPT_SOURCE LEON_INTERRUPT_EXTERNAL_1 -#define TEST_VECTOR LEON_TRAP_TYPE( TEST_INTERRUPT_SOURCE ) #define TEST_INTERRUPT_SOURCE2 LEON_INTERRUPT_EXTERNAL_1+1 -#define TEST_VECTOR2 LEON_TRAP_TYPE( TEST_INTERRUPT_SOURCE2 ) #define MUST_WAIT_FOR_INTERRUPT 1 -#define Install_tm27_vector( handler ) \ - set_vector( (handler), TEST_VECTOR, 1 ); \ - set_vector( (handler), TEST_VECTOR2, 1 ); +static inline void Install_tm27_vector( + void ( *handler )( rtems_vector_number ) +) +{ + (void) rtems_interrupt_handler_install( + TEST_INTERRUPT_SOURCE, + "tm27 low", + RTEMS_INTERRUPT_SHARED, + (rtems_interrupt_handler) handler, + NULL + ); + (void) rtems_interrupt_handler_install( + TEST_INTERRUPT_SOURCE2, + "tm27 high", + RTEMS_INTERRUPT_SHARED, + (rtems_interrupt_handler) handler, + NULL + ); +} #define Cause_tm27_intr() \ do { \ diff --git a/bsps/sparc/leon3/mpci/mpisr.c b/bsps/sparc/leon3/mpci/mpisr.c index cdf05293f1..d97b24a87c 100644 --- a/bsps/sparc/leon3/mpci/mpisr.c +++ b/bsps/sparc/leon3/mpci/mpisr.c @@ -45,6 +45,11 @@ void Shm_setvec( void ) * Interrupt driven mode is not currently supported. * This is thought to be the interrupt to use. */ - LEON_Unmask_interrupt(LEON3_mp_irq); - set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_mp_irq), 1); + (void) rtems_interrupt_handler_install( + LEON3_mp_irq, + "MPCI", + RTEMS_INTERRUPT_SHARED, + (rtems_interrupt_handler) Shm_isr, + NULL + ); } diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c index ba41a1fca1..c73c3fd5d0 100644 --- a/bsps/sparc/leon3/start/bspsmp.c +++ b/bsps/sparc/leon3/start/bspsmp.c @@ -18,6 +18,7 @@ #include <bsp/fatal.h> #include <leon.h> #include <rtems/bspIo.h> +#include <rtems/score/assert.h> #include <rtems/score/smpimpl.h> #include <stdlib.h> @@ -28,10 +29,9 @@ uint32_t _CPU_SMP_Get_current_processor( void ) } #endif -static rtems_isr bsp_inter_processor_interrupt( - rtems_vector_number vector -) +static void bsp_inter_processor_interrupt( void *arg ) { + (void) arg; _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get()); } @@ -57,11 +57,19 @@ void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self) uint32_t _CPU_SMP_Initialize( void ) { + rtems_status_code sc; + if ( !leon3_data_cache_snooping_enabled() ) bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR ); - LEON_Unmask_interrupt(LEON3_mp_irq); - set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1); + sc = rtems_interrupt_handler_install( + LEON3_mp_irq, + "IPI", + RTEMS_INTERRUPT_SHARED, + bsp_inter_processor_interrupt, + NULL + ); + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL ); return leon3_get_cpu_count(LEON3_IrqCtrl_Regs); } |