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-1998. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * Copyright assigned to U.S. Government, 1994. |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.OARcorp.com/rtems/license.html. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef __INLINE_CORE_MUTEX_inl |
---|
18 | #define __INLINE_CORE_MUTEX_inl |
---|
19 | |
---|
20 | /*PAGE |
---|
21 | * |
---|
22 | * _CORE_mutex_Is_locked |
---|
23 | * |
---|
24 | * DESCRIPTION: |
---|
25 | * |
---|
26 | * This routine returns TRUE if the mutex specified is locked and FALSE |
---|
27 | * otherwise. |
---|
28 | */ |
---|
29 | |
---|
30 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_locked( |
---|
31 | CORE_mutex_Control *the_mutex |
---|
32 | ) |
---|
33 | { |
---|
34 | return the_mutex->lock == CORE_MUTEX_LOCKED; |
---|
35 | } |
---|
36 | |
---|
37 | /*PAGE |
---|
38 | * |
---|
39 | * _CORE_mutex_Is_fifo |
---|
40 | * |
---|
41 | * DESCRIPTION: |
---|
42 | * |
---|
43 | * This routine returns TRUE if the mutex's wait discipline is FIFO and FALSE |
---|
44 | * otherwise. |
---|
45 | */ |
---|
46 | |
---|
47 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_fifo( |
---|
48 | CORE_mutex_Attributes *the_attribute |
---|
49 | ) |
---|
50 | { |
---|
51 | return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_FIFO; |
---|
52 | } |
---|
53 | |
---|
54 | /*PAGE |
---|
55 | * |
---|
56 | * _CORE_mutex_Is_priority |
---|
57 | * |
---|
58 | * DESCRIPTION: |
---|
59 | * |
---|
60 | * This routine returns TRUE if the mutex's wait discipline is PRIORITY and |
---|
61 | * FALSE otherwise. |
---|
62 | */ |
---|
63 | |
---|
64 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority( |
---|
65 | CORE_mutex_Attributes *the_attribute |
---|
66 | ) |
---|
67 | { |
---|
68 | return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY; |
---|
69 | } |
---|
70 | |
---|
71 | /*PAGE |
---|
72 | * |
---|
73 | * _CORE_mutex_Is_inherit_priority |
---|
74 | * |
---|
75 | * DESCRIPTION: |
---|
76 | * |
---|
77 | * This routine returns TRUE if the mutex's wait discipline is |
---|
78 | * INHERIT_PRIORITY and FALSE otherwise. |
---|
79 | */ |
---|
80 | |
---|
81 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority( |
---|
82 | CORE_mutex_Attributes *the_attribute |
---|
83 | ) |
---|
84 | { |
---|
85 | return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; |
---|
86 | } |
---|
87 | |
---|
88 | /*PAGE |
---|
89 | * |
---|
90 | * _CORE_mutex_Is_priority_ceiling |
---|
91 | * |
---|
92 | * DESCRIPTION: |
---|
93 | * |
---|
94 | * This routine returns TRUE if the mutex's wait discipline is |
---|
95 | * PRIORITY_CEILING and FALSE otherwise. |
---|
96 | */ |
---|
97 | |
---|
98 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling( |
---|
99 | CORE_mutex_Attributes *the_attribute |
---|
100 | ) |
---|
101 | { |
---|
102 | return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; |
---|
103 | } |
---|
104 | |
---|
105 | /*PAGE |
---|
106 | * |
---|
107 | * _CORE_mutex_Is_nesting_allowed |
---|
108 | * |
---|
109 | * DESCRIPTION: |
---|
110 | * |
---|
111 | * This routine returns TRUE if the mutex allows a task to obtain a |
---|
112 | * semaphore more than once and nest. |
---|
113 | */ |
---|
114 | |
---|
115 | RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_nesting_allowed( |
---|
116 | CORE_mutex_Attributes *the_attribute |
---|
117 | ) |
---|
118 | { |
---|
119 | return the_attribute->allow_nesting == TRUE; |
---|
120 | |
---|
121 | } |
---|
122 | |
---|
123 | #endif |
---|
124 | /* end of include file */ |
---|