From 8932955e9a5d87cd41ef1965945a4ccc5c7aed38 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 4 Feb 2008 17:16:37 +0000 Subject: 2008-02-04 Joel Sherrill * rtems/src/rtemsobjectsetname.c, score/src/objectgetinfoid.c, score/src/objectgetnameasstring.c, score/src/objectidtoname.c: Handle Object Id of SELF. --- cpukit/score/src/objectidtoname.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cpukit/score/src/objectidtoname.c') diff --git a/cpukit/score/src/objectidtoname.c b/cpukit/score/src/objectidtoname.c index bb96010957..52a4813815 100644 --- a/cpukit/score/src/objectidtoname.c +++ b/cpukit/score/src/objectidtoname.c @@ -43,6 +43,7 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( { uint32_t the_api; uint32_t the_class; + Objects_Id tmpId; Objects_Information *information; Objects_Control *the_object = (Objects_Control *) 0; Objects_Locations ignored_location; @@ -50,11 +51,13 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( if ( !name ) return OBJECTS_INVALID_NAME; - the_api = _Objects_Get_API( id ); + tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; + + the_api = _Objects_Get_API( tmpId ); if ( the_api && the_api > OBJECTS_APIS_LAST ) return OBJECTS_INVALID_ID; - the_class = _Objects_Get_class( id ); + the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; if ( !information ) @@ -63,7 +66,7 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( if ( information->is_string ) return OBJECTS_INVALID_ID; - the_object = _Objects_Get( information, id, &ignored_location ); + the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; -- cgit v1.2.3