1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ClassicSemImpl |
---|
5 | * |
---|
6 | * @brief Classic Semaphore Manager Data Structures |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2008, 2016. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.org/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef _RTEMS_RTEMS_SEMDATA_H |
---|
19 | #define _RTEMS_RTEMS_SEMDATA_H |
---|
20 | |
---|
21 | #include <rtems/rtems/sem.h> |
---|
22 | #include <rtems/score/coremutex.h> |
---|
23 | #include <rtems/score/coresem.h> |
---|
24 | #include <rtems/score/mrsp.h> |
---|
25 | #include <rtems/score/object.h> |
---|
26 | |
---|
27 | #ifdef __cplusplus |
---|
28 | extern "C" { |
---|
29 | #endif |
---|
30 | |
---|
31 | /** |
---|
32 | * @addtogroup ClassicSemImpl |
---|
33 | * |
---|
34 | * @{ |
---|
35 | */ |
---|
36 | |
---|
37 | /** |
---|
38 | * The following defines the control block used to manage each semaphore. |
---|
39 | */ |
---|
40 | typedef struct { |
---|
41 | /** This field is the object management portion of a Semaphore instance. */ |
---|
42 | Objects_Control Object; |
---|
43 | |
---|
44 | /** |
---|
45 | * This contains the memory associated with the SuperCore Semaphore or |
---|
46 | * Mutex instance that provides the primary functionality of each |
---|
47 | * Classic API Semaphore instance. The structure used is dependent |
---|
48 | * on the attributes specified by the user on the create directive. |
---|
49 | * |
---|
50 | * @note Only one of these has meaning in a particular Classic API |
---|
51 | * Semaphore instance. |
---|
52 | */ |
---|
53 | union { |
---|
54 | /** |
---|
55 | * @brief The thread queue present in all other variants. |
---|
56 | */ |
---|
57 | Thread_queue_Control Wait_queue; |
---|
58 | |
---|
59 | /** |
---|
60 | * This is the SuperCore Mutex instance associated with this Classic |
---|
61 | * API Semaphore instance. |
---|
62 | */ |
---|
63 | CORE_ceiling_mutex_Control Mutex; |
---|
64 | |
---|
65 | /** |
---|
66 | * This is the SuperCore Semaphore instance associated with this Classic |
---|
67 | * API Semaphore instance. |
---|
68 | */ |
---|
69 | CORE_semaphore_Control Semaphore; |
---|
70 | |
---|
71 | #if defined(RTEMS_SMP) |
---|
72 | MRSP_Control MRSP; |
---|
73 | #endif |
---|
74 | } Core_control; |
---|
75 | |
---|
76 | /** |
---|
77 | * @brief The semaphore variant. |
---|
78 | * |
---|
79 | * @see Semaphore_Variant. |
---|
80 | */ |
---|
81 | unsigned int variant : 3; |
---|
82 | |
---|
83 | /** |
---|
84 | * @brief The semaphore thread queue discipline. |
---|
85 | * |
---|
86 | * @see Semaphore_Discipline. |
---|
87 | */ |
---|
88 | unsigned int discipline : 1; |
---|
89 | |
---|
90 | #if defined(RTEMS_MULTIPROCESSING) |
---|
91 | unsigned int is_global : 1; |
---|
92 | #endif |
---|
93 | } Semaphore_Control; |
---|
94 | |
---|
95 | /** @} */ |
---|
96 | |
---|
97 | #ifdef __cplusplus |
---|
98 | } |
---|
99 | #endif |
---|
100 | |
---|
101 | #endif |
---|
102 | /* end of include file */ |
---|