Changeset 47988fb in rtems


Ignore:
Timestamp:
Sep 11, 2009, 2:54:29 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
7cc0554
Parents:
6dad79f
Message:

2009-09-11 Joel Sherrill <joel.sherrill@…>

  • 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.
Location:
cpukit
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r6dad79f r47988fb  
     12009-09-11      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/include/rtems/score/object.h,
     4        score/inline/rtems/score/object.inl,
     5        score/src/objectgetnameasstring.c, score/src/objectidtoname.c,
     6        score/src/objectinitializeinformation.c,
     7        score/src/objectnamespaceremove.c, score/src/objectnametoidstring.c,
     8        score/src/objectsetname.c, score/src/thread.c,
     9        score/src/threadcreateidle.c: Disable object string name support when
     10        POSIX is not enabled.
     11
    1122009-09-11      Joel Sherrill <joel.sherrill@OARcorp.com>
    213
  • cpukit/score/include/rtems/score/object.h

    r6dad79f r47988fb  
    2626#include <rtems/score/isr.h>
    2727
     28#if defined(RTEMS_POSIX_API)
     29  #define RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES
     30#endif
     31
    2832#ifdef __cplusplus
    2933extern "C" {
     
    4145 */
    4246typedef union {
    43   /** This is a pointer to a string name. */
    44   const char *name_p;
     47  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     48    /** This is a pointer to a string name. */
     49    const char *name_p;
     50  #endif
    4551  /** This is the actual 32-bit "raw" integer name. */
    4652  uint32_t    name_u32;
     
    356362  /** This is a table to the chain of inactive object memory blocks. */
    357363  void            **object_blocks;
    358   /** This is true if names are strings. */
    359   bool              is_string;
     364  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     365    /** This is true if names are strings. */
     366    bool              is_string;
     367  #endif
    360368  /** This is the maximum length of names. */
    361369  uint16_t          name_length;
    362370  /** This is this object class' method called when extracting a thread. */
    363371  Objects_Thread_queue_Extract_callout extract;
    364 #if defined(RTEMS_MULTIPROCESSING)
    365   /** This is this object class' pointer to the global name table */
    366   Chain_Control    *global_table;
    367 #endif
     372  #if defined(RTEMS_MULTIPROCESSING)
     373    /** This is this object class' pointer to the global name table */
     374    Chain_Control    *global_table;
     375  #endif
    368376}   Objects_Information;
    369377
     
    610618);
    611619
     620#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    612621/**
    613622 *  This method converts an object name to an Id.  It performs a look up
     
    628637  Objects_Id          *id
    629638);
     639#endif
    630640
    631641/**
  • cpukit/score/inline/rtems/score/object.inl

    r6dad79f r47988fb  
    337337  );
    338338
    339   /* ASSERT: information->is_string */
    340   the_object->name.name_p = name;
     339  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     340    /* ASSERT: information->is_string */
     341    the_object->name.name_p = name;
     342  #endif
    341343}
    342344
  • cpukit/score/src/objectgetnameasstring.c

    r6dad79f r47988fb  
    6666    case OBJECTS_LOCAL:
    6767
    68       if ( information->is_string ) {
    69         s = the_object->name.name_p;
    70       } else {
     68      #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     69        if ( information->is_string ) {
     70          s = the_object->name.name_p;
     71        } else
     72      #endif
     73      {
    7174        uint32_t  u32_name = (uint32_t) the_object->name.name_u32;
    7275
  • cpukit/score/src/objectidtoname.c

    r6dad79f r47988fb  
    6767    return OBJECTS_INVALID_ID;
    6868
    69   if ( information->is_string )
    70     return OBJECTS_INVALID_ID;
     69  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     70    if ( information->is_string )
     71      return OBJECTS_INVALID_ID;
     72  #endif
    7173
    7274  the_object = _Objects_Get( information, tmpId, &ignored_location );
  • cpukit/score/src/objectinitializeinformation.c

    r6dad79f r47988fb  
    7272  information->the_api            = the_api;
    7373  information->the_class          = the_class;
     74#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    7475  information->is_string          = is_string;
     76#endif
    7577
    7678  information->local_table        = 0;
  • cpukit/score/src/objectnamespaceremove.c

    r6dad79f r47988fb  
    2323)
    2424{
    25   /*
    26    *  If this is a string format name, then free the memory.
    27    */
    28   if ( information->is_string && the_object->name.name_p )
    29      _Workspace_Free( (void *)the_object->name.name_p );
     25  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     26    /*
     27     *  If this is a string format name, then free the memory.
     28     */
     29    if ( information->is_string && the_object->name.name_p )
     30       _Workspace_Free( (void *)the_object->name.name_p );
     31  #endif
    3032
    3133  /*
    3234   * Clear out either format.
    3335   */
    34   the_object->name.name_p   = NULL;
     36  #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
     37    the_object->name.name_p   = NULL;
     38  #endif
    3539  the_object->name.name_u32 = 0;
    3640}
  • cpukit/score/src/objectnametoidstring.c

    r6dad79f r47988fb  
    1717#endif
    1818
     19#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    1920#include <string.h>
    2021
     
    8788  return OBJECTS_INVALID_NAME;
    8889}
     90#endif
  • cpukit/score/src/objectsetname.c

    r6dad79f r47988fb  
    4040  length = strnlen( name, information->name_length ) + 1;
    4141
     42#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    4243  if ( information->is_string ) {
    4344    char *d;
     
    5455    strncpy( d, name, length );
    5556    the_object->name.name_p = d;
    56   } else {
     57  } else
     58#endif
     59  {
    5760    the_object->name.name_u32 =  _Objects_Build_name(
    5861      ((0<length) ? s[ 0 ] : ' '),
  • cpukit/score/src/thread.c

    r6dad79f r47988fb  
    109109    sizeof( Thread_Control ),
    110110                                /* size of this object's control block */
    111     true,                       /* true if names for this object are strings */
     111    false,                      /* true if names for this object are strings */
    112112    8                           /* maximum length of each object's name */
    113113#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/score/src/threadcreateidle.c

    r6dad79f r47988fb  
    4141  Objects_Name name;
    4242
    43   name.name_p = "IDLE";
     43  name.name_u32 = _Objects_Build_name( 'I', 'D', 'L', 'E' );
    4444
    4545  /*
Note: See TracChangeset for help on using the changeset viewer.