source: rtems/c/src/exec/score/inline/rtems/score/coremutex.inl @ 5870ac55

4.104.114.84.95
Last change on this file since 5870ac55 was 5870ac55, checked in by Joel Sherrill <joel.sherrill@…>, on 01/05/00 at 22:19:21

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@…> 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.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*  inline/coremutex.inl
2 *
3 *  This include file contains all of the inlined routines associated
4 *  with the CORE mutexes.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#ifndef __INLINE_CORE_MUTEX_inl
17#define __INLINE_CORE_MUTEX_inl
18
19/*PAGE
20 *
21 *  _CORE_mutex_Is_locked
22 *
23 *  DESCRIPTION:
24 *
25 *  This routine returns TRUE if the mutex specified is locked and FALSE
26 *  otherwise.
27 */
28 
29RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_locked(
30  CORE_mutex_Control  *the_mutex
31)
32{
33  return the_mutex->lock == CORE_MUTEX_LOCKED;
34}
35 
36/*PAGE
37 *
38 *  _CORE_mutex_Is_fifo
39 *
40 *  DESCRIPTION:
41 *
42 *  This routine returns TRUE if the mutex's wait discipline is FIFO and FALSE
43 *  otherwise.
44 */
45 
46RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_fifo(
47  CORE_mutex_Attributes *the_attribute
48)
49{
50  return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO;
51}
52 
53/*PAGE
54 *
55 *  _CORE_mutex_Is_priority
56 *
57 *  DESCRIPTION:
58 *
59 *  This routine returns TRUE if the mutex's wait discipline is PRIORITY and
60 *  FALSE otherwise.
61 */
62 
63RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority(
64  CORE_mutex_Attributes *the_attribute
65)
66{
67  return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY;
68}
69 
70/*PAGE
71 *
72 *  _CORE_mutex_Is_inherit_priority
73 *
74 *  DESCRIPTION:
75 *
76 *  This routine returns TRUE if the mutex's wait discipline is
77 *  INHERIT_PRIORITY and FALSE otherwise.
78 */
79 
80RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority(
81  CORE_mutex_Attributes *the_attribute
82)
83{
84  return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT;
85}
86 
87/*PAGE
88 *
89 *  _CORE_mutex_Is_priority_ceiling
90 *
91 *  DESCRIPTION:
92 *
93 *  This routine returns TRUE if the mutex's wait discipline is
94 *  PRIORITY_CEILING and FALSE otherwise.
95 */
96 
97RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling(
98  CORE_mutex_Attributes *the_attribute
99)
100{
101  return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING;
102}
103 
104#endif
105/* end of include file */
Note: See TracBrowser for help on using the repository browser.