summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/object.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-18 21:42:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-18 21:42:58 +0000
commit9863dbfdd45ff4a8fcd06b8a146f7870e4159db9 (patch)
tree4bdaaf1cd1e31a9a510e9627094c13f8bc19b88c /cpukit/score/src/object.c
parent+ Added object type field to object id. (diff)
downloadrtems-9863dbfdd45ff4a8fcd06b8a146f7870e4159db9.tar.bz2
+ Added object type field to object id.
+ Added name pointer to Object_Control. + Modified Object Open and Close to address name field. + Removed name as separate element from Thread and Proxy Control. + Added parameter "object class" to calls to Initialize Information
Diffstat (limited to 'cpukit/score/src/object.c')
-rw-r--r--cpukit/score/src/object.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/cpukit/score/src/object.c b/cpukit/score/src/object.c
index 29450d4171..bd8edaef58 100644
--- a/cpukit/score/src/object.c
+++ b/cpukit/score/src/object.c
@@ -51,7 +51,8 @@ void _Objects_Handler_initialization(
* This routine initializes all object information related data structures.
*
* Input parameters:
- * information - object class
+ * information - object information table
+ * the_class - object class
* supports_global - TRUE if this is a global object class
* maximum - maximum objects of this class
* size - size of this object's control block
@@ -61,25 +62,27 @@ void _Objects_Handler_initialization(
void _Objects_Initialize_information(
Objects_Information *information,
- boolean supports_global,
- unsigned32 maximum,
- unsigned32 size
+ Objects_Classes the_class,
+ boolean supports_global,
+ unsigned32 maximum,
+ unsigned32 size
)
{
unsigned32 minimum_index;
unsigned32 index;
Objects_Control *the_object;
- information->maximum = maximum;
+ information->maximum = maximum;
+ information->the_class = the_class;
if ( maximum == 0 ) minimum_index = 0;
else minimum_index = 1;
information->minimum_id =
- _Objects_Build_id( _Objects_Local_node, minimum_index );
+ _Objects_Build_id( the_class, _Objects_Local_node, minimum_index );
information->maximum_id =
- _Objects_Build_id( _Objects_Local_node, maximum );
+ _Objects_Build_id( the_class, _Objects_Local_node, maximum );
information->local_table = _Workspace_Allocate_or_fatal_error(
(maximum + 1) * sizeof(Objects_Control *)
@@ -110,7 +113,8 @@ void _Objects_Initialize_information(
for ( index=1;
index <= maximum ;
index++ ) {
- the_object->id = _Objects_Build_id( _Objects_Local_node, index );
+ the_object->id =
+ _Objects_Build_id( the_class, _Objects_Local_node, index );
the_object = (Objects_Control *) the_object->Node.next;
}
@@ -172,7 +176,11 @@ rtems_status_code _Objects_Name_to_id(
index++
)
if ( name == names[ index ] ) {
- *id = _Objects_Build_id( _Objects_Local_node, index );
+ *id = _Objects_Build_id(
+ information->the_class,
+ _Objects_Local_node,
+ index
+ );
return( RTEMS_SUCCESSFUL );
}
}
@@ -213,6 +221,7 @@ Objects_Control *_Objects_Get(
unsigned32 index;
index = id - information->minimum_id;
+
if ( information->maximum >= index ) {
_Thread_Disable_dispatch();
if ( (the_object = information->local_table[index+1]) != NULL ) {
@@ -273,7 +282,7 @@ _Objects_Get_next(
do {
/* walked off end of list? */
- if (next_id > information->maximum_id)
+ if (rtems_get_index(next_id) > information->maximum)
{
*location_p = OBJECTS_ERROR;
goto final;