[PATCH 1/2] score: Move _CPU_Get_current_per_CPU_control()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Nov 9 14:27:49 UTC 2016


Move _CPU_Get_current_per_CPU_control() from <rtems/score/cpu.h> to
<rtems/score/cpuimpl.h>.
---
 cpukit/score/cpu/no_cpu/rtems/score/cpu.h     | 18 ------------------
 cpukit/score/cpu/no_cpu/rtems/score/cpuimpl.h | 20 +++++++++++++++++++-
 cpukit/score/cpu/sparc/rtems/score/cpu.h      |  8 --------
 cpukit/score/cpu/sparc/rtems/score/cpuimpl.h  | 10 +++++++++-
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
index a2ae652..7bacd27 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
@@ -1419,24 +1419,6 @@ CPU_Counter_ticks _CPU_Counter_difference(
   CPU_Counter_ticks first
 );
 
-/**
- * @brief Special register pointing to the per-CPU control of the current
- * processor.
- *
- * This is optional.  Not every CPU port needs this.  It is only an optional
- * optimization variant.
- */
-register struct Per_CPU_Control *_CPU_Per_CPU_current asm( "rX" );
-
-/**
- * @brief Optional method to obtain the per-CPU control of the current processor.
- *
- * This is optional.  Not every CPU port needs this.  It is only an optional
- * optimization variant.  In case this macro is undefined, the default
- * implementation using the current processor index will be used.
- */
-#define _CPU_Get_current_per_CPU_control() ( _CPU_Per_CPU_current )
-
 #ifdef RTEMS_SMP
   /**
    * @brief Performs CPU specific SMP initialization in the context of the boot
diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpuimpl.h b/cpukit/score/cpu/no_cpu/rtems/score/cpuimpl.h
index 457ce4c..f1b0343 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/cpuimpl.h
@@ -5,7 +5,7 @@
  */
 
 /*
- * Copyright (c) 2016 embedded brains GmbH.
+ * Copyright (c) 2015, 2016 embedded brains GmbH
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -24,6 +24,24 @@ extern "C" {
 #endif
 
 /**
+ * @brief Special register pointing to the per-CPU control of the current
+ * processor.
+ *
+ * This is optional.  Not every CPU port needs this.  It is only an optional
+ * optimization variant.
+ */
+register struct Per_CPU_Control *_CPU_Per_CPU_current asm( "rX" );
+
+/**
+ * @brief Optional method to obtain the per-CPU control of the current processor.
+ *
+ * This is optional.  Not every CPU port needs this.  It is only an optional
+ * optimization variant.  In case this macro is undefined, the default
+ * implementation using the current processor index will be used.
+ */
+#define _CPU_Get_current_per_CPU_control() ( _CPU_Per_CPU_current )
+
+/**
  * @brief Optional method to get the executing thread.
  *
  * This is optional.  Not every CPU port needs this.  It is only an optional
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index 5823544..a97d330 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -1185,14 +1185,6 @@ void _CPU_Context_restore(
   Context_Control *new_context
 ) RTEMS_NO_RETURN;
 
-/**
- * @brief The pointer to the current per-CPU control is available via register
- * g6.
- */
-register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__( "g6" );
-
-#define _CPU_Get_current_per_CPU_control() _SPARC_Per_CPU_current
-
 #if defined(RTEMS_SMP)
   uint32_t _CPU_SMP_Initialize( void );
 
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h b/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
index 5373db1..bb53bf9 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpuimpl.h
@@ -5,7 +5,7 @@
  */
 
 /*
- * Copyright (c) 2016 embedded brains GmbH.
+ * Copyright (c) 2015, 2016 embedded brains GmbH
  *
  * The license and distribution terms for this file may be
  * found in the file LICENSE in this distribution or at
@@ -23,6 +23,14 @@
 extern "C" {
 #endif
 
+/**
+ * @brief The pointer to the current per-CPU control is available via register
+ * g6.
+ */
+register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__( "g6" );
+
+#define _CPU_Get_current_per_CPU_control() _SPARC_Per_CPU_current
+
 #define _CPU_Get_thread_executing() ( _SPARC_Per_CPU_current->executing )
 
 #ifdef __cplusplus
-- 
1.8.4.5



More information about the devel mailing list