+ 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
This commit is contained in:
Joel Sherrill
1995-08-18 21:42:58 +00:00
parent 95fbca1940
commit 9863dbfdd4
26 changed files with 80 additions and 33 deletions

View File

@@ -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 )

View File

@@ -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
);
}

View File

@@ -39,6 +39,7 @@ void _Partition_Manager_initialization(
{
_Objects_Initialize_information(
&_Partition_Information,
OBJECTS_RTEMS_PARTITIONS,
TRUE,
maximum_partitions,
sizeof( Partition_Control )

View File

@@ -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 )

View File

@@ -39,6 +39,7 @@ void _Region_Manager_initialization(
{
_Objects_Initialize_information(
&_Region_Information,
OBJECTS_RTEMS_REGIONS,
FALSE,
maximum_regions,
sizeof( Region_Control )

View File

@@ -38,6 +38,7 @@ void _Timer_Manager_initialization(
{
_Objects_Initialize_information(
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control )

View File

@@ -56,6 +56,7 @@ void _Semaphore_Manager_initialization(
{
_Objects_Initialize_information(
&_Semaphore_Information,
OBJECTS_RTEMS_SEMAPHORES,
TRUE,
maximum_semaphores,
sizeof( Semaphore_Control )

View File

@@ -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;

View File

@@ -38,6 +38,7 @@ void _Timer_Manager_initialization(
{
_Objects_Initialize_information(
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control )

View File

@@ -36,6 +36,7 @@ void _Extension_Manager_initialization(
{
_Objects_Initialize_information(
&_Extension_Information,
OBJECTS_RTEMS_EXTENSIONS,
FALSE,
maximum_extensions,
sizeof( Extension_Control )

View File

@@ -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;

View File

@@ -59,6 +59,7 @@ void _Thread_Handler_initialization(
_Objects_Initialize_information(
&_Thread_Information,
OBJECTS_RTEMS_TASKS,
TRUE,
maximum_tasks,
sizeof( Thread_Control )

View File

@@ -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!!!!! <HAHAHAHAHA>"
#endif
id = _Objects_Build_id(0, default_node, rtems_get_index(id));
#endif
}
return id;

View File

@@ -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!!!!! <HAHAHAHAHA>"
#endif
id = _Objects_Build_id(0, default_node, rtems_get_index(id));
#endif
}
return id;

View File

@@ -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!!!!! <HAHAHAHAHA>"
#endif
id = _Objects_Build_id(0, default_node, rtems_get_index(id));
#endif
}
return id;

View File

@@ -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 )

View File

@@ -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
);
}

View File

@@ -39,6 +39,7 @@ void _Partition_Manager_initialization(
{
_Objects_Initialize_information(
&_Partition_Information,
OBJECTS_RTEMS_PARTITIONS,
TRUE,
maximum_partitions,
sizeof( Partition_Control )

View File

@@ -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 )

View File

@@ -39,6 +39,7 @@ void _Region_Manager_initialization(
{
_Objects_Initialize_information(
&_Region_Information,
OBJECTS_RTEMS_REGIONS,
FALSE,
maximum_regions,
sizeof( Region_Control )

View File

@@ -38,6 +38,7 @@ void _Timer_Manager_initialization(
{
_Objects_Initialize_information(
&_Timer_Information,
OBJECTS_RTEMS_TIMERS,
FALSE,
maximum_timers,
sizeof( Timer_Control )

View File

@@ -56,6 +56,7 @@ void _Semaphore_Manager_initialization(
{
_Objects_Initialize_information(
&_Semaphore_Information,
OBJECTS_RTEMS_SEMAPHORES,
TRUE,
maximum_semaphores,
sizeof( Semaphore_Control )

View File

@@ -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;

View File

@@ -36,6 +36,7 @@ void _Extension_Manager_initialization(
{
_Objects_Initialize_information(
&_Extension_Information,
OBJECTS_RTEMS_EXTENSIONS,
FALSE,
maximum_extensions,
sizeof( Extension_Control )

View File

@@ -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;

View File

@@ -59,6 +59,7 @@ void _Thread_Handler_initialization(
_Objects_Initialize_information(
&_Thread_Information,
OBJECTS_RTEMS_TASKS,
TRUE,
maximum_tasks,
sizeof( Thread_Control )