From 39e51758c86754cef5ba4521c0c36578521f73d0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Jun 2013 14:00:38 +0200 Subject: smp: Add and use _CPU_SMP_Get_current_processor() Add and use _SMP_Get_current_processor() and rtems_smp_get_current_processor(). Delete bsp_smp_interrupt_cpu(). Change type of current processor index from int to uint32_t to match _SMP_Processor_count type. --- cpukit/score/cpu/powerpc/rtems/score/cpu.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cpukit/score/cpu/powerpc/rtems/score/cpu.h') diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index e3c40981b5..8362c64b3f 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -1000,6 +1000,21 @@ void _CPU_Context_validate( uintptr_t pattern ); #define _CPU_Context_switch_to_first_task_smp( _context ) \ _CPU_Context_restore( _context ) + RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t + _CPU_SMP_Get_current_processor( void ) + { + uint32_t pir; + + /* Use Book E Processor ID Register (PIR) */ + __asm__ volatile ( + "mfspr %[pir], 286" + : [pir] "=&r" (pir) + ); + + return pir; + } + + static inline void _CPU_Processor_event_broadcast( void ) { __asm__ volatile ( "" : : : "memory" ); -- cgit v1.2.3