From 5eb434e67ed31111eb90b92cf75248f2ff9d1086 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 11 Apr 2012 15:04:22 +0200 Subject: score: New macros and functions New macros o _Objects_Maximum_per_allocation(), o rtems_resource_is_unlimited(), and o rtems_resource_maximum_per_allocation(). New function o _Objects_Is_unlimited(). --- cpukit/score/inline/rtems/score/object.inl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpukit/score/inline/rtems/score') diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl index ac07e68235..6a4fe21037 100644 --- a/cpukit/score/inline/rtems/score/object.inl +++ b/cpukit/score/inline/rtems/score/object.inl @@ -352,5 +352,25 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string( #endif } +/** + * Returns if the object maximum specifies unlimited objects. + * + * @param[in] maximum The object maximum specification. + * + * @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; +} + +/* + * We cannot use an inline function for this since it may be evaluated at + * compile time. + */ +#define _Objects_Maximum_per_allocation( maximum ) \ + ((Objects_Maximum) ((maximum) & ~OBJECTS_UNLIMITED_OBJECTS)) + #endif /* end of include file */ -- cgit v1.2.3