summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/object.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-04 09:42:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 09:08:22 +0200
commit84f5c0a91be7b1ce9c4f1fb1f7afba680d5451aa (patch)
tree0a348e454beddcdbfeb88e19f523c82fa4c43d00 /cpukit/score/include/rtems/score/object.h
parentscore: Use red-black tree for active MP proxies (diff)
downloadrtems-84f5c0a91be7b1ce9c4f1fb1f7afba680d5451aa.tar.bz2
score: Use red-black tree for active global objects
Use a red-black tree to lookup active global objects by identifier or name. Update #2555.
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/object.h46
1 files changed, 37 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index 70e5fe630c..c2acb2dbaa 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -23,6 +23,7 @@
#include <rtems/score/basedefs.h>
#include <rtems/score/cpu.h>
#include <rtems/score/chain.h>
+#include <rtems/score/rbtree.h>
#ifdef __cplusplus
extern "C" {
@@ -240,18 +241,45 @@ typedef struct {
#if defined( RTEMS_MULTIPROCESSING )
/**
- * This defines the Global Object Control Block used to manage
- * objects resident on other nodes. It is derived from Object.
+ * @brief This defines the Global Object Control Block used to manage objects
+ * resident on other nodes.
*/
typedef struct {
- /** This is an object control structure. */
- Objects_Control Object;
- /** This is the name of the object. Using an unsigned thirty two
- * bit value is broken but works. If any API is MP with variable
- * length names .. BOOM!!!!
+ /**
+ * @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;
+ uint32_t name;
+} Objects_MP_Control;
#endif
/**