summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-19 13:52:41 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-21 09:38:54 +0100
commit47d6013417c63115356042695e7125ecfcfe4696 (patch)
treee45e767e2d794cbd7ab5d0932aba9d38dfc22e87 /cpukit
parentscore: _Thread_Start_multitasking() (diff)
downloadrtems-47d6013417c63115356042695e7125ecfcfe4696.tar.bz2
score: _CPU_SMP_Get_current_processor()
Remove RTEMS_COMPILER_PURE_ATTRIBUTE from _SMP_Get_current_processor() and all _CPU_SMP_Get_current_processor(). Make inline ASM statements volatile again. Test smptests/smpmigration01 showed that GCC optimizes too much otherwise.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/cpu/arm/rtems/score/cpu.h5
-rw-r--r--cpukit/score/cpu/i386/rtems/score/cpu.h2
-rw-r--r--cpukit/score/cpu/no_cpu/rtems/score/cpu.h3
-rw-r--r--cpukit/score/cpu/powerpc/rtems/score/cpu.h5
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/cpu.h2
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/sparc.h2
-rw-r--r--cpukit/score/include/rtems/score/smp.h3
7 files changed, 9 insertions, 13 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index a58fa9e0c5..d0ed61f28b 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -469,13 +469,12 @@ void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
- RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
- _CPU_SMP_Get_current_processor( void )
+ static inline uint32_t _CPU_SMP_Get_current_processor( void )
{
uint32_t mpidr;
/* Use ARMv7 Multiprocessor Affinity Register (MPIDR) */
- __asm__ (
+ __asm__ volatile (
"mrc p15, 0, %[mpidr], c0, c0, 5\n"
: [mpidr] "=&r" (mpidr)
);
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
index 3c37006078..047ab69b77 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -464,7 +464,7 @@ uint32_t _CPU_ISR_Get_level( void );
#if defined(RTEMS_SMP)
uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
- RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void );
+ uint32_t _CPU_SMP_Get_current_processor( void );
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
index e250639aa3..5c34e17d03 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
@@ -1486,8 +1486,7 @@ CPU_Counter_ticks _CPU_Counter_difference(
* current processor in the system. The set of processor indices is the
* range of integers starting with zero up to the processor count minus one.
*/
- RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
- _CPU_SMP_Get_current_processor( void )
+ static inline uint32_t _CPU_SMP_Get_current_processor( void )
{
return 123;
}
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
index 5e9e5f9949..4e6fc74587 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
@@ -1036,13 +1036,12 @@ void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
- RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
- _CPU_SMP_Get_current_processor( void )
+ static inline uint32_t _CPU_SMP_Get_current_processor( void )
{
uint32_t pir;
/* Use Book E Processor ID Register (PIR) */
- __asm__ (
+ __asm__ volatile (
"mfspr %[pir], 286"
: [pir] "=&r" (pir)
);
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index 75b6542f52..ee6f7136e6 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -1163,7 +1163,7 @@ void _CPU_Context_restore(
#if defined(RTEMS_SMP)
uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
- RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void );
+ uint32_t _CPU_SMP_Get_current_processor( void );
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
diff --git a/cpukit/score/cpu/sparc/rtems/score/sparc.h b/cpukit/score/cpu/sparc/rtems/score/sparc.h
index 4539e7d6df..e52c27448d 100644
--- a/cpukit/score/cpu/sparc/rtems/score/sparc.h
+++ b/cpukit/score/cpu/sparc/rtems/score/sparc.h
@@ -298,7 +298,7 @@ static inline uint32_t _LEON3_Get_current_processor( void )
{
uint32_t asr17;
- __asm__ (
+ __asm__ volatile (
"rd %%asr17, %0"
: "=&r" (asr17)
);
diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h
index 521cd7b21e..fcf20366f7 100644
--- a/cpukit/score/include/rtems/score/smp.h
+++ b/cpukit/score/include/rtems/score/smp.h
@@ -46,8 +46,7 @@ extern "C" {
#endif
#if defined( RTEMS_SMP )
- RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
- _SMP_Get_current_processor( void )
+ static inline uint32_t _SMP_Get_current_processor( void )
{
return _CPU_SMP_Get_current_processor();
}