From 9863dbfdd45ff4a8fcd06b8a146f7870e4159db9 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 18 Aug 1995 21:42:58 +0000 Subject: + 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 --- c/src/exec/rtems/src/dpmem.c | 1 + c/src/exec/rtems/src/msg.c | 3 ++- c/src/exec/rtems/src/part.c | 1 + c/src/exec/rtems/src/ratemon.c | 1 + c/src/exec/rtems/src/region.c | 1 + c/src/exec/rtems/src/rtemstimer.c | 1 + c/src/exec/rtems/src/sem.c | 1 + c/src/exec/rtems/src/tasks.c | 1 - c/src/exec/rtems/src/timer.c | 1 + c/src/exec/sapi/src/extension.c | 1 + c/src/exec/score/src/object.c | 29 +++++++++++++++++++---------- c/src/exec/score/src/thread.c | 1 + c/src/lib/libmisc/monitor/mon-object.c | 10 +++++++--- c/src/libmisc/monitor/mon-object.c | 10 +++++++--- cpukit/libmisc/monitor/mon-object.c | 10 +++++++--- cpukit/rtems/src/dpmem.c | 1 + cpukit/rtems/src/msg.c | 3 ++- cpukit/rtems/src/part.c | 1 + cpukit/rtems/src/ratemon.c | 1 + cpukit/rtems/src/region.c | 1 + cpukit/rtems/src/rtemstimer.c | 1 + cpukit/rtems/src/sem.c | 1 + cpukit/rtems/src/tasks.c | 1 - cpukit/sapi/src/extension.c | 1 + cpukit/score/src/object.c | 29 +++++++++++++++++++---------- cpukit/score/src/thread.c | 1 + 26 files changed, 80 insertions(+), 33 deletions(-) diff --git a/c/src/exec/rtems/src/dpmem.c b/c/src/exec/rtems/src/dpmem.c index 0aacecec5b..b594ecd00e 100644 --- a/c/src/exec/rtems/src/dpmem.c +++ b/c/src/exec/rtems/src/dpmem.c @@ -37,6 +37,7 @@ void _Dual_ported_memory_Manager_initialization( { _Objects_Initialize_information( &_Dual_ported_memory_Information, + OBJECTS_RTEMS_PORTS, FALSE, maximum_ports, sizeof( Dual_ported_memory_Control ) diff --git a/c/src/exec/rtems/src/msg.c b/c/src/exec/rtems/src/msg.c index 9b1c6acef5..dc136271fe 100644 --- a/c/src/exec/rtems/src/msg.c +++ b/c/src/exec/rtems/src/msg.c @@ -45,6 +45,7 @@ void _Message_queue_Manager_initialization( { _Objects_Initialize_information( &_Message_queue_Information, + OBJECTS_RTEMS_MESSAGE_QUEUES, TRUE, maximum_message_queues, sizeof( Message_queue_Control ) @@ -285,7 +286,7 @@ rtems_status_code rtems_message_queue_delete( MESSAGE_QUEUE_MP_ANNOUNCE_DELETE, the_message_queue->Object.id, 0, /* Not used */ - MPCI_DEFAULT_TIMEOUT + 0 ); } diff --git a/c/src/exec/rtems/src/part.c b/c/src/exec/rtems/src/part.c index 1fa2e0e716..7cf0fe691c 100644 --- a/c/src/exec/rtems/src/part.c +++ b/c/src/exec/rtems/src/part.c @@ -39,6 +39,7 @@ void _Partition_Manager_initialization( { _Objects_Initialize_information( &_Partition_Information, + OBJECTS_RTEMS_PARTITIONS, TRUE, maximum_partitions, sizeof( Partition_Control ) diff --git a/c/src/exec/rtems/src/ratemon.c b/c/src/exec/rtems/src/ratemon.c index 3c0733a3ab..86f1534d98 100644 --- a/c/src/exec/rtems/src/ratemon.c +++ b/c/src/exec/rtems/src/ratemon.c @@ -41,6 +41,7 @@ void _Rate_monotonic_Manager_initialization( { _Objects_Initialize_information( &_Rate_monotonic_Information, + OBJECTS_RTEMS_PERIODS, FALSE, maximum_periods, sizeof( Rate_monotonic_Control ) diff --git a/c/src/exec/rtems/src/region.c b/c/src/exec/rtems/src/region.c index c62214eaf6..40bd7ffa26 100644 --- a/c/src/exec/rtems/src/region.c +++ b/c/src/exec/rtems/src/region.c @@ -39,6 +39,7 @@ void _Region_Manager_initialization( { _Objects_Initialize_information( &_Region_Information, + OBJECTS_RTEMS_REGIONS, FALSE, maximum_regions, sizeof( Region_Control ) diff --git a/c/src/exec/rtems/src/rtemstimer.c b/c/src/exec/rtems/src/rtemstimer.c index abab4cc7b4..ec55c3eaf9 100644 --- a/c/src/exec/rtems/src/rtemstimer.c +++ b/c/src/exec/rtems/src/rtemstimer.c @@ -38,6 +38,7 @@ void _Timer_Manager_initialization( { _Objects_Initialize_information( &_Timer_Information, + OBJECTS_RTEMS_TIMERS, FALSE, maximum_timers, sizeof( Timer_Control ) diff --git a/c/src/exec/rtems/src/sem.c b/c/src/exec/rtems/src/sem.c index 19410c62f1..340a4fa947 100644 --- a/c/src/exec/rtems/src/sem.c +++ b/c/src/exec/rtems/src/sem.c @@ -56,6 +56,7 @@ void _Semaphore_Manager_initialization( { _Objects_Initialize_information( &_Semaphore_Information, + OBJECTS_RTEMS_SEMAPHORES, TRUE, maximum_semaphores, sizeof( Semaphore_Control ) diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c index edba524d94..e900df0ab8 100644 --- a/c/src/exec/rtems/src/tasks.c +++ b/c/src/exec/rtems/src/tasks.c @@ -143,7 +143,6 @@ rtems_status_code rtems_task_create( return( RTEMS_TOO_MANY ); } - the_thread->name = name; the_thread->attribute_set = the_attribute_set; the_thread->current_state = STATES_DORMANT; the_thread->current_modes = initial_modes; diff --git a/c/src/exec/rtems/src/timer.c b/c/src/exec/rtems/src/timer.c index abab4cc7b4..ec55c3eaf9 100644 --- a/c/src/exec/rtems/src/timer.c +++ b/c/src/exec/rtems/src/timer.c @@ -38,6 +38,7 @@ void _Timer_Manager_initialization( { _Objects_Initialize_information( &_Timer_Information, + OBJECTS_RTEMS_TIMERS, FALSE, maximum_timers, sizeof( Timer_Control ) diff --git a/c/src/exec/sapi/src/extension.c b/c/src/exec/sapi/src/extension.c index 10c974ef8e..4cae903a34 100644 --- a/c/src/exec/sapi/src/extension.c +++ b/c/src/exec/sapi/src/extension.c @@ -36,6 +36,7 @@ void _Extension_Manager_initialization( { _Objects_Initialize_information( &_Extension_Information, + OBJECTS_RTEMS_EXTENSIONS, FALSE, maximum_extensions, sizeof( Extension_Control ) diff --git a/c/src/exec/score/src/object.c b/c/src/exec/score/src/object.c index 29450d4171..bd8edaef58 100644 --- a/c/src/exec/score/src/object.c +++ b/c/src/exec/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; diff --git a/c/src/exec/score/src/thread.c b/c/src/exec/score/src/thread.c index 0cdb224bbc..5480651d9c 100644 --- a/c/src/exec/score/src/thread.c +++ b/c/src/exec/score/src/thread.c @@ -59,6 +59,7 @@ void _Thread_Handler_initialization( _Objects_Initialize_information( &_Thread_Information, + OBJECTS_RTEMS_TASKS, TRUE, maximum_tasks, sizeof( Thread_Control ) diff --git a/c/src/lib/libmisc/monitor/mon-object.c b/c/src/lib/libmisc/monitor/mon-object.c index 5add90763e..2747b23551 100644 --- a/c/src/lib/libmisc/monitor/mon-object.c +++ b/c/src/lib/libmisc/monitor/mon-object.c @@ -120,12 +120,16 @@ rtems_monitor_id_fixup( { #if 0 /* XXX Uncomment this when types are added to id's */ - if (rtems_get_type(id) != RTEMS_OBJECT_INVALID) - type = rtems_get_type(id); + if (rtems_get_class(id) != OBJECTS_NO_CLASS) + type = rtems_get_class(id); id = _Objects_Build_id(type, default_node, rtems_get_index(id)); #else - id = _Objects_Build_id(default_node, rtems_get_index(id)); +#warning "TONY... FIX ME!!!!!" +#if defined(hppa1_1) +#error "TONY... I SAID TO FIX ME!!!!! " +#endif + id = _Objects_Build_id(0, default_node, rtems_get_index(id)); #endif } return id; diff --git a/c/src/libmisc/monitor/mon-object.c b/c/src/libmisc/monitor/mon-object.c index 5add90763e..2747b23551 100644 --- a/c/src/libmisc/monitor/mon-object.c +++ b/c/src/libmisc/monitor/mon-object.c @@ -120,12 +120,16 @@ rtems_monitor_id_fixup( { #if 0 /* XXX Uncomment this when types are added to id's */ - if (rtems_get_type(id) != RTEMS_OBJECT_INVALID) - type = rtems_get_type(id); + if (rtems_get_class(id) != OBJECTS_NO_CLASS) + type = rtems_get_class(id); id = _Objects_Build_id(type, default_node, rtems_get_index(id)); #else - id = _Objects_Build_id(default_node, rtems_get_index(id)); +#warning "TONY... FIX ME!!!!!" +#if defined(hppa1_1) +#error "TONY... I SAID TO FIX ME!!!!! " +#endif + id = _Objects_Build_id(0, default_node, rtems_get_index(id)); #endif } return id; diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c index 5add90763e..2747b23551 100644 --- a/cpukit/libmisc/monitor/mon-object.c +++ b/cpukit/libmisc/monitor/mon-object.c @@ -120,12 +120,16 @@ rtems_monitor_id_fixup( { #if 0 /* XXX Uncomment this when types are added to id's */ - if (rtems_get_type(id) != RTEMS_OBJECT_INVALID) - type = rtems_get_type(id); + if (rtems_get_class(id) != OBJECTS_NO_CLASS) + type = rtems_get_class(id); id = _Objects_Build_id(type, default_node, rtems_get_index(id)); #else - id = _Objects_Build_id(default_node, rtems_get_index(id)); +#warning "TONY... FIX ME!!!!!" +#if defined(hppa1_1) +#error "TONY... I SAID TO FIX ME!!!!! " +#endif + id = _Objects_Build_id(0, default_node, rtems_get_index(id)); #endif } return id; diff --git a/cpukit/rtems/src/dpmem.c b/cpukit/rtems/src/dpmem.c index 0aacecec5b..b594ecd00e 100644 --- a/cpukit/rtems/src/dpmem.c +++ b/cpukit/rtems/src/dpmem.c @@ -37,6 +37,7 @@ void _Dual_ported_memory_Manager_initialization( { _Objects_Initialize_information( &_Dual_ported_memory_Information, + OBJECTS_RTEMS_PORTS, FALSE, maximum_ports, sizeof( Dual_ported_memory_Control ) diff --git a/cpukit/rtems/src/msg.c b/cpukit/rtems/src/msg.c index 9b1c6acef5..dc136271fe 100644 --- a/cpukit/rtems/src/msg.c +++ b/cpukit/rtems/src/msg.c @@ -45,6 +45,7 @@ void _Message_queue_Manager_initialization( { _Objects_Initialize_information( &_Message_queue_Information, + OBJECTS_RTEMS_MESSAGE_QUEUES, TRUE, maximum_message_queues, sizeof( Message_queue_Control ) @@ -285,7 +286,7 @@ rtems_status_code rtems_message_queue_delete( MESSAGE_QUEUE_MP_ANNOUNCE_DELETE, the_message_queue->Object.id, 0, /* Not used */ - MPCI_DEFAULT_TIMEOUT + 0 ); } diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c index 1fa2e0e716..7cf0fe691c 100644 --- a/cpukit/rtems/src/part.c +++ b/cpukit/rtems/src/part.c @@ -39,6 +39,7 @@ void _Partition_Manager_initialization( { _Objects_Initialize_information( &_Partition_Information, + OBJECTS_RTEMS_PARTITIONS, TRUE, maximum_partitions, sizeof( Partition_Control ) diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c index 3c0733a3ab..86f1534d98 100644 --- a/cpukit/rtems/src/ratemon.c +++ b/cpukit/rtems/src/ratemon.c @@ -41,6 +41,7 @@ void _Rate_monotonic_Manager_initialization( { _Objects_Initialize_information( &_Rate_monotonic_Information, + OBJECTS_RTEMS_PERIODS, FALSE, maximum_periods, sizeof( Rate_monotonic_Control ) diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c index c62214eaf6..40bd7ffa26 100644 --- a/cpukit/rtems/src/region.c +++ b/cpukit/rtems/src/region.c @@ -39,6 +39,7 @@ void _Region_Manager_initialization( { _Objects_Initialize_information( &_Region_Information, + OBJECTS_RTEMS_REGIONS, FALSE, maximum_regions, sizeof( Region_Control ) diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c index abab4cc7b4..ec55c3eaf9 100644 --- a/cpukit/rtems/src/rtemstimer.c +++ b/cpukit/rtems/src/rtemstimer.c @@ -38,6 +38,7 @@ void _Timer_Manager_initialization( { _Objects_Initialize_information( &_Timer_Information, + OBJECTS_RTEMS_TIMERS, FALSE, maximum_timers, sizeof( Timer_Control ) diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c index 19410c62f1..340a4fa947 100644 --- a/cpukit/rtems/src/sem.c +++ b/cpukit/rtems/src/sem.c @@ -56,6 +56,7 @@ void _Semaphore_Manager_initialization( { _Objects_Initialize_information( &_Semaphore_Information, + OBJECTS_RTEMS_SEMAPHORES, TRUE, maximum_semaphores, sizeof( Semaphore_Control ) diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index edba524d94..e900df0ab8 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -143,7 +143,6 @@ rtems_status_code rtems_task_create( return( RTEMS_TOO_MANY ); } - the_thread->name = name; the_thread->attribute_set = the_attribute_set; the_thread->current_state = STATES_DORMANT; the_thread->current_modes = initial_modes; diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c index 10c974ef8e..4cae903a34 100644 --- a/cpukit/sapi/src/extension.c +++ b/cpukit/sapi/src/extension.c @@ -36,6 +36,7 @@ void _Extension_Manager_initialization( { _Objects_Initialize_information( &_Extension_Information, + OBJECTS_RTEMS_EXTENSIONS, FALSE, maximum_extensions, sizeof( Extension_Control ) 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; diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index 0cdb224bbc..5480651d9c 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/score/src/thread.c @@ -59,6 +59,7 @@ void _Thread_Handler_initialization( _Objects_Initialize_information( &_Thread_Information, + OBJECTS_RTEMS_TASKS, TRUE, maximum_tasks, sizeof( Thread_Control ) -- cgit v1.2.3