[rtems commit] score: Move internal structures to objectdata.h

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:40:47 UTC 2018


Module:    rtems
Branch:    master
Commit:    a6e7d5e492fd5e4c361d4d9aa13eb0eb951b386a
Changeset: http://git.rtems.org/rtems/commit/?id=a6e7d5e492fd5e4c361d4d9aa13eb0eb951b386a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Nov 12 09:00:36 2018 +0100

score: Move internal structures to objectdata.h

Update #3598.

---

 cpukit/headers.am                        |  1 +
 cpukit/include/rtems/extensiondata.h     |  2 +-
 cpukit/include/rtems/posix/mqueue.h      |  2 +-
 cpukit/include/rtems/posix/semaphore.h   |  2 +-
 cpukit/include/rtems/posix/shm.h         |  2 +-
 cpukit/include/rtems/posix/timer.h       |  2 +-
 cpukit/include/rtems/rtems/barrierdata.h |  2 +-
 cpukit/include/rtems/rtems/dpmemdata.h   |  2 +-
 cpukit/include/rtems/rtems/messagedata.h |  2 +-
 cpukit/include/rtems/rtems/partdata.h    |  2 +-
 cpukit/include/rtems/rtems/regiondata.h  |  2 +-
 cpukit/include/rtems/rtems/timerdata.h   |  2 +-
 cpukit/include/rtems/score/object.h      | 58 -------------------
 cpukit/include/rtems/score/objectdata.h  | 98 ++++++++++++++++++++++++++++++++
 cpukit/include/rtems/score/objectimpl.h  |  2 +-
 cpukit/include/rtems/score/thread.h      |  2 +-
 16 files changed, 112 insertions(+), 71 deletions(-)

diff --git a/cpukit/headers.am b/cpukit/headers.am
index fa51f8d..a318349 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -330,6 +330,7 @@ include_rtems_score_HEADERS += include/rtems/score/mrsp.h
 include_rtems_score_HEADERS += include/rtems/score/mrspimpl.h
 include_rtems_score_HEADERS += include/rtems/score/muteximpl.h
 include_rtems_score_HEADERS += include/rtems/score/object.h
+include_rtems_score_HEADERS += include/rtems/score/objectdata.h
 include_rtems_score_HEADERS += include/rtems/score/objectimpl.h
 include_rtems_score_HEADERS += include/rtems/score/objectmp.h
 include_rtems_score_HEADERS += include/rtems/score/onceimpl.h
diff --git a/cpukit/include/rtems/extensiondata.h b/cpukit/include/rtems/extensiondata.h
index ba32a2b..4c3be8a 100644
--- a/cpukit/include/rtems/extensiondata.h
+++ b/cpukit/include/rtems/extensiondata.h
@@ -19,7 +19,7 @@
 #define _RTEMS_EXTENSIONDATA_H
 
 #include <rtems/extension.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/posix/mqueue.h b/cpukit/include/rtems/posix/mqueue.h
index 6211c68..bec82ee 100644
--- a/cpukit/include/rtems/posix/mqueue.h
+++ b/cpukit/include/rtems/posix/mqueue.h
@@ -34,7 +34,7 @@
 #include <signal.h>
 #include <mqueue.h> /* struct mq_attr */
 #include <rtems/score/coremsg.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/posix/semaphore.h b/cpukit/include/rtems/posix/semaphore.h
index 734d8bb..16b6d71 100644
--- a/cpukit/include/rtems/posix/semaphore.h
+++ b/cpukit/include/rtems/posix/semaphore.h
@@ -20,7 +20,7 @@
 #define _RTEMS_POSIX_SEMAPHORE_H
 
 #include <semaphore.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/posix/shm.h b/cpukit/include/rtems/posix/shm.h
index 310af66..ae0416e 100644
--- a/cpukit/include/rtems/posix/shm.h
+++ b/cpukit/include/rtems/posix/shm.h
@@ -15,7 +15,7 @@
 #ifndef _RTEMS_POSIX_SHM_H
 #define _RTEMS_POSIX_SHM_H
 
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/threadq.h>
 
 #include <sys/types.h>
diff --git a/cpukit/include/rtems/posix/timer.h b/cpukit/include/rtems/posix/timer.h
index 52732af..2cbc56e 100644
--- a/cpukit/include/rtems/posix/timer.h
+++ b/cpukit/include/rtems/posix/timer.h
@@ -19,7 +19,7 @@
 #ifndef _RTEMS_POSIX_TIMER_H
 #define _RTEMS_POSIX_TIMER_H
 
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/watchdog.h>
 
 #include <pthread.h>
diff --git a/cpukit/include/rtems/rtems/barrierdata.h b/cpukit/include/rtems/rtems/barrierdata.h
index a19ed88..12b2eab 100644
--- a/cpukit/include/rtems/rtems/barrierdata.h
+++ b/cpukit/include/rtems/rtems/barrierdata.h
@@ -19,7 +19,7 @@
 #define _RTEMS_RTEMS_BARRIERDATA_H
 
 #include <rtems/rtems/barrier.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/corebarrier.h>
 
 #ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/dpmemdata.h b/cpukit/include/rtems/rtems/dpmemdata.h
index 293ad15..86302f9 100644
--- a/cpukit/include/rtems/rtems/dpmemdata.h
+++ b/cpukit/include/rtems/rtems/dpmemdata.h
@@ -18,7 +18,7 @@
 #define _RTEMS_RTEMS_DPMEMDATA_H
 
 #include <rtems/rtems/dpmem.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/rtems/messagedata.h b/cpukit/include/rtems/rtems/messagedata.h
index be09d8e..b035dff 100644
--- a/cpukit/include/rtems/rtems/messagedata.h
+++ b/cpukit/include/rtems/rtems/messagedata.h
@@ -18,8 +18,8 @@
 #define _RTEMS_RTEMS_MESSAGEDATA_H
 
 #include <rtems/rtems/message.h>
-#include <rtems/score/object.h>
 #include <rtems/score/coremsg.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/rtems/partdata.h b/cpukit/include/rtems/rtems/partdata.h
index 4423de0..3b030c8 100644
--- a/cpukit/include/rtems/rtems/partdata.h
+++ b/cpukit/include/rtems/rtems/partdata.h
@@ -19,7 +19,7 @@
 
 #include <rtems/rtems/part.h>
 #include <rtems/score/isrlock.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/rtems/regiondata.h b/cpukit/include/rtems/rtems/regiondata.h
index 75fc950..cfbc07f 100644
--- a/cpukit/include/rtems/rtems/regiondata.h
+++ b/cpukit/include/rtems/rtems/regiondata.h
@@ -19,7 +19,7 @@
 
 #include <rtems/rtems/region.h>
 #include <rtems/score/heap.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/threadq.h>
 
 #ifdef __cplusplus
diff --git a/cpukit/include/rtems/rtems/timerdata.h b/cpukit/include/rtems/rtems/timerdata.h
index a3a13b7..db32739 100644
--- a/cpukit/include/rtems/rtems/timerdata.h
+++ b/cpukit/include/rtems/rtems/timerdata.h
@@ -21,7 +21,7 @@
 #define _RTEMS_RTEMS_TIMERDATA_H
 
 #include <rtems/rtems/timer.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/watchdog.h>
 
 #ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/object.h b/cpukit/include/rtems/score/object.h
index adafcaa..9c2699d 100644
--- a/cpukit/include/rtems/score/object.h
+++ b/cpukit/include/rtems/score/object.h
@@ -22,8 +22,6 @@
 
 #include <rtems/score/basedefs.h>
 #include <rtems/score/cpu.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/rbtree.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -215,62 +213,6 @@ typedef enum {
 #define OBJECTS_APIS_LAST OBJECTS_POSIX_API
 
 /**
- *  The following defines the Object Control Block used to manage
- *  each object local to this node.
- */
-typedef struct {
-  /** This is the chain node portion of an object. */
-  Chain_Node     Node;
-  /** This is the object's ID. */
-  Objects_Id     id;
-  /** This is the object's name. */
-  Objects_Name   name;
-} Objects_Control;
-
-#if defined( RTEMS_MULTIPROCESSING )
-/**
- * @brief This defines the Global Object Control Block used to manage objects
- * resident on other nodes.
- */
-typedef struct {
-  /**
-   * @brief Nodes to manage active and inactive global objects.
-   */
-  union {
-    /**
-     * @brief Inactive global objects reside on a chain.
-     */
-    Chain_Node Inactive;
-
-    struct {
-      /**
-       * @brief Node to lookup an active global object by identifier.
-       */
-      RBTree_Node Id_lookup;
-
-      /**
-       * @brief Node to lookup an active global object by name.
-       */
-      RBTree_Node Name_lookup;
-    } Active;
-  } Nodes;
-
-  /**
-   * @brief The global object identifier.
-   */
-  Objects_Id id;
-
-  /**
-   * @brief The global object name.
-   *
-   * Using an unsigned thirty two bit value is broken but works.  If any API is
-   * MP with variable length names .. BOOM!!!!
-   */
-  uint32_t name;
-} Objects_MP_Control;
-#endif
-
-/**
  *  No object can have this ID.
  */
 #define OBJECTS_ID_NONE 0
diff --git a/cpukit/include/rtems/score/objectdata.h b/cpukit/include/rtems/score/objectdata.h
new file mode 100644
index 0000000..51258fa
--- /dev/null
+++ b/cpukit/include/rtems/score/objectdata.h
@@ -0,0 +1,98 @@
+/**
+ * @file
+ *
+ * @ingroup ScoreObject
+ *
+ * @brief Object Handler Data Structures
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2011.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_OBJECTDATA_H
+#define _RTEMS_SCORE_OBJECTDATA_H
+
+#include <rtems/score/object.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/rbtree.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup ScoreObject
+ *
+ * @{
+ */
+
+/**
+ *  The following defines the Object Control Block used to manage
+ *  each object local to this node.
+ */
+typedef struct {
+  /** This is the chain node portion of an object. */
+  Chain_Node     Node;
+  /** This is the object's ID. */
+  Objects_Id     id;
+  /** This is the object's name. */
+  Objects_Name   name;
+} Objects_Control;
+
+#if defined( RTEMS_MULTIPROCESSING )
+/**
+ * @brief This defines the Global Object Control Block used to manage objects
+ * resident on other nodes.
+ */
+typedef struct {
+  /**
+   * @brief Nodes to manage active and inactive global objects.
+   */
+  union {
+    /**
+     * @brief Inactive global objects reside on a chain.
+     */
+    Chain_Node Inactive;
+
+    struct {
+      /**
+       * @brief Node to lookup an active global object by identifier.
+       */
+      RBTree_Node Id_lookup;
+
+      /**
+       * @brief Node to lookup an active global object by name.
+       */
+      RBTree_Node Name_lookup;
+    } Active;
+  } Nodes;
+
+  /**
+   * @brief The global object identifier.
+   */
+  Objects_Id id;
+
+  /**
+   * @brief The global object name.
+   *
+   * Using an unsigned thirty two bit value is broken but works.  If any API is
+   * MP with variable length names .. BOOM!!!!
+   */
+  uint32_t name;
+} Objects_MP_Control;
+#endif
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h
index bf4d45d..8934e24 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -19,7 +19,7 @@
 #ifndef _RTEMS_SCORE_OBJECTIMPL_H
 #define _RTEMS_SCORE_OBJECTIMPL_H
 
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/apimutex.h>
 #include <rtems/score/isrlock.h>
 #include <rtems/score/threaddispatch.h>
diff --git a/cpukit/include/rtems/score/thread.h b/cpukit/include/rtems/score/thread.h
index c665fcc..7e24af4 100644
--- a/cpukit/include/rtems/score/thread.h
+++ b/cpukit/include/rtems/score/thread.h
@@ -27,7 +27,7 @@
 #include <rtems/score/mppkt.h>
 #endif
 #include <rtems/score/isrlock.h>
-#include <rtems/score/object.h>
+#include <rtems/score/objectdata.h>
 #include <rtems/score/priority.h>
 #include <rtems/score/schedulernode.h>
 #include <rtems/score/stack.h>



More information about the vc mailing list