score: _Objects_Get_name_as_string()

Avoid Giant lock in _Objects_Get_name_as_string().

Update #2555.
This commit is contained in:
Sebastian Huber
2016-04-27 16:52:48 +02:00
parent f4d541ccfe
commit 77726405fa

View File

@@ -41,7 +41,7 @@ char *_Objects_Get_name_as_string(
uint32_t i; uint32_t i;
char lname[5]; char lname[5];
Objects_Control *the_object; Objects_Control *the_object;
Objects_Locations location; ISR_lock_Context lock_context;
Objects_Id tmpId; Objects_Id tmpId;
if ( length == 0 ) if ( length == 0 )
@@ -56,10 +56,10 @@ char *_Objects_Get_name_as_string(
if ( !information ) if ( !information )
return NULL; return NULL;
the_object = _Objects_Get( information, tmpId, &location ); the_object = _Objects_Get_local( tmpId, information, &lock_context );
switch ( location ) { if ( the_object == NULL ) {
return NULL;
case OBJECTS_LOCAL: }
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
if ( information->is_string ) { if ( information->is_string ) {
@@ -85,16 +85,6 @@ char *_Objects_Get_name_as_string(
} }
*d = '\0'; *d = '\0';
_Objects_Put( the_object ); _ISR_lock_ISR_enable( &lock_context );
return name; return name;
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE:
/* not supported */
#endif
case OBJECTS_ERROR:
return NULL;
}
return NULL; /* unreachable path */
} }