From 8b0e752fee90af946e0e117ca7d46a7df7814d14 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Dec 2018 13:44:53 +0100 Subject: score: Remove Objects_Information::auto_extend Use Objects_Information::objects_per_block to provide this information. Add and use _Objects_Is_auto_extend(). Update #3621. --- cpukit/include/rtems/score/objectimpl.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'cpukit/include/rtems/score') diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h index e32533c8f3..bbf32fcd80 100644 --- a/cpukit/include/rtems/score/objectimpl.h +++ b/cpukit/include/rtems/score/objectimpl.h @@ -126,7 +126,12 @@ typedef struct { Objects_Control **local_table; /** This is the number of objects on the Inactive list. */ Objects_Maximum inactive; - /** This is the number of objects in a block. */ + /** + * @brief This is the number of objects in a block if the automatic extension + * is enabled. + * + * This member is zero if the automatic extension is disabled. + */ Objects_Maximum objects_per_block; /** This is the size in bytes of each object instance. */ uint16_t object_size; @@ -137,8 +142,6 @@ typedef struct { * (OBJECTS_NO_STRING_NAME). */ uint16_t name_length; - /** This is the true if unlimited objects in this class. */ - bool auto_extend; /** This is the chain of inactive control blocks. */ Chain_Control Inactive; /** This is the number of inactive objects per block. */ @@ -747,7 +750,7 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Extend_size( const Objects_Information *information ) { - return information->auto_extend ? information->objects_per_block : 0; + return information->objects_per_block; } /** @@ -858,6 +861,22 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index( return _Objects_Get_index( information->maximum_id ); } +/** + * @brief Returns true if the automatic object extension (unlimited objects) is + * enabled, otherwise false. + * + * @param[in] information The object information. + * + * @retval true The automatic object extension (unlimited objects) is enabled. + * @retval false Otherwise. + */ +RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Is_auto_extend( + const Objects_Information *information +) +{ + return information->objects_per_block != 0; +} + /** * This function sets the pointer to the local_table object * referenced by the index. -- cgit v1.2.3