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 | |
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')
-rw-r--r-- | cpukit/ChangeLog | 11 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/object.h | 26 | ||||
-rw-r--r-- | cpukit/score/inline/rtems/score/object.inl | 6 | ||||
-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 |
11 files changed, 63 insertions, 24 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 312c886108..f0db75d2a1 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,16 @@ 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. + +2009-09-11 Joel Sherrill <joel.sherrill@OARcorp.com> + * libmisc/capture/capture.c: Use public API to obtain object name. 2009-09-09 Sebastian Huber <Sebastian.Huber@embedded-brains.de> diff --git a/cpukit/score/include/rtems/score/object.h b/cpukit/score/include/rtems/score/object.h index 5cf770ef91..c8e3036a7c 100644 --- a/cpukit/score/include/rtems/score/object.h +++ b/cpukit/score/include/rtems/score/object.h @@ -25,6 +25,10 @@ #include <rtems/score/chain.h> #include <rtems/score/isr.h> +#if defined(RTEMS_POSIX_API) + #define RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES +#endif + #ifdef __cplusplus extern "C" { #endif @@ -40,8 +44,10 @@ extern "C" { * object names. */ typedef union { - /** This is a pointer to a string name. */ - const char *name_p; + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + /** This is a pointer to a string name. */ + const char *name_p; + #endif /** This is the actual 32-bit "raw" integer name. */ uint32_t name_u32; } Objects_Name; @@ -355,16 +361,18 @@ typedef struct { uint32_t *inactive_per_block; /** This is a table to the chain of inactive object memory blocks. */ void **object_blocks; - /** This is true if names are strings. */ - bool is_string; + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + /** This is true if names are strings. */ + bool is_string; + #endif /** This is the maximum length of names. */ uint16_t name_length; /** This is this object class' method called when extracting a thread. */ Objects_Thread_queue_Extract_callout extract; -#if defined(RTEMS_MULTIPROCESSING) - /** This is this object class' pointer to the global name table */ - Chain_Control *global_table; -#endif + #if defined(RTEMS_MULTIPROCESSING) + /** This is this object class' pointer to the global name table */ + Chain_Control *global_table; + #endif } Objects_Information; /** @@ -609,6 +617,7 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_u32( Objects_Id *id ); +#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /** * This method converts an object name to an Id. It performs a look up * using the object information block for this object class. @@ -627,6 +636,7 @@ Objects_Name_or_id_lookup_errors _Objects_Name_to_id_string( const char *name, Objects_Id *id ); +#endif /** * This function implements the common portion of the object Id diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl index 8bb88e831a..ced5e75a9d 100644 --- a/cpukit/score/inline/rtems/score/object.inl +++ b/cpukit/score/inline/rtems/score/object.inl @@ -336,8 +336,10 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string( the_object ); - /* ASSERT: information->is_string */ - the_object->name.name_p = name; + #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) + /* ASSERT: information->is_string */ + the_object->name.name_p = name; + #endif } #endif 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 |