source: rtems/cpukit/score/include/rtems/score/mpci.h @ d6154c7

4.104.114.84.95
Last change on this file since d6154c7 was d6154c7, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 29, 2004 at 4:41:13 PM

2004-03-29 Ralf Corsepius <ralf_corsepius@…>

  • score/include/rtems/debug.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/chain.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h, score/include/rtems/score/heap.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/object.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/priority.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadmp.h, score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/userext.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/coremsg.inl, score/inline/rtems/score/coresem.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/isr.inl, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl, score/inline/rtems/score/stack.inl, score/inline/rtems/score/thread.inl, score/inline/rtems/score/tqdata.inl, score/inline/rtems/score/userext.inl, score/inline/rtems/score/wkspace.inl, score/macros/rtems/score/address.inl, score/macros/rtems/score/heap.inl, score/macros/rtems/score/object.inl, score/macros/rtems/score/priority.inl, score/macros/rtems/score/userext.inl: Convert to using c99 fixed size types.
  • Property mode set to 100644
File size: 8.8 KB
Line 
1/*  mpci.h
2 *
3 *  This include file contains all the constants and structures associated
4 *  with the MPCI layer.  It provides mechanisms to utilize packets.
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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __MPCI_h
17#define __MPCI_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <rtems/score/mppkt.h>
24#include <rtems/score/states.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#include <rtems/score/tqdata.h>
28#include <rtems/score/watchdog.h>
29#include <rtems/score/coresem.h>
30
31/*
32 *  The following constants define the stack size requirements for
33 *  the system threads.
34 */
35 
36#define MPCI_RECEIVE_SERVER_STACK_SIZE \
37  ( STACK_MINIMUM_SIZE + \
38    CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
39    _CPU_Table.extra_mpci_receive_server_stack \
40  )
41
42/*
43 *  The following defines the node number used when a broadcast is desired.
44 */
45
46#define MPCI_ALL_NODES 0
47
48/*
49 *  For packets associated with requests that don't already have a timeout,
50 *  use the one specified by this MPCI driver.  The value specified by
51 *   the MPCI driver sets an upper limit on how long a remote request
52 *   should take to complete.
53 */
54
55#define MPCI_DEFAULT_TIMEOUT    0xFFFFFFFF
56
57/*
58 *  The following records define the Multiprocessor Communications
59 *  Interface (MPCI) Table.  This table defines the user-provided
60 *  MPCI which is a required part of a multiprocessor system.
61 *
62 *  For non-blocking local operations that become remote operations,
63 *  we need a timeout.  This is a per-driver timeout: default_timeout
64 */
65
66typedef void MPCI_Entry;
67
68typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
69
70typedef MPCI_Entry ( *MPCI_get_packet_entry )(
71                 MP_packet_Prefix **
72             );
73
74typedef MPCI_Entry ( *MPCI_return_packet_entry )(
75                 MP_packet_Prefix *
76             );
77
78typedef MPCI_Entry ( *MPCI_send_entry )(
79                 uint32_t  ,
80                 MP_packet_Prefix *
81             );
82
83typedef MPCI_Entry ( *MPCI_receive_entry )(
84                 MP_packet_Prefix **
85             );
86
87typedef struct {
88  uint32_t                   default_timeout;        /* in ticks */
89  uint32_t                   maximum_packet_size;
90  MPCI_initialization_entry  initialization;
91  MPCI_get_packet_entry      get_packet;
92  MPCI_return_packet_entry   return_packet;
93  MPCI_send_entry            send_packet;
94  MPCI_receive_entry         receive_packet;
95} MPCI_Control;
96
97/*
98 *  The following defines the type for packet processing routines
99 *  invoked by the MPCI Receive server.
100 */
101
102typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
103 
104/*
105 *  The following enumerated type defines the list of
106 *  internal MP operations.
107 */
108 
109typedef enum {
110  MPCI_PACKETS_SYSTEM_VERIFY  =  0
111}   MPCI_Internal_Remote_operations;
112 
113/*
114 *  The following data structure defines the packet used to perform
115 *  remote event operations.
116 */
117 
118typedef struct {
119  MP_packet_Prefix                 Prefix;
120  MPCI_Internal_Remote_operations  operation;
121  uint32_t                         maximum_nodes;
122  uint32_t                         maximum_global_objects;
123}    MPCI_Internal_packet;
124
125/*
126 *  This is the core semaphore which the MPCI Receive Server blocks on.
127 */
128
129SCORE_EXTERN CORE_semaphore_Control _MPCI_Semaphore;
130/*
131 *  The following thread queue is used to maintain a list of tasks
132 *  which currently have outstanding remote requests.
133 */
134
135SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
136
137/*
138 *  The following define the internal pointers to the user's
139 *  configuration information.
140 */
141 
142SCORE_EXTERN MPCI_Control *_MPCI_table;
143
144/*
145 *  The following points to the MPCI Receive Server.
146 */
147 
148SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb;
149
150/*
151 *  The following table contains the process packet routines provided
152 *  by each object that supports MP operations.
153 */
154
155SCORE_EXTERN MPCI_Packet_processor
156               _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1];
157
158/*
159 *  _MPCI_Handler_initialization
160 *
161 *  DESCRIPTION:
162 *
163 *  This routine performs the initialization necessary for this handler.
164 */
165
166void _MPCI_Handler_initialization( 
167  MPCI_Control            *users_mpci_table,
168  uint32_t                 timeout_status
169);
170
171/*
172 *  _MPCI_Create_server
173 *
174 *  DESCRIPTION:
175 * 
176 *  This routine creates the packet receive server used in MP systems.
177 */
178
179void _MPCI_Create_server( void );
180
181/*
182 *  _MPCI_Initialization
183 *
184 *  DESCRIPTION:
185 *
186 *  This routine initializes the MPCI driver by
187 *  invoking the user provided MPCI initialization callout.
188 */
189
190void _MPCI_Initialization ( void );
191
192/*
193 *  _MPCI_Register_packet_processor
194 *
195 *  DESCRIPTION:
196 *
197 *  This routine registers the MPCI packet processor for the
198 *  designated object class.
199 */
200 
201void _MPCI_Register_packet_processor( 
202  MP_packet_Classes      the_class,
203  MPCI_Packet_processor  the_packet_processor
204 
205);
206 
207/*
208 *  _MPCI_Get_packet
209 *
210 *  DESCRIPTION:
211 *
212 *  This function obtains a packet by invoking the user provided
213 *  MPCI get packet callout.
214 */
215
216MP_packet_Prefix *_MPCI_Get_packet ( void );
217
218/*
219 *  _MPCI_Return_packet
220 *
221 *  DESCRIPTION:
222 *
223 *  This routine returns a packet by invoking the user provided
224 *  MPCI return packet callout.
225 */
226
227void _MPCI_Return_packet (
228  MP_packet_Prefix *the_packet
229);
230
231/*
232 *  _MPCI_Send_process_packet
233 *
234 *  DESCRIPTION:
235 *
236 *  This routine sends a process packet by invoking the user provided
237 *  MPCI send callout.
238 */
239
240void _MPCI_Send_process_packet (
241  uint32_t          destination,
242  MP_packet_Prefix *the_packet
243);
244
245/*
246 *  _MPCI_Send_request_packet
247 *
248 *  DESCRIPTION:
249 *
250 *  This routine sends a request packet by invoking the user provided
251 *  MPCI send callout.
252 */
253
254uint32_t   _MPCI_Send_request_packet (
255  uint32_t           destination,
256  MP_packet_Prefix  *the_packet,
257  States_Control     extra_state
258);
259
260/*
261 *  _MPCI_Send_response_packet
262 *
263 *  DESCRIPTION:
264 *
265 *  This routine sends a response packet by invoking the user provided
266 *  MPCI send callout.
267 */
268
269void _MPCI_Send_response_packet (
270  uint32_t          destination,
271  MP_packet_Prefix *the_packet
272);
273
274/*
275 *  _MPCI_Receive_packet
276 *
277 *  DESCRIPTION:
278 *
279 *  This routine receives a packet by invoking the user provided
280 *  MPCI receive callout.
281 */
282
283MP_packet_Prefix  *_MPCI_Receive_packet ( void );
284
285/*
286 *  _MPCI_Process_response
287 *
288 *  DESCRIPTION:
289 *
290 *  This routine obtains a packet by invoking the user provided
291 *  MPCI get packet callout.
292 */
293
294Thread_Control *_MPCI_Process_response (
295  MP_packet_Prefix *the_packet
296);
297
298/*PAGE
299 *
300 *  _MPCI_Receive_server
301 *
302 */
303 
304Thread _MPCI_Receive_server(
305  uint32_t   ignored
306);
307
308/*PAGE
309 *
310 *  _MPCI_Announce
311 *
312 *  DESCRIPTION:
313 *
314 *  XXX
315 */
316 
317void _MPCI_Announce ( void );
318
319/*
320 *  _MPCI_Internal_packets_Send_process_packet
321 *
322 *  DESCRIPTION:
323 *
324 *  This routine performs a remote procedure call so that a
325 *  process operation can be performed on another node.
326 */
327 
328void _MPCI_Internal_packets_Send_process_packet (
329   MPCI_Internal_Remote_operations operation
330);
331 
332/*
333 *  _MPCI_Internal_packets_Send_request_packet
334 *
335 *  DESCRIPTION:
336 *
337 *  This routine performs a remote procedure call so that a
338 *  directive operation can be initiated on another node.
339 *
340 *  This routine is not needed since there are no request
341 *  packets to be sent by this manager.
342 */
343 
344/*
345 *  _MPCI_Internal_packets_Send_response_packet
346 *
347 *  DESCRIPTION:
348 *
349 *  This routine performs a remote procedure call so that a
350 *  directive can be performed on another node.
351 *
352 *  This routine is not needed since there are no response
353 *  packets to be sent by this manager.
354 */
355 
356/*
357 *
358 *  _MPCI_Internal_packets_Process_packet
359 *
360 *  DESCRIPTION:
361 *
362 *  This routine performs the actions specific to this package for
363 *  the request from another node.
364 */
365 
366void _MPCI_Internal_packets_Process_packet (
367  MP_packet_Prefix *the_packet_prefix
368);
369 
370/*
371 *  _MPCI_Internal_packets_Send_object_was_deleted
372 *
373 *  DESCRIPTION:
374 *
375 *  This routine is invoked indirectly by the thread queue
376 *  when a proxy has been removed from the thread queue and
377 *  the remote node must be informed of this.
378 *
379 *  This routine is not needed since there are no objects
380 *  deleted by this manager.
381 */
382 
383/*
384 *  _MPCI_Internal_packets_Send_extract_proxy
385 *
386 *  DESCRIPTION:
387 *
388 *  This routine is invoked when a task is deleted and it
389 *  has a proxy which must be removed from a thread queue and
390 *  the remote node must be informed of this.
391 *
392 *  This routine is not needed since there are no objects
393 *  deleted by this manager.
394 */
395 
396/*
397 *  _MPCI_Internal_packets_Get_packet
398 *
399 *  DESCRIPTION:
400 *
401 *  This routine is used to obtain a internal threads mp packet.
402 */
403 
404 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
405
406#ifdef __cplusplus
407}
408#endif
409
410#endif
411/* end of include file */
Note: See TracBrowser for help on using the repository browser.