diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-11 14:54:29 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-11 14:54:29 +0000 |
commit | 47988fb37bf1f5aac757c92e3ac8be6f0d027d04 (patch) | |
tree | 869cfe18d218535f112630df116c62bb773e3b7d /cpukit/score/src | |
parent | 2009-09-11 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-47988fb37bf1f5aac757c92e3ac8be6f0d027d04.tar.bz2 |
2009-09-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/object.h,
score/inline/rtems/score/object.inl,
score/src/objectgetnameasstring.c, score/src/objectidtoname.c,
score/src/objectinitializeinformation.c,
score/src/objectnamespaceremove.c, score/src/objectnametoidstring.c,
score/src/objectsetname.c, score/src/thread.c,
score/src/threadcreateidle.c: Disable object string name support when
POSIX is not enabled.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/objectgetnameasstring.c | 9 | ||||
-rw-r--r-- | cpukit/score/src/objectidtoname.c | 6 | ||||
-rw-r--r-- | cpukit/score/src/objectinitializeinformation.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/objectnamespaceremove.c | 16 | ||||
-rw-r--r-- | cpukit/score/src/objectnametoidstring.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/objectsetname.c | 5 | ||||
-rw-r--r-- | cpukit/score/src/thread.c | 2 | ||||
-rw-r--r-- | cpukit/score/src/threadcreateidle.c | 2 |
8 files changed, 30 insertions, 14 deletions
diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c index 97ace92446..ecf772cad5 100644 --- a/cpukit/score/src/objectgetnameasstring.c +++ b/cpukit/score/src/objectgetnameasstring.c @@ -65,9 +65,12 @@ char *_Objects_Get_name_as_string( case OBJECTS_LOCAL: - if ( information->is_string ) { - s = the_object->name.name_p; - } else { + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + if ( information->is_string ) { + s = the_object->name.name_p; + } else + #endif + { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; diff --git a/cpukit/score/src/objectidtoname.c b/cpukit/score/src/objectidtoname.c index de34dc5fa1..7504d3dc3c 100644 --- a/cpukit/score/src/objectidtoname.c +++ b/cpukit/score/src/objectidtoname.c @@ -66,8 +66,10 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( if ( !information ) return OBJECTS_INVALID_ID; - if ( information->is_string ) - return OBJECTS_INVALID_ID; + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + if ( information->is_string ) + return OBJECTS_INVALID_ID; + #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c index b8d972faa2..060a6b126e 100644 --- a/cpukit/score/src/objectinitializeinformation.c +++ b/cpukit/score/src/objectinitializeinformation.c @@ -71,7 +71,9 @@ void _Objects_Initialize_information( information->the_api = the_api; information->the_class = the_class; +#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) information->is_string = is_string; +#endif information->local_table = 0; information->inactive_per_block = 0; diff --git a/cpukit/score/src/objectnamespaceremove.c b/cpukit/score/src/objectnamespaceremove.c index df54d854ac..5e97a6c34a 100644 --- a/cpukit/score/src/objectnamespaceremove.c +++ b/cpukit/score/src/objectnamespaceremove.c @@ -22,15 +22,19 @@ void _Objects_Namespace_remove( Objects_Control *the_object ) { - /* - * If this is a string format name, then free the memory. - */ - if ( information->is_string && the_object->name.name_p ) - _Workspace_Free( (void *)the_object->name.name_p ); + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + /* + * If this is a string format name, then free the memory. + */ + if ( information->is_string && the_object->name.name_p ) + _Workspace_Free( (void *)the_object->name.name_p ); + #endif /* * Clear out either format. */ - the_object->name.name_p = NULL; + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + the_object->name.name_p = NULL; + #endif the_object->name.name_u32 = 0; } diff --git a/cpukit/score/src/objectnametoidstring.c b/cpukit/score/src/objectnametoidstring.c index da0583401b..4d11d5d11a 100644 --- a/cpukit/score/src/objectnametoidstring.c +++ b/cpukit/score/src/objectnametoidstring.c @@ -16,6 +16,7 @@ #include "config.h" #endif +#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) #include <string.h> #include <rtems/system.h> @@ -86,3 +87,4 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_string( return OBJECTS_INVALID_NAME; } +#endif diff --git a/cpukit/score/src/objectsetname.c b/cpukit/score/src/objectsetname.c index 417690555c..b7e01102ca 100644 --- a/cpukit/score/src/objectsetname.c +++ b/cpukit/score/src/objectsetname.c @@ -39,6 +39,7 @@ bool _Objects_Set_name( s = name; length = strnlen( name, information->name_length ) + 1; +#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; @@ -53,7 +54,9 @@ bool _Objects_Set_name( strncpy( d, name, length ); the_object->name.name_p = d; - } else { + } else +#endif + { the_object->name.name_u32 = _Objects_Build_name( ((0<length) ? s[ 0 ] : ' '), ((1<length) ? s[ 1 ] : ' '), diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index 452bc012d0..cc99bf668b 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/score/src/thread.c @@ -108,7 +108,7 @@ void _Thread_Handler_initialization(void) #endif sizeof( Thread_Control ), /* size of this object's control block */ - true, /* true if names for this object are strings */ + false, /* true if names for this object are strings */ 8 /* maximum length of each object's name */ #if defined(RTEMS_MULTIPROCESSING) , diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index 0ac1ec7ca0..1e12dd301c 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -40,7 +40,7 @@ void _Thread_Create_idle( void ) { Objects_Name name; - name.name_p = "IDLE"; + name.name_u32 = _Objects_Build_name( 'I', 'D', 'L', 'E' ); /* * The entire workspace is zeroed during its initialization. Thus, all |