1 | /** |
---|
2 | * @file rtems/rtems/semmp.h |
---|
3 | * |
---|
4 | * @defgroup ClassicSEM Semaphore MP Support |
---|
5 | * |
---|
6 | * @ingroup ClassicRTEMS |
---|
7 | * @brief Semaphore Manager MP Support |
---|
8 | * |
---|
9 | * This include file contains all the constants and structures associated |
---|
10 | * with the Multiprocessing Support in the Semaphore Manager. |
---|
11 | */ |
---|
12 | |
---|
13 | /* COPYRIGHT (c) 1989-2013. |
---|
14 | * On-Line Applications Research Corporation (OAR). |
---|
15 | * |
---|
16 | * The license and distribution terms for this file may be |
---|
17 | * found in the file LICENSE in this distribution or at |
---|
18 | * http://www.rtems.org/license/LICENSE. |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _RTEMS_RTEMS_SEMMP_H |
---|
22 | #define _RTEMS_RTEMS_SEMMP_H |
---|
23 | |
---|
24 | #ifndef _RTEMS_RTEMS_SEMIMPL_H |
---|
25 | # error "Never use <rtems/rtems/semmp.h> directly; include <rtems/rtems/semimpl.h> instead." |
---|
26 | #endif |
---|
27 | |
---|
28 | #ifdef __cplusplus |
---|
29 | extern "C" { |
---|
30 | #endif |
---|
31 | |
---|
32 | /** |
---|
33 | * @defgroup ClassicSEM Semaphore MP Support |
---|
34 | * |
---|
35 | * @ingroup ClassicMP |
---|
36 | * |
---|
37 | * This encapsulates functionality related to the transparent multiprocessing |
---|
38 | * support within the Classic API Semaphore Manager. |
---|
39 | */ |
---|
40 | /**@{*/ |
---|
41 | |
---|
42 | /** |
---|
43 | * The following enumerated type defines the list of |
---|
44 | * remote semaphore operations. |
---|
45 | */ |
---|
46 | typedef enum { |
---|
47 | SEMAPHORE_MP_ANNOUNCE_CREATE = 0, |
---|
48 | SEMAPHORE_MP_ANNOUNCE_DELETE = 1, |
---|
49 | SEMAPHORE_MP_EXTRACT_PROXY = 2, |
---|
50 | SEMAPHORE_MP_OBTAIN_REQUEST = 3, |
---|
51 | SEMAPHORE_MP_OBTAIN_RESPONSE = 4, |
---|
52 | SEMAPHORE_MP_RELEASE_REQUEST = 5, |
---|
53 | SEMAPHORE_MP_RELEASE_RESPONSE = 6 |
---|
54 | } Semaphore_MP_Remote_operations; |
---|
55 | |
---|
56 | /** |
---|
57 | * The following data structure defines the packet used to perform |
---|
58 | * remote semaphore operations. |
---|
59 | */ |
---|
60 | typedef struct { |
---|
61 | rtems_packet_prefix Prefix; |
---|
62 | Semaphore_MP_Remote_operations operation; |
---|
63 | rtems_name name; |
---|
64 | rtems_option option_set; |
---|
65 | Objects_Id proxy_id; |
---|
66 | } Semaphore_MP_Packet; |
---|
67 | |
---|
68 | /** |
---|
69 | * @brief Semaphore MP Send Process Packet |
---|
70 | * |
---|
71 | * This routine performs a remote procedure call so that a |
---|
72 | * process operation can be performed on another node. |
---|
73 | */ |
---|
74 | void _Semaphore_MP_Send_process_packet ( |
---|
75 | Semaphore_MP_Remote_operations operation, |
---|
76 | Objects_Id semaphore_id, |
---|
77 | rtems_name name, |
---|
78 | Objects_Id proxy_id |
---|
79 | ); |
---|
80 | |
---|
81 | /** |
---|
82 | * @brief Semaphore MP Send Request Packet |
---|
83 | * |
---|
84 | * This routine performs a remote procedure call so that a |
---|
85 | * directive operation can be initiated on another node. |
---|
86 | */ |
---|
87 | rtems_status_code _Semaphore_MP_Send_request_packet ( |
---|
88 | Semaphore_MP_Remote_operations operation, |
---|
89 | Objects_Id semaphore_id, |
---|
90 | rtems_option option_set, |
---|
91 | rtems_interval timeout |
---|
92 | ); |
---|
93 | |
---|
94 | /** |
---|
95 | * @brief Semaphore MP Process Packet |
---|
96 | * |
---|
97 | * This routine performs the actions specific to this package for |
---|
98 | * the request from another node. |
---|
99 | */ |
---|
100 | void _Semaphore_MP_Process_packet ( |
---|
101 | rtems_packet_prefix *the_packet_prefix |
---|
102 | ); |
---|
103 | |
---|
104 | /** |
---|
105 | * @brief Semaphore MP Send Object was Deleted |
---|
106 | * |
---|
107 | * This routine is invoked indirectly by the thread queue |
---|
108 | * when a proxy has been removed from the thread queue and |
---|
109 | * the remote node must be informed of this. |
---|
110 | */ |
---|
111 | void _Semaphore_MP_Send_object_was_deleted ( |
---|
112 | Thread_Control *the_proxy, |
---|
113 | Objects_Id mp_id |
---|
114 | ); |
---|
115 | |
---|
116 | /** |
---|
117 | * @brief Semaphore MP Send Extract Proxy |
---|
118 | * |
---|
119 | * This routine is invoked when a task is deleted and it |
---|
120 | * has a proxy which must be removed from a thread queue and |
---|
121 | * the remote node must be informed of this. |
---|
122 | */ |
---|
123 | void _Semaphore_MP_Send_extract_proxy ( |
---|
124 | Thread_Control *the_thread, |
---|
125 | Objects_Id id |
---|
126 | ); |
---|
127 | |
---|
128 | /** |
---|
129 | * @brief Semaphore MP Get Packet |
---|
130 | * |
---|
131 | * This function is used to obtain a semaphore mp packet. |
---|
132 | */ |
---|
133 | Semaphore_MP_Packet *_Semaphore_MP_Get_packet ( void ); |
---|
134 | |
---|
135 | /** |
---|
136 | * @brief Semaphore Core Mutex MP Support |
---|
137 | * |
---|
138 | * This function processes the global actions necessary for remote |
---|
139 | * accesses to a global semaphore based on a core mutex. This function |
---|
140 | * is called by the core. |
---|
141 | * |
---|
142 | * @param[in] the_thread the remote thread the semaphore was surrendered to |
---|
143 | * @param[in] id is the id of the surrendered semaphore |
---|
144 | */ |
---|
145 | void _Semaphore_Core_mutex_mp_support ( |
---|
146 | Thread_Control *the_thread, |
---|
147 | Objects_Id id |
---|
148 | ); |
---|
149 | |
---|
150 | /** |
---|
151 | * @brief Semaphore Core MP Support |
---|
152 | * |
---|
153 | * This function processes the global actions necessary for remote |
---|
154 | * accesses to a global semaphore based on a core semaphore. This function |
---|
155 | * is called by the core. |
---|
156 | * |
---|
157 | * @param[in] the_thread the remote thread the semaphore was surrendered to |
---|
158 | * @param[in] id is the id of the surrendered semaphore |
---|
159 | */ |
---|
160 | void _Semaphore_Core_semaphore_mp_support ( |
---|
161 | Thread_Control *the_thread, |
---|
162 | Objects_Id id |
---|
163 | ); |
---|
164 | |
---|
165 | #ifdef __cplusplus |
---|
166 | } |
---|
167 | #endif |
---|
168 | |
---|
169 | /**@}*/ |
---|
170 | |
---|
171 | #endif |
---|
172 | /* end of file */ |
---|