From 5870ac55678115857215a4199f519263599ee341 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Jan 2000 22:19:21 +0000 Subject: Added support for simple binary semaphores in addition to the high power binary/mutex style semaphores already supported by RTEMS. This was done at the request of Eric Norum in support of his effort to port EPICS to RTEMS. This change consisted of changing the nesting_allowed boolean into a lock_nesting_behavior enumerated value as well as allowing the core mutex object to optionally support ensuring that the holder of a binary semaphore released it. Finally, a more subtle enhancement was to allow the non-holder to release a priority inheritance/ceiling mutex and still allow the holding task to return to its original priority. --- cpukit/rtems/macros/rtems/rtems/attr.inl | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'cpukit/rtems/macros/rtems/rtems') diff --git a/cpukit/rtems/macros/rtems/rtems/attr.inl b/cpukit/rtems/macros/rtems/rtems/attr.inl index 516752b7d1..56ccac6657 100644 --- a/cpukit/rtems/macros/rtems/rtems/attr.inl +++ b/cpukit/rtems/macros/rtems/rtems/attr.inl @@ -68,7 +68,25 @@ */ #define _Attributes_Is_binary_semaphore( _attribute_set ) \ - ( (_attribute_set) & RTEMS_BINARY_SEMAPHORE ) + (((_attribute_set) & RTEMS_SEMAPHORE_CLASS) == RTEMS_BINARY_SEMAPHORE) + +/*PAGE + * + * _Attributes_Is_simple_binary_semaphore + * + */ + +#define _Attributes_Is_simple_binary_semaphore( _attribute_set ) \ + (((_attribute_set) & RTEMS_SEMAPHORE_CLASS) == RTEMS_SIMPLE_BINARY_SEMAPHORE) + +/*PAGE + * + * _Attributes_Is_counting_semaphore + * + */ + +#define _Attributes_Is_counting_semaphore( _attribute_set ) \ + (((_attribute_set) & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE) /*PAGE * @@ -88,15 +106,6 @@ #define _Attributes_Is_priority_ceiling( _attribute_set ) \ ( (_attribute_set) & RTEMS_PRIORITY_CEILING ) -/*PAGE - * - * _Attributes_Is_nesting_allowed - * - */ - -#define _Attributes_Is_nesting_allowed( _attribute_set ) \ - ( !((_attribute_set) & RTEMS_NO_NESTING_ALLOWED) ) - /*PAGE * * _Attributes_Is_system_task -- cgit v1.2.3