[PATCH 1/8] score: Rename struct Thread_Control

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 23 12:54:41 UTC 2015


Add a leading underscore to the structure name to allow forward
declarations in standard header files provided by Newlib and GCC.
---
 cpukit/score/include/rtems/score/percpu.h  | 10 +++++-----
 cpukit/score/include/rtems/score/thread.h  |  5 ++++-
 cpukit/score/include/rtems/score/threadq.h |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 9ce68ef..f1dad90 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -51,7 +51,7 @@ extern "C" {
 
 #if !defined( ASM )
 
-struct Thread_Control;
+struct _Thread_Control;
 
 struct Scheduler_Context;
 
@@ -273,7 +273,7 @@ typedef struct Per_CPU_Control {
    * configurations use _Thread_Is_executing_on_a_processor() to figure out if
    * a thread context is executing on a processor.
    */
-  struct Thread_Control *executing;
+  struct _Thread_Control *executing;
 
   /**
    * @brief This is the heir thread for this processor.
@@ -287,7 +287,7 @@ typedef struct Per_CPU_Control {
    *
    * @see _Thread_Get_heir_and_make_it_executing().
    */
-  struct Thread_Control *heir;
+  struct _Thread_Control *heir;
 
   /**
    * @brief This is set to true when this processor needs to run the
@@ -609,9 +609,9 @@ bool _Per_CPU_State_wait_for_non_initial_state(
  *
  * @return The thread control block of the executing thread.
  */
-RTEMS_INLINE_ROUTINE struct Thread_Control *_Thread_Get_executing( void )
+RTEMS_INLINE_ROUTINE struct _Thread_Control *_Thread_Get_executing( void )
 {
-  struct Thread_Control *executing;
+  struct _Thread_Control *executing;
 
   #if defined( RTEMS_SMP )
     ISR_Level level;
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 2f0b35e..157acfa 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -669,8 +669,11 @@ typedef struct {
 
 /**
  *  This structure defines the Thread Control Block (TCB).
+ *
+ *  Uses a leading underscore in the structure name to allow forward
+ *  declarations in standard header files provided by Newlib and GCC.
  */
-struct Thread_Control {
+struct _Thread_Control {
   /** This field is the object management structure for each thread. */
   Objects_Control          Object;
   /** This field is the current execution state of this thread. */
diff --git a/cpukit/score/include/rtems/score/threadq.h b/cpukit/score/include/rtems/score/threadq.h
index e3aee58..70b5ad6 100644
--- a/cpukit/score/include/rtems/score/threadq.h
+++ b/cpukit/score/include/rtems/score/threadq.h
@@ -39,7 +39,7 @@ extern "C" {
  */
 /**@{*/
 
-typedef struct Thread_Control Thread_Control;
+typedef struct _Thread_Control Thread_Control;
 
 typedef struct {
   /** This union contains the data structures used to manage the blocked
-- 
1.8.4.5




More information about the devel mailing list