Ignore:
Timestamp:
Oct 25, 2018, 10:05:53 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
55b69ed
Parents:
5090a71b
git-author:
Sebastian Huber <sebastian.huber@…> (10/25/18 10:05:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/29/18 09:33:33)
Message:

Remove RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES

Enable support for string objects names unconditionally. Add const
qualifier throughout. Split _Objects_Namespace_remove() into
_Objects_Namespace_remove_u32() and _Objects_Namespace_remove_string()
to avoid an unnecessary dependency on _Workspace_Free().

Update #2514.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/objectimpl.h

    r5090a71b r7038271  
    131131  /** This is the maximum number of objects in this class. */
    132132  Objects_Maximum   maximum;
     133  /** This is true if names are strings. */
     134  bool              is_string;
    133135  /** This is the true if unlimited objects in this class. */
    134136  bool              auto_extend;
     
    147149  /** This is a table to the chain of inactive object memory blocks. */
    148150  void            **object_blocks;
    149   #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    150     /** This is true if names are strings. */
    151     bool              is_string;
    152   #endif
    153151  /** This is the maximum length of names. */
    154152  uint16_t          name_length;
     
    686684 */
    687685bool _Objects_Set_name(
    688   Objects_Information *information,
    689   Objects_Control     *the_object,
    690   const char          *name
    691 );
    692 
    693 /**
    694  *  @brief Removes object from namespace.
    695  *
    696  *  This function removes @a the_object from the namespace.
    697  *
    698  *  @param[in] information points to an Object Information Table.
    699  *  @param[in] the_object is a pointer to an object.
    700  */
    701 void _Objects_Namespace_remove(
    702   Objects_Information  *information,
    703   Objects_Control      *the_object
     686  const Objects_Information *information,
     687  Objects_Control           *the_object,
     688  const char                *name
     689);
     690
     691/**
     692 * @brief Removes object with a 32-bit integer name from its namespace.
     693 *
     694 * @param[in] information The corresponding object information table.
     695 * @param[in] the_object The object.
     696 */
     697void _Objects_Namespace_remove_u32(
     698  const Objects_Information *information,
     699  Objects_Control           *the_object
     700);
     701
     702/**
     703 * @brief Removes object with a string name from its namespace.
     704 *
     705 * @param[in] information The corresponding object information table.
     706 * @param[in] the_object The object.
     707 */
     708void _Objects_Namespace_remove_string(
     709  const Objects_Information *information,
     710  Objects_Control           *the_object
    704711);
    705712
     
    714721 */
    715722void _Objects_Close(
    716   Objects_Information *information,
    717   Objects_Control      *the_object
     723  const Objects_Information *information,
     724  Objects_Control           *the_object
    718725);
    719726
     
    829836
    830837RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
    831   Objects_Information *information,
    832   uint32_t             index,
    833   Objects_Control     *the_object
     838  const Objects_Information *information,
     839  uint32_t                   index,
     840  Objects_Control           *the_object
    834841)
    835842{
     
    839846   *  occur in normal situations.
    840847   */
    841   #if defined(RTEMS_DEBUG)
    842     if ( index > information->maximum )
    843       return;
    844   #endif
     848  _Assert( index <= information->maximum );
    845849
    846850  information->local_table[ index ] = the_object;
     
    862866
    863867RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id(
    864   Objects_Information *information,
    865   Objects_Control      *the_object
     868  const Objects_Information *information,
     869  Objects_Control           *the_object
    866870)
    867871{
     
    911915 */
    912916RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
    913   Objects_Information *information,
    914   Objects_Control     *the_object,
    915   uint32_t             name
     917  const Objects_Information *information,
     918  Objects_Control           *the_object,
     919  uint32_t                   name
    916920)
    917921{
    918   /* ASSERT: information->is_string == false */
     922  _Assert( !information->is_string );
    919923  the_object->name.name_u32 = name;
    920924
     
    935939 */
    936940RTEMS_INLINE_ROUTINE void _Objects_Open_string(
    937   Objects_Information *information,
    938   Objects_Control     *the_object,
    939   const char          *name
     941  const Objects_Information *information,
     942  Objects_Control           *the_object,
     943  const char                *name
    940944)
    941945{
    942   #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
    943     /* ASSERT: information->is_string */
    944     the_object->name.name_p = name;
    945   #endif
     946  _Assert( information->is_string );
     947  the_object->name.name_p = name;
    946948
    947949  _Objects_Set_local_object(
Note: See TracChangeset for help on using the changeset viewer.