From 21275b58a5a69c3c838082ffc8a7a3641f32ea9a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 22 Nov 2018 19:14:51 +0100 Subject: score: Static Objects_Information initialization Statically allocate the objects information together with the initial set of objects either via . Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621. --- cpukit/include/rtems/score/object.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'cpukit/include/rtems/score/object.h') diff --git a/cpukit/include/rtems/score/object.h b/cpukit/include/rtems/score/object.h index e7861ecab1..f75d1de2ab 100644 --- a/cpukit/include/rtems/score/object.h +++ b/cpukit/include/rtems/score/object.h @@ -307,18 +307,11 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_index( * * @return This method returns an object Id constructed from the arguments. */ -RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id( - Objects_APIs the_api, - uint16_t the_class, - uint8_t node, - uint16_t index -) -{ - return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | - (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | - (( (Objects_Id) node ) << OBJECTS_NODE_START_BIT) | - (( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT); -} +#define _Objects_Build_id( the_api, the_class, node, index ) \ + ( (Objects_Id) ( (Objects_Id) the_api << OBJECTS_API_START_BIT ) | \ + ( (Objects_Id) the_class << OBJECTS_CLASS_START_BIT ) | \ + ( (Objects_Id) node << OBJECTS_NODE_START_BIT ) | \ + ( (Objects_Id) index << OBJECTS_INDEX_START_BIT ) ) /** * Returns if the object maximum specifies unlimited objects. @@ -328,10 +321,8 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id( * @retval true Unlimited objects are available. * @retval false The object count is fixed. */ -RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum ) -{ - return (maximum & OBJECTS_UNLIMITED_OBJECTS) != 0; -} +#define _Objects_Is_unlimited( maximum ) \ + ( ( ( maximum ) & OBJECTS_UNLIMITED_OBJECTS ) != 0 ) /* * We cannot use an inline function for this since it may be evaluated at -- cgit v1.2.3