summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--cpukit/ChangeLog6
-rw-r--r--cpukit/rtems/src/rtemsobjectsetname.c7
-rw-r--r--cpukit/score/src/objectgetinfoid.c1
-rw-r--r--cpukit/score/src/objectgetnameasstring.c7
-rw-r--r--cpukit/score/src/objectidtoname.c9
5 files changed, 23 insertions, 7 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index e11f2fd03f..569fea3a2e 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2008-01-31 Joel Sherrill <joel.sherrill@OARcorp.com>
* posix/src/clockgettime.c, posix/src/clocksettime.c,
diff --git a/cpukit/rtems/src/rtemsobjectsetname.c b/cpukit/rtems/src/rtemsobjectsetname.c
index ccfd8a7b59..42a5f5f235 100644
--- a/cpukit/rtems/src/rtemsobjectsetname.c
+++ b/cpukit/rtems/src/rtemsobjectsetname.c
@@ -34,15 +34,18 @@ rtems_status_code rtems_object_set_name(
Objects_Information *information;
Objects_Locations location;
Objects_Control *the_object;
+ Objects_Id tmpId;
if ( !name )
return RTEMS_INVALID_ADDRESS;
- 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 RTEMS_INVALID_ID;
- the_object = _Objects_Get( information, id, &location );
+ the_object = _Objects_Get( information, tmpId, &location );
switch ( location ) {
case OBJECTS_LOCAL:
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;