diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-01-05 22:19:21 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-01-05 22:19:21 +0000 |
commit | 5870ac55678115857215a4199f519263599ee341 (patch) | |
tree | 8b6f044ae7cccc3da9a3bd69b2468c2ca77acff8 /cpukit/score/include/rtems/score | |
parent | Updated to reflect a time that had previously been left out due to (diff) | |
download | rtems-5870ac55678115857215a4199f519263599ee341.tar.bz2 |
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 <eric@cls.usask.ca> 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.
Diffstat (limited to 'cpukit/score/include/rtems/score')
-rw-r--r-- | cpukit/score/include/rtems/score/coremutex.h | 36 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/interr.h | 3 |
2 files changed, 35 insertions, 4 deletions
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index 73f92c76e0..32e4f40b5e 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -63,6 +63,35 @@ typedef enum { } CORE_mutex_Status; /* + * Mutex lock nesting behavior + * + * CORE_MUTEX_NESTING_ACQUIRES: + * This sequence has no blocking or errors: + * lock(m) + * lock(m) + * unlock(m) + * unlock(m) + * + * CORE_MUTEX_NESTING_IS_ERROR + * This sequence returns an error at the indicated point: + * lock(m) + * lock(m) - already locked error + * unlock(m) + * + * CORE_MUTEX_NESTING_BLOCKS + * This sequence performs as indicated: + * lock(m) + * lock(m) - deadlocks or timeouts + * unlock(m) - releases + */ + +typedef enum { + CORE_MUTEX_NESTING_ACQUIRES, + CORE_MUTEX_NESTING_IS_ERROR, + CORE_MUTEX_NESTING_BLOCKS +} CORE_mutex_Nesting_behaviors; + +/* * Locked and unlocked values */ @@ -75,9 +104,10 @@ typedef enum { */ typedef struct { - boolean allow_nesting; - CORE_mutex_Disciplines discipline; - Priority_Control priority_ceiling; + CORE_mutex_Nesting_behaviors lock_nesting_behavior; + boolean only_owner_release; + CORE_mutex_Disciplines discipline; + Priority_Control priority_ceiling; } CORE_mutex_Attributes; /* diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h index b2e92906fe..293957ec2b 100644 --- a/cpukit/score/include/rtems/score/interr.h +++ b/cpukit/score/include/rtems/score/interr.h @@ -53,7 +53,8 @@ typedef enum { INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS, INTERNAL_ERROR_OUT_OF_PROXIES, INTERNAL_ERROR_INVALID_GLOBAL_ID, - INTERNAL_ERROR_BAD_STACK_HOOK + INTERNAL_ERROR_BAD_STACK_HOOK, + INTERNAL_ERROR_BAD_ATTRIBUTES } Internal_errors_Core_list; /* |