diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-25 20:15:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:02 +0100 |
commit | 1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98 (patch) | |
tree | ff95b47443c47377f1e9bcb7790cffb4b6e59bb0 /cpukit/include/rtems/score/objectimpl.h | |
parent | score: Optimize object lookup (diff) | |
download | rtems-1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98.tar.bz2 |
score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().
Update #3621.
Diffstat (limited to 'cpukit/include/rtems/score/objectimpl.h')
-rw-r--r-- | cpukit/include/rtems/score/objectimpl.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h index a516e21c65..cf670b9c98 100644 --- a/cpukit/include/rtems/score/objectimpl.h +++ b/cpukit/include/rtems/score/objectimpl.h @@ -124,8 +124,6 @@ typedef struct { Objects_Id maximum_id; /** This points to the table of local objects. */ Objects_Control **local_table; - /** This is the maximum number of objects in this class. */ - Objects_Maximum maximum; /** This is the number of objects on the Inactive list. */ Objects_Maximum inactive; /** This is the number of objects in a block. */ @@ -851,6 +849,20 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Get_minimum_id( Objects_Id id ) } /** + * Returns the maximum index of the specified object class. + * + * @param[in] information The object information. + * + * @return The maximum index of the specified object class. + */ +RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index( + const Objects_Information *information +) +{ + return _Objects_Get_index( information->maximum_id ); +} + +/** * This function sets the pointer to the local_table object * referenced by the index. * @@ -876,7 +888,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object( * occur in normal situations. */ _Assert( index >= OBJECTS_INDEX_MINIMUM ); - _Assert( index <= information->maximum ); + _Assert( index <= _Objects_Get_maximum_index( information ) ); information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object; } |