forked from Imagelibrary/rtems
Directly index local table to avoid error check.
This commit is contained in:
@@ -44,7 +44,7 @@ Objects_Control *_Objects_Allocate_by_index(
|
|||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
|
|
||||||
if ( index && information->maximum >= index ) {
|
if ( index && information->maximum >= index ) {
|
||||||
the_object = _Objects_Get_local_object( information, index );
|
the_object = information->local_table[ index ];
|
||||||
if ( the_object )
|
if ( the_object )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -53,26 +53,23 @@ Objects_Control *_Objects_Get(
|
|||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
unsigned32 index;
|
unsigned32 index;
|
||||||
|
|
||||||
index = _Objects_Get_index( id );
|
/* index = _Objects_Get_index( id ); */
|
||||||
|
index = (unsigned16) id;
|
||||||
|
|
||||||
if ( information->maximum >= index ) {
|
if ( information->maximum >= index ) {
|
||||||
_Thread_Disable_dispatch();
|
_Thread_Disable_dispatch();
|
||||||
if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
|
if ( (the_object = information->local_table[ index ]) != NULL ) {
|
||||||
*location = OBJECTS_LOCAL;
|
*location = OBJECTS_LOCAL;
|
||||||
return( the_object );
|
return the_object;
|
||||||
}
|
}
|
||||||
_Thread_Enable_dispatch();
|
_Thread_Enable_dispatch();
|
||||||
*location = OBJECTS_ERROR;
|
*location = OBJECTS_ERROR;
|
||||||
return( NULL );
|
return NULL;
|
||||||
}
|
}
|
||||||
*location = OBJECTS_ERROR;
|
*location = OBJECTS_ERROR;
|
||||||
|
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
_Objects_MP_Is_remote(
|
_Objects_MP_Is_remote( information, id, location, &the_object );
|
||||||
information,
|
|
||||||
_Objects_Build_id( information->the_class, _Objects_Local_node, index ),
|
|
||||||
location,
|
|
||||||
&the_object
|
|
||||||
);
|
|
||||||
return the_object;
|
return the_object;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ Objects_Control *_Objects_Get_by_index(
|
|||||||
|
|
||||||
if ( information->maximum >= index ) {
|
if ( information->maximum >= index ) {
|
||||||
_Thread_Disable_dispatch();
|
_Thread_Disable_dispatch();
|
||||||
if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
|
the_object = information->local_table[ index ];
|
||||||
|
if ( the_object ) {
|
||||||
*location = OBJECTS_LOCAL;
|
*location = OBJECTS_LOCAL;
|
||||||
return( the_object );
|
return( the_object );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ Objects_Control *_Objects_Allocate_by_index(
|
|||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
|
|
||||||
if ( index && information->maximum >= index ) {
|
if ( index && information->maximum >= index ) {
|
||||||
the_object = _Objects_Get_local_object( information, index );
|
the_object = information->local_table[ index ];
|
||||||
if ( the_object )
|
if ( the_object )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -53,26 +53,23 @@ Objects_Control *_Objects_Get(
|
|||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
unsigned32 index;
|
unsigned32 index;
|
||||||
|
|
||||||
index = _Objects_Get_index( id );
|
/* index = _Objects_Get_index( id ); */
|
||||||
|
index = (unsigned16) id;
|
||||||
|
|
||||||
if ( information->maximum >= index ) {
|
if ( information->maximum >= index ) {
|
||||||
_Thread_Disable_dispatch();
|
_Thread_Disable_dispatch();
|
||||||
if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
|
if ( (the_object = information->local_table[ index ]) != NULL ) {
|
||||||
*location = OBJECTS_LOCAL;
|
*location = OBJECTS_LOCAL;
|
||||||
return( the_object );
|
return the_object;
|
||||||
}
|
}
|
||||||
_Thread_Enable_dispatch();
|
_Thread_Enable_dispatch();
|
||||||
*location = OBJECTS_ERROR;
|
*location = OBJECTS_ERROR;
|
||||||
return( NULL );
|
return NULL;
|
||||||
}
|
}
|
||||||
*location = OBJECTS_ERROR;
|
*location = OBJECTS_ERROR;
|
||||||
|
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
_Objects_MP_Is_remote(
|
_Objects_MP_Is_remote( information, id, location, &the_object );
|
||||||
information,
|
|
||||||
_Objects_Build_id( information->the_class, _Objects_Local_node, index ),
|
|
||||||
location,
|
|
||||||
&the_object
|
|
||||||
);
|
|
||||||
return the_object;
|
return the_object;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ Objects_Control *_Objects_Get_by_index(
|
|||||||
|
|
||||||
if ( information->maximum >= index ) {
|
if ( information->maximum >= index ) {
|
||||||
_Thread_Disable_dispatch();
|
_Thread_Disable_dispatch();
|
||||||
if ( (the_object = _Objects_Get_local_object( information, index )) != NULL ) {
|
the_object = information->local_table[ index ];
|
||||||
|
if ( the_object ) {
|
||||||
*location = OBJECTS_LOCAL;
|
*location = OBJECTS_LOCAL;
|
||||||
return( the_object );
|
return( the_object );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user