From ca63ae2ec0b7831d533497078c0982ba758eec81 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 13 Jun 2013 15:41:21 +0200 Subject: smp: Add and use _CPU_SMP_Send_interrupt() Delete bsp_smp_interrupt_cpu(). --- cpukit/score/cpu/arm/rtems/score/cpu.h | 2 ++ cpukit/score/cpu/i386/rtems/score/cpu.h | 2 ++ cpukit/score/cpu/no_cpu/rtems/score/cpu.h | 10 ++++++++++ cpukit/score/cpu/powerpc/rtems/score/cpu.h | 1 + cpukit/score/cpu/sparc/rtems/score/cpu.h | 2 ++ cpukit/score/include/rtems/bspsmp.h | 12 ------------ cpukit/score/src/smp.c | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h index ed1b605d09..519d486b12 100644 --- a/cpukit/score/cpu/arm/rtems/score/cpu.h +++ b/cpukit/score/cpu/arm/rtems/score/cpu.h @@ -457,6 +457,8 @@ void _CPU_Context_validate( uintptr_t pattern ); return mpidr & 0xffU; } + void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ); + static inline void _ARM_Data_memory_barrier( void ) { __asm__ volatile ( "dmb" : : : "memory" ); diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index b00ae3bfd8..092ba995d3 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -457,6 +457,8 @@ uint32_t _CPU_ISR_Get_level( void ); RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void ); + void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ); + static inline void _CPU_Processor_event_broadcast( void ) { __asm__ volatile ( "" : : : "memory" ); diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h index d368e51c5f..dc48d2bbc8 100644 --- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h +++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h @@ -1416,6 +1416,16 @@ static inline uint32_t CPU_swap_u32( return 123; } + /** + * @brief Sends an inter-processor interrupt to the specified target + * processor. + * + * This operation is undefined for target processor indices out of range. + * + * @param[in] target_processor_index The target processor index. + */ + void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ); + /** * @brief Broadcasts a processor event. * diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index 8362c64b3f..17f2d39ce0 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -1014,6 +1014,7 @@ void _CPU_Context_validate( uintptr_t pattern ); return pir; } + void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ); static inline void _CPU_Processor_event_broadcast( void ) { diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h index e4eb65e88a..8ba7a41044 100644 --- a/cpukit/score/cpu/sparc/rtems/score/cpu.h +++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h @@ -1188,6 +1188,8 @@ void _CPU_Context_restore( RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void ); + void _CPU_SMP_Send_interrupt( uint32_t target_processor_index ); + static inline void _CPU_Processor_event_broadcast( void ) { __asm__ volatile ( "" : : : "memory" ); diff --git a/cpukit/score/include/rtems/bspsmp.h b/cpukit/score/include/rtems/bspsmp.h index 57f5a7a458..ec8be9f085 100644 --- a/cpukit/score/include/rtems/bspsmp.h +++ b/cpukit/score/include/rtems/bspsmp.h @@ -83,18 +83,6 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count ); */ void bsp_smp_broadcast_interrupt(void); -/** - * @brief Generate a interprocessor interrupt. - * - * This method is invoked by RTEMS to let @a cpu know that it - * has sent it a message. - * - * @param [in] cpu is the recipient CPU - */ -void bsp_smp_interrupt_cpu( - int cpu -); - /** * @brief Performs high-level initialization of a secondary processor and runs * the application threads. diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 8e06d04068..4d2a1b52f8 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -121,7 +121,7 @@ void _SMP_Send_message( uint32_t cpu, uint32_t message ) per_cpu->message |= message; _Per_CPU_Lock_release( per_cpu, level ); - bsp_smp_interrupt_cpu( cpu ); + _CPU_SMP_Send_interrupt( cpu ); } void _SMP_Broadcast_message( uint32_t message ) -- cgit v1.2.3