summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-04 17:16:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-04 17:16:37 +0000
commit8932955e9a5d87cd41ef1965945a4ccc5c7aed38 (patch)
treeb1fe6c2ebbba3f039f59a37c106b5111fef66479 /cpukit/score
parentRegenerate. (diff)
downloadrtems-8932955e9a5d87cd41ef1965945a4ccc5c7aed38.tar.bz2
2008-02-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/src/rtemsobjectsetname.c, score/src/objectgetinfoid.c, score/src/objectgetnameasstring.c, score/src/objectidtoname.c: Handle Object Id of SELF.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/objectgetinfoid.c1
-rw-r--r--cpukit/score/src/objectgetnameasstring.c7
-rw-r--r--cpukit/score/src/objectidtoname.c9
3 files changed, 12 insertions, 5 deletions
diff --git a/cpukit/score/src/objectgetinfoid.c b/cpukit/score/src/objectgetinfoid.c
index 7211066d1a..729135a9dc 100644
--- a/cpukit/score/src/objectgetinfoid.c
+++ b/cpukit/score/src/objectgetinfoid.c
@@ -15,6 +15,7 @@
#include <rtems/system.h>
#include <rtems/score/object.h>
+#include <rtems/score/thread.h>
Objects_Information *_Objects_Get_information_id(
Objects_Id id
diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c
index ac70a5035d..0b8765d49b 100644
--- a/cpukit/score/src/objectgetnameasstring.c
+++ b/cpukit/score/src/objectgetnameasstring.c
@@ -41,6 +41,7 @@ char *_Objects_Get_name_as_string(
char lname[5];
Objects_Control *the_object;
Objects_Locations location;
+ Objects_Id tmpId;
if ( length == 0 )
return NULL;
@@ -48,11 +49,13 @@ char *_Objects_Get_name_as_string(
if ( name == NULL )
return NULL;
- information = _Objects_Get_information_id( id );
+ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
+
+ information = _Objects_Get_information_id( tmpId );
if ( !information )
return NULL;
- the_object = _Objects_Get( information, id, &location );
+ the_object = _Objects_Get( information, tmpId, &location );
switch ( location ) {
#if defined(RTEMS_MULTIPROCESSING)
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;