summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 19:30:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-23 19:30:23 +0000
commit3235ad9a2cd717df901853ad5220a4aaffae84a9 (patch)
treef73a01d8c3065188a3ab283cf545b3ce7bc4f696 /cpukit/score/include
parentAdded file .. fixed RCS Id (diff)
downloadrtems-3235ad9a2cd717df901853ad5220a4aaffae84a9.tar.bz2
Support for variable length names added to Object Handler. This supports
both fixed length "raw" names and strings from the API's point of view. Both inline and macro implementations were tested.
Diffstat (limited to '')
-rw-r--r--cpukit/score/include/rtems/score/object.h142
-rw-r--r--cpukit/score/include/rtems/score/objectmp.h5
-rw-r--r--cpukit/score/include/rtems/system.h6
3 files changed, 101 insertions, 52 deletions
diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h
index 7f4c01c53d..c5226302d6 100644
--- a/cpukit/score/include/rtems/score/object.h
+++ b/cpukit/score/include/rtems/score/object.h
@@ -29,7 +29,25 @@ extern "C" {
* object names.
*/
-typedef unsigned32 Objects_Name;
+typedef void * Objects_Name;
+
+/*
+ * Space for object names is allocated in multiples of this.
+ *
+ * NOTE: Must be a power of 2. Matches the name manipulation routines.
+ */
+
+#define OBJECTS_NAME_ALIGNMENT 4
+
+/*
+ * Functions which compare names are prototyped like this.
+ */
+
+typedef boolean (*Objects_Name_comparators)(
+ void * /* name_1 */,
+ void * /* name_2 */,
+ unsigned32 /* length */
+);
/*
* The following type defines the control block used to manage
@@ -91,7 +109,7 @@ typedef enum {
typedef struct {
Chain_Node Node;
Objects_Id id;
- Objects_Name *name;
+ Objects_Name name;
} Objects_Control;
/*
@@ -108,6 +126,8 @@ typedef struct {
Objects_Name *name_table; /* table of local object names */
Chain_Control *global_table; /* pointer to global table */
Chain_Control Inactive; /* chain of inactive ctl blocks */
+ boolean is_string; /* TRUE if names are strings */
+ unsigned32 name_length; /* maximum length of names */
} Objects_Information;
/*
@@ -179,10 +199,79 @@ void _Objects_Initialize_information (
Objects_Classes the_class,
boolean supports_global,
unsigned32 maximum,
- unsigned32 size
+ unsigned32 size,
+ boolean is_string,
+ unsigned32 maximum_name_length
+);
+
+/*
+ * _Objects_Clear_name
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Clear_name(
+ void *name,
+ unsigned32 length
+);
+
+/*
+ * _Objects_Copy_name_string
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_string(
+ void *source,
+ void *destination
+);
+
+/*
+ * _Objects_Copy_name_raw
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+void _Objects_Copy_name_raw(
+ void *source,
+ void *destination,
+ unsigned32 length
+);
+
+/*
+ * _Objects_Compare_name_string
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_string(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
);
/*
+ * _Objects_Compare_name_raw
+ *
+ * DESCRIPTION:
+ *
+ * XXX
+ */
+
+boolean _Objects_Compare_name_raw(
+ void *name_1,
+ void *name_2,
+ unsigned32 length
+);
+/*
* _Objects_Name_to_id
*
* DESCRIPTION:
@@ -244,53 +333,6 @@ Objects_Control *_Objects_Get_next(
);
/*
- * _Objects_Is_name_valid
- *
- * DESCRIPTION:
- *
- * This function returns TRUE if the name is valid, and FALSE otherwise.
- */
-
-STATIC INLINE boolean _Objects_Is_name_valid (
- Objects_Name name
-);
-
-/*
- * rtems_build_name
- *
- * DESCRIPTION:
- *
- * This function returns an object name composed of the four characters
- * C1, C2, C3, and C4.
- *
- * NOTE:
- *
- * This must be implemented as a macro for use in Configuration Tables.
- *
- */
-
-#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
- ( (_C1) << 24 | (_C2) << 16 | (_C3) << 8 | (_C4) )
-
-/*
- * rtems_name_to_characters
- *
- * DESCRIPTION:
- *
- * This function breaks the object name into the four component
- * characters C1, C2, C3, and C4.
- *
- */
-
-STATIC INLINE void rtems_name_to_characters(
- Objects_Name name,
- char *c1,
- char *c2,
- char *c3,
- char *c4
-);
-
-/*
* _Objects_Build_id
*
* DESCRIPTION:
diff --git a/cpukit/score/include/rtems/score/objectmp.h b/cpukit/score/include/rtems/score/objectmp.h
index 0d29fda753..6ec5ed1781 100644
--- a/cpukit/score/include/rtems/score/objectmp.h
+++ b/cpukit/score/include/rtems/score/objectmp.h
@@ -28,7 +28,8 @@ extern "C" {
typedef struct {
Objects_Control Object;
- Objects_Name name;
+ unsigned32 name; /* XXX broken but works */
+ /* XXX If any API is MP with variable length names .. BOOM!!!! */
} Objects_MP_Control;
/*
@@ -93,7 +94,7 @@ STATIC INLINE boolean _Objects_MP_Is_null_global_object (
boolean _Objects_MP_Open (
Objects_Information *information,
- Objects_Name the_name,
+ unsigned32 the_name, /* XXX -- wrong for variable length */
Objects_Id the_id,
boolean is_fatal_error
);
diff --git a/cpukit/score/include/rtems/system.h b/cpukit/score/include/rtems/system.h
index 96b0abfff8..5f627c1a7c 100644
--- a/cpukit/score/include/rtems/system.h
+++ b/cpukit/score/include/rtems/system.h
@@ -127,6 +127,12 @@ extern const void * _Entry_points[ RTEMS_NUMBER_OF_ENTRY_POINTS ];
EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */
+/*
+ * XXX weird RTEMS stuff
+ */
+
+#define RTEMS_MAXIMUM_NAME_LENGTH 4
+
#ifdef __cplusplus
}
#endif