summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-17 19:51:51 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-17 19:51:51 +0000
commitb06e68ef1f6df69cc86d72356c3a002054a35fad (patch)
tree722b2da3cc83f1cf03019cab8cf895a509eb6801 /cpukit/score
parent3b438fa4b0284d340b60d865f4afcb76f363bc90 (diff)
downloadrtems-b06e68ef1f6df69cc86d72356c3a002054a35fad.tar.bz2
Numerous miscellaneous features incorporated from Tony Bennett
(tbennett@divnc.com) including the following major additions: + variable length messages + named devices + debug monitor + association tables/variables
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/object.h28
-rw-r--r--cpukit/score/include/rtems/score/thread.h1
-rw-r--r--cpukit/score/include/rtems/system.h7
-rw-r--r--cpukit/score/src/object.c67
4 files changed, 101 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index 50eede9fd7..0553fe901d 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -100,6 +100,18 @@ EXTERN unsigned32 _Objects_Local_node;
#define RTEMS_WHO_AM_I 0
/*
+ * Parameters and return id's for _Objects_Get_next
+ */
+
+#define RTEMS_OBJECT_ID_INITIAL_INDEX (0)
+#define RTEMS_OBJECT_ID_FINAL_INDEX (0xffff)
+
+#define RTEMS_OBJECT_ID_INITIAL(node) (_Objects_Build_id( \
+ node, \
+ RTEMS_OBJECT_ID_INITIAL_INDEX))
+#define RTEMS_OBJECT_ID_FINAL ((Objects_Id) ~0)
+
+/*
* _Objects_Handler_initialization
*
* DESCRIPTION:
@@ -179,6 +191,22 @@ Objects_Control *_Objects_Get (
);
/*
+ * _Objects_Get_next
+ *
+ * DESCRIPTION:
+ *
+ * Like _Objects_Get, but is used to find "next" open object.
+ *
+ */
+
+Objects_Control *_Objects_Get_next(
+ Objects_Information *information,
+ Objects_Id id,
+ unsigned32 *location_p,
+ Objects_Id *next_id_p
+);
+
+/*
* _Objects_Is_name_valid
*
* DESCRIPTION:
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 4a417828a3..953e19ba95 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -115,6 +115,7 @@ typedef struct {
union {
unsigned32 segment_size; /* size of segment requested */
rtems_event_set event_condition;
+ unsigned32 *message_size_p; /* ptr for return size of message */
} Extra;
void *return_argument; /* address of user return param */
rtems_status_code return_code; /* status for thread awakened */
diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h
index 3ff3772d11..96b0abfff8 100644
--- a/cpukit/score/include/rtems/system.h
+++ b/cpukit/score/include/rtems/system.h
@@ -78,6 +78,7 @@ typedef void * proc_ptr;
#include <rtems/cpu.h> /* processor specific information */
#include <rtems/status.h> /* RTEMS status codes */
+#include <rtems/directives.h>
/*
* Define NULL
@@ -103,6 +104,9 @@ typedef void * proc_ptr;
#define stringify( _x ) # _x
+#define RTEMS_offsetof(type, field) \
+ ((unsigned32) &(((type *) 0)->field))
+
/*
* The following is the extern for the RTEMS version string.
* The contents of this string are CPU specific.
@@ -115,8 +119,7 @@ extern const char _Copyright_Notice[]; /* RTEMS copyright string */
* The jump table of entry points into RTEMS directives.
*/
-#define NUMBER_OF_ENTRY_POINTS 79
-extern const void * _Entry_points[ NUMBER_OF_ENTRY_POINTS + 1 ];
+extern const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
/*
* The following defines the CPU dependent information table.
diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c
index 71c365fa1e..29450d4171 100644
--- a/cpukit/score/src/object.c
+++ b/cpukit/score/src/object.c
@@ -12,6 +12,7 @@
*
* $Id$
*/
+
#include <rtems/system.h>
#include <rtems/chain.h>
#include <rtems/config.h>
@@ -226,3 +227,69 @@ Objects_Control *_Objects_Get(
_Objects_MP_Is_remote( information, id, location, &the_object );
return the_object;
}
+
+
+/*PAGE
+ *
+ * _Objects_Get_next
+ *
+ * Like _Objects_Get, but considers the 'id' as a "hint" and
+ * finds next valid one after that point.
+ * Mostly used for monitor and debug traversal of an object.
+ *
+ * Input parameters:
+ * information - pointer to entry in table for this class
+ * id - object id to search for
+ * location - address of where to store the location
+ * next_id - address to store next id to try
+ *
+ * Output parameters:
+ * returns - address of object if local
+ * location - one of the following:
+ * OBJECTS_ERROR - invalid object ID
+ * OBJECTS_REMOTE - remote object
+ * OBJECTS_LOCAL - local object
+ * next_id - will contain a reasonable "next" id to continue traversal
+ *
+ * NOTE:
+ * assumes can add '1' to an id to get to next index.
+ */
+
+Objects_Control *
+_Objects_Get_next(
+ Objects_Information *information,
+ Objects_Id id,
+ unsigned32 *location_p,
+ Objects_Id *next_id_p
+)
+{
+ Objects_Control *object;
+ Objects_Id next_id;
+
+ if (rtems_get_index(id) == RTEMS_OBJECT_ID_INITIAL_INDEX)
+ next_id = information->minimum_id;
+ else
+ next_id = id;
+
+ do {
+ /* walked off end of list? */
+ if (next_id > information->maximum_id)
+ {
+ *location_p = OBJECTS_ERROR;
+ goto final;
+ }
+
+ /* try to grab one */
+ object = _Objects_Get(information, next_id, location_p);
+
+ next_id++;
+
+ } while (*location_p != OBJECTS_LOCAL);
+
+ *next_id_p = next_id;
+ return object;
+
+final:
+ *next_id_p = RTEMS_OBJECT_ID_FINAL;
+ return 0;
+}