Changeset 74d0cb44 in rtems


Ignore:
Timestamp:
Jan 31, 2008, 4:15:34 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
9602045
Parents:
403c507
Message:

2008-01-31 Joel Sherrill <joel.sherrill@…>

  • posix/src/cond.c, posix/src/key.c, posix/src/mqueuenametoid.c, posix/src/mutex.c, posix/src/pbarrier.c, posix/src/prwlock.c, posix/src/pspin.c, posix/src/pthread.c, posix/src/ptimer.c, posix/src/semaphorenametoid.c: Add option for all POSIX objects whether named or unnamed to have a string name. If the API does not directly support having a name, then the user must explicitly assign it using rtems_object_set_name().
  • rtems/src/rtemsobjectgetapiclassname.c: Improved testability.
  • score/include/rtems/score/object.h, score/src/objectgetnameasstring.c, score/src/objectnametoidstring.c, score/src/objectsetname.c: Modifications required to pass testing of recently modified object name operations. Also eliminated multiprocessing related code that was not reachable.
Location:
cpukit
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r403c507 r74d0cb44  
     12008-01-31      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * posix/src/cond.c, posix/src/key.c, posix/src/mqueuenametoid.c,
     4        posix/src/mutex.c, posix/src/pbarrier.c, posix/src/prwlock.c,
     5        posix/src/pspin.c, posix/src/pthread.c, posix/src/ptimer.c,
     6        posix/src/semaphorenametoid.c: Add option for all POSIX objects
     7        whether named or unnamed to have a string name.  If the API does
     8        not directly support having a name, then the user must explicitly
     9        assign it using rtems_object_set_name().
     10        * rtems/src/rtemsobjectgetapiclassname.c: Improved testability.
     11        * score/include/rtems/score/object.h,
     12        score/src/objectgetnameasstring.c, score/src/objectnametoidstring.c,
     13        score/src/objectsetname.c: Modifications required to pass testing of
     14        recently modified object name operations.  Also eliminated
     15        multiprocessing related code that was not reachable.
     16
    1172008-01-31      Jennifer Averett <jennifer.averett@OARcorp.com>
    218
  • cpukit/posix/src/cond.c

    r403c507 r74d0cb44  
    4949    sizeof( POSIX_Condition_variables_Control ),
    5050                                /* size of this object's control block */
    51     FALSE,                      /* TRUE if names for this object are strings */
    52     0                           /* maximum length of each object's name */
     51    TRUE,                       /* TRUE if names for this object are strings */
     52    _POSIX_PATH_MAX             /* maximum length of each object's name */
    5353#if defined(RTEMS_MULTIPROCESSING)
    5454    ,
  • cpukit/posix/src/key.c

    r403c507 r74d0cb44  
    4343    sizeof( POSIX_Keys_Control ),
    4444                                /* size of this object's control block */
    45     FALSE,                      /* TRUE if names for this object are strings */
    46     0                           /* maximum length of each object's name */
     45    TRUE,                       /* TRUE if names for this object are strings */
     46    _POSIX_PATH_MAX             /* maximum length of each object's name */
    4747#if defined(RTEMS_MULTIPROCESSING)
    4848    ,
  • cpukit/posix/src/mqueuenametoid.c

    r403c507 r74d0cb44  
    6565
    6666  status = _Objects_Name_to_id_string(
    67     &_POSIX_Message_queue_Information, name, 0, id );
     67    &_POSIX_Message_queue_Information, name, id );
    6868
    6969  if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL )
  • cpukit/posix/src/mutex.c

    r403c507 r74d0cb44  
    5050    sizeof( POSIX_Mutex_Control ),
    5151                                /* size of this object's control block */
    52     FALSE,                      /* TRUE if names for this object are strings */
    53     0                           /* maximum length of each object's name */
     52    TRUE,                       /* TRUE if names for this object are strings */
     53    _POSIX_PATH_MAX             /* maximum length of each object's name */
    5454#if defined(RTEMS_MULTIPROCESSING)
    5555    ,
  • cpukit/posix/src/pbarrier.c

    r403c507 r74d0cb44  
    5050    maximum_barriers,               /* maximum objects of this class */
    5151    sizeof( POSIX_Barrier_Control ),/* size of this object's control block */
    52     FALSE,                          /* TRUE if the name is a string */
    53     0                               /* maximum length of an object name */
     52    TRUE,                           /* TRUE if the name is a string */
     53    _POSIX_PATH_MAX             /* maximum length of each object's name */
    5454#if defined(RTEMS_MULTIPROCESSING)
    5555    ,
  • cpukit/posix/src/prwlock.c

    r403c507 r74d0cb44  
    3838    maximum_rwlocks,                /* maximum objects of this class */
    3939    sizeof( POSIX_RWLock_Control ), /* size of this object's control block */
    40     FALSE,                          /* TRUE if the name is a string */
    41     0                               /* maximum length of an object name */
     40    TRUE,                           /* TRUE if the name is a string */
     41    _POSIX_PATH_MAX             /* maximum length of each object's name */
    4242#if defined(RTEMS_MULTIPROCESSING)
    4343    ,
  • cpukit/posix/src/pspin.c

    r403c507 r74d0cb44  
    5050    maximum_spinlocks,               /* maximum objects of this class */
    5151    sizeof( POSIX_Spinlock_Control ),/* size of this object's control block */
    52     FALSE,                          /* TRUE if the name is a string */
    53     0                               /* maximum length of an object name */
     52    TRUE,                           /* TRUE if the name is a string */
     53    _POSIX_PATH_MAX             /* maximum length of each object's name */
    5454#if defined(RTEMS_MULTIPROCESSING)
    5555    ,
  • cpukit/posix/src/pthread.c

    r403c507 r74d0cb44  
    340340    sizeof( Thread_Control ),
    341341                                 /* size of this object's control block */
    342     FALSE,                       /* TRUE if names for this object are strings */
    343     0                            /* maximum length of each object's name */
     342    TRUE,                        /* TRUE if names for this object are strings */
     343    _POSIX_PATH_MAX             /* maximum length of each object's name */
    344344#if defined(RTEMS_MULTIPROCESSING)
    345345    ,
  • cpukit/posix/src/ptimer.c

    r403c507 r74d0cb44  
    5858    sizeof( POSIX_Timer_Control ),
    5959                                /* size of this object's control block */
    60     FALSE,                      /* TRUE if names for this object are strings */
     60    TRUE,                       /* TRUE if names for this object are strings */
    6161    _POSIX_PATH_MAX             /* maximum length of each object's name */
    6262#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/posix/src/semaphorenametoid.c

    r403c507 r74d0cb44  
    5050
    5151  status = _Objects_Name_to_id_string(
    52     &_POSIX_Semaphore_Information, name, 0, (Objects_Id*)id );
     52    &_POSIX_Semaphore_Information, name, (Objects_Id*)id );
    5353
    5454  if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL )
  • cpukit/rtems/src/rtemsobjectgetapiclassname.c

    r403c507 r74d0cb44  
    7878  const rtems_assoc_t *class_assoc;
    7979 
    80   switch (the_api) {
    81     case OBJECTS_INTERNAL_API:
    82       api_assoc = rtems_object_api_internal_assoc;
    83       break;
    84     case OBJECTS_CLASSIC_API:
    85       api_assoc = rtems_object_api_classic_assoc;
    86       break;
     80  if ( the_api == OBJECTS_INTERNAL_API )
     81    api_assoc = rtems_object_api_internal_assoc;
     82  else if ( the_api == OBJECTS_CLASSIC_API )
     83    api_assoc = rtems_object_api_classic_assoc;
    8784#ifdef RTEMS_POSIX_API
    88     case OBJECTS_POSIX_API:
    89       api_assoc = rtems_object_api_posix_assoc;
    90       break;
     85  else if ( the_api == OBJECTS_POSIX_API )
     86    api_assoc = rtems_object_api_posix_assoc;
    9187#endif
    9288#ifdef RTEMS_ITRON_API
    93     case OBJECTS_ITRON_API:
    94       api_assoc = rtems_object_api_itron_assoc;
    95       break;
     89  else if ( the_api == OBJECTS_ITRON_API )
     90    api_assoc = rtems_object_api_itron_assoc;
    9691#endif
    97     default:
    98       return "BAD API";
    99   }
     92  else
     93    return "BAD API";
    10094  class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
    10195  if ( class_assoc )
  • cpukit/score/include/rtems/score/object.h

    r403c507 r74d0cb44  
    626626 *  @param[in] information points to an object class information block.
    627627 *  @param[in] name is the name of the object to find.
    628  *  @param[in] node is the set of nodes to search.
    629628 *  @param[in] id will contain the Id if the search is successful.
    630629 *
     
    637636  Objects_Information *information,
    638637  const char          *name,
    639   uint32_t             node,
    640638  Objects_Id          *id
    641639);
  • cpukit/score/src/objectgetnameasstring.c

    r403c507 r74d0cb44  
    3535)
    3636{
    37   Objects_Information *information;
     37  Objects_Information   *information;
    3838  const char            *s;
    3939  char                  *d;
     
    7878      }
    7979
    80       for ( i=0, d=name ; i<(length-1) && *s ; i++, s++, d++ ) {
    81         *d = (!isprint(*s)) ?  '*' : *s;
     80      d = name;
     81      if ( s ) {
     82        for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) {
     83          *d = (isprint(*s)) ? *s : '*';
     84        }
    8285      }
    8386      *d = '\0';
  • cpukit/score/src/objectnametoidstring.c

    r403c507 r74d0cb44  
    4141 *    information - object information
    4242 *    name        - user defined object name
    43  *    node        - node indentifier (0 indicates any node)
    4443 *    id          - address of return ID
    4544 *
     
    5352  Objects_Information *information,
    5453  const char          *name,
    55   uint32_t             node,
    5654  Objects_Id          *id
    5755)
    5856{
    59   boolean                    search_local_node;
    6057  Objects_Control           *the_object;
    6158  uint32_t                   index;
     
    7370    return OBJECTS_INVALID_NAME;
    7471
    75   search_local_node = FALSE;
    76 
    77   if ( information->maximum != 0 &&
    78       (node == OBJECTS_SEARCH_ALL_NODES ||
    79        node == OBJECTS_SEARCH_LOCAL_NODE ||
    80        _Objects_Is_local_node( node )
    81       ))
    82    search_local_node = TRUE;
    83 
    84   if ( search_local_node ) {
     72  if ( information->maximum != 0 ) {
    8573    name_length = information->name_length;
    8674
     
    10088  }
    10189
    102 #if defined(RTEMS_MULTIPROCESSING)
    103   if ( _Objects_Is_local_node( node ) || node == OBJECTS_SEARCH_LOCAL_NODE )
    104     return OBJECTS_INVALID_NAME;
    105 
    106   name_for_mp.name_p = name;
    107   return _Objects_MP_Global_name_search( information, name_for_mp, node, id );
    108 #else
    10990  return OBJECTS_INVALID_NAME;
    110 #endif
    11191}
  • cpukit/score/src/objectsetname.c

    r403c507 r74d0cb44  
    4848      return FALSE;
    4949
    50     if ( the_object->name.name_p )
     50    if ( the_object->name.name_p ) {
    5151      _Workspace_Free( (void *)the_object->name.name_p );
    52 
    53     the_object->name.name_p = NULL;
     52      the_object->name.name_p = NULL;
     53    }
    5454
    5555    strncpy( d, name, length );
    5656    the_object->name.name_p = d;
    5757  } else {
    58     uint32_t  name_u32 = 0;
    59     char      lname[5] = "    ";
    60     int       i;
     58    the_object->name.name_u32 =  _Objects_Build_name(
     59      ((0<length) ? s[ 0 ] : ' '),
     60      ((1<length) ? s[ 1 ] : ' '),
     61      ((2<length) ? s[ 2 ] : ' '),
     62      ((3<length) ? s[ 3 ] : ' ')
     63    );
    6164
    62     for ( i=0 ; i<4 && i<length ; i++ )
    63       lname[ i ] = s[ i ];
    64 
    65     name_u32 |= ((uint32_t)lname[ 0 ] << 24);
    66     name_u32 |= ((uint32_t)lname[ 1 ] << 16);
    67     name_u32 |= ((uint32_t)lname[ 2 ] << 8);
    68     name_u32 |=  (uint32_t)lname[ 3 ];
    69     the_object->name.name_u32 = name_u32;
    7065  }
    7166
Note: See TracChangeset for help on using the changeset viewer.