Changeset 9184270 in rtems


Ignore:
Timestamp:
Feb 6, 2008, 11:54:55 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
78b4e2e
Parents:
6728035
Message:

2008-02-06 Joel Sherrill <joel.sherrill@…>

  • posix/src/mqueueunlink.c, score/Makefile.am, score/include/rtems/score/object.h, score/inline/rtems/score/object.inl: Enhance _Objects_Namespace_remove() to handle freeing object names which are strings. All changed _Objects_Close() to call _Objects_Namespace_remove(). The resulting code was then moved from inline routines to function calls.
  • score/src/objectclose.c, score/src/objectnamespaceremove.c: New files.
Location:
cpukit
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r6728035 r9184270  
     12008-02-06      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * posix/src/mqueueunlink.c, score/Makefile.am,
     4        score/include/rtems/score/object.h,
     5        score/inline/rtems/score/object.inl: Enhance
     6        _Objects_Namespace_remove() to handle freeing object names which are
     7        strings. All changed _Objects_Close() to call
     8        _Objects_Namespace_remove(). The resulting code was then moved from
     9        inline routines to function calls.
     10        * score/src/objectclose.c, score/src/objectnamespaceremove.c: New files.
     11
    1122008-02-06      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • cpukit/posix/src/mqueueunlink.c

    r6728035 r9184270  
    6868
    6969  the_mq->linked = FALSE;
    70   if ( the_mq->Object.name.name_p )
    71     _Workspace_Free( (void *)the_mq->Object.name.name_p );
    7270  _POSIX_Message_queue_Namespace_remove( the_mq );
    7371  _POSIX_Message_queue_Delete( the_mq );
  • cpukit/score/Makefile.am

    r6728035 r9184270  
    113113
    114114## OBJECT_C_FILES
    115 libscore_a_SOURCES += src/object.c src/objectallocate.c \
     115libscore_a_SOURCES += src/object.c src/objectallocate.c src/objectclose.c \
    116116    src/objectextendinformation.c src/objectfree.c src/objectget.c \
    117117    src/objectgetisr.c src/objectgetnext.c src/objectinitializeinformation.c \
     
    119119    src/objectshrinkinformation.c src/objectgetnoprotection.c \
    120120    src/objectidtoname.c src/objectgetnameasstring.c src/objectsetname.c \
    121     src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c
     121    src/objectgetinfo.c src/objectgetinfoid.c src/objectapimaximumclass.c \
     122    src/objectnamespaceremove.c
    122123
    123124## OBJECT_C_FILES only used by ITRON API
  • cpukit/score/include/rtems/score/object.h

    r6728035 r9184270  
    861861);
    862862
     863/**
     864 *  This function removes the_object from the namespace.
     865 *
     866 *  @param[in] information points to an Object Information Table
     867 *  @param[in] the_object is a pointer to an object
     868 */
     869void _Objects_Namespace_remove(
     870  Objects_Information  *information,
     871  Objects_Control      *the_object
     872);
     873
     874/**
     875 *  This function removes the_object control pointer and object name
     876 *  in the Local Pointer and Local Name Tables.
     877 *
     878 *  @param[in] information points to an Object Information Table
     879 *  @param[in] the_object is a pointer to an object
     880 */
     881void _Objects_Close(
     882  Objects_Information  *information,
     883  Objects_Control      *the_object
     884);
     885
    863886/*
    864887 *  Pieces of object.inl are promoted out to the user
  • cpukit/score/inline/rtems/score/object.inl

    r6728035 r9184270  
    6565 *  @param[in] id is the object Id to be processed
    6666 */
    67 RTEMS_INLINE_ROUTINE uint32_t   _Objects_Get_class(
    68   Objects_Id id
    69 )
    70 {
    71   return (uint32_t  )
     67RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class(
     68  Objects_Id id
     69)
     70{
     71  return (uint32_t)
    7272    ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
    7373}
     
    8080 *  @return This method returns the node portion of an object ID.
    8181 */
    82 RTEMS_INLINE_ROUTINE uint32_t   _Objects_Get_node(
     82RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_node(
    8383  Objects_Id id
    8484)
     
    9494 *  @return This method returns the class portion of the specified object ID.
    9595 */
    96 RTEMS_INLINE_ROUTINE uint32_t   _Objects_Get_index(
     96RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_index(
    9797  Objects_Id id
    9898)
     
    118118}
    119119   
    120 /**
    121  *  This function returns TRUE if the class is valid.
    122  *
    123  *  @param[in] the_class is the class portion of an object ID.
    124  *
    125  *  @return This method returns TRUE if the specified class value is valid
    126  *          and FALSE otherwise.
    127  */
    128 RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
    129   uint32_t   the_class
    130 )
    131 {
    132   /* XXX how do we determine this now? */
    133   return TRUE; /* the_class && the_class <= OBJECTS_CLASSES_LAST; */
    134 }
    135 
    136120/**
    137121 *  This function returns TRUE if the node is of the local object, and
     
    258242)
    259243{
    260   uint32_t    index;
    261 
    262   index = _Objects_Get_index( the_object->id );
    263   _Objects_Set_local_object( information, index, the_object );
    264 
    265   the_object->name = name;
    266 }
    267 
    268 /**
    269  *  This function places the_object control pointer and object name
    270  *  in the Local Pointer and Local Name Tables, respectively.
    271  *
    272  *  @param[in] information points to an Object Information Table
    273  *  @param[in] the_object is a pointer to an object
    274  *  @param[in] name is the name of the object to make accessible
    275  */
    276 RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
    277   Objects_Information *information,
    278   Objects_Control     *the_object,
    279   uint32_t             name
    280 )
    281 {
    282   uint32_t    index;
    283 
    284   index = _Objects_Get_index( the_object->id );
    285   _Objects_Set_local_object( information, index, the_object );
    286 
    287   /* ASSERT: information->is_string == FALSE */
    288   the_object->name.name_u32 = name;
    289 }
    290 
    291 /**
    292  *  This function places the_object control pointer and object name
    293  *  in the Local Pointer and Local Name Tables, respectively.
    294  *
    295  *  @param[in] information points to an Object Information Table
    296  *  @param[in] the_object is a pointer to an object
    297  *  @param[in] name is the name of the object to make accessible
    298  */
    299 RTEMS_INLINE_ROUTINE void _Objects_Open_string(
    300   Objects_Information *information,
    301   Objects_Control     *the_object,
    302   const char          *name
    303 )
    304 {
    305   uint32_t    index;
    306 
    307   index = _Objects_Get_index( the_object->id );
    308   _Objects_Set_local_object( information, index, the_object );
    309 
    310   /* information->is_string */
    311   the_object->name.name_p = name;
    312 }
    313 
    314 /**
    315  *  This function removes the_object control pointer and object name
    316  *  in the Local Pointer and Local Name Tables.
    317  *
    318  *  @param[in] information points to an Object Information Table
    319  *  @param[in] the_object is a pointer to an object
    320  */
    321 RTEMS_INLINE_ROUTINE void _Objects_Close(
    322   Objects_Information  *information,
    323   Objects_Control      *the_object
    324 )
    325 {
    326244  _Objects_Set_local_object(
    327245    information,
    328246    _Objects_Get_index( the_object->id ),
    329     NULL
     247    the_object
    330248  );
    331249
    332   the_object->name.name_u32 = 0;
    333   the_object->name.name_p   = NULL;
    334 }
    335 
    336 /**
    337  *  This function removes the_object from the namespace.
     250  the_object->name = name;
     251}
     252
     253/**
     254 *  This function places the_object control pointer and object name
     255 *  in the Local Pointer and Local Name Tables, respectively.
    338256 *
    339257 *  @param[in] information points to an Object Information Table
    340258 *  @param[in] the_object is a pointer to an object
    341  */
    342 RTEMS_INLINE_ROUTINE void _Objects_Namespace_remove(
    343   Objects_Information  *information,
    344   Objects_Control      *the_object
    345 )
    346 {
    347   /*
    348    * Clear out either format.
    349    */
    350   the_object->name.name_p   = NULL;
    351   the_object->name.name_u32 = 0;
     259 *  @param[in] name is the name of the object to make accessible
     260 */
     261RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
     262  Objects_Information *information,
     263  Objects_Control     *the_object,
     264  uint32_t             name
     265)
     266{
     267  _Objects_Set_local_object(
     268    information,
     269    _Objects_Get_index( the_object->id ),
     270    the_object
     271  );
     272
     273  /* ASSERT: information->is_string == FALSE */
     274  the_object->name.name_u32 = name;
     275}
     276
     277/**
     278 *  This function places the_object control pointer and object name
     279 *  in the Local Pointer and Local Name Tables, respectively.
     280 *
     281 *  @param[in] information points to an Object Information Table
     282 *  @param[in] the_object is a pointer to an object
     283 *  @param[in] name is the name of the object to make accessible
     284 */
     285RTEMS_INLINE_ROUTINE void _Objects_Open_string(
     286  Objects_Information *information,
     287  Objects_Control     *the_object,
     288  const char          *name
     289)
     290{
     291  _Objects_Set_local_object(
     292    information,
     293    _Objects_Get_index( the_object->id ),
     294    the_object
     295  );
     296
     297  /* ASSERT: information->is_string */
     298  the_object->name.name_p = name;
    352299}
    353300
Note: See TracChangeset for help on using the changeset viewer.