source: rtems/c/src/exec/score/headers/mpci.h @ adf98bd

4.104.114.84.95
Last change on this file since adf98bd was adf98bd, checked in by Joel Sherrill <joel.sherrill@…>, on 02/21/96 at 14:44:11

Removed the internal thread objects and dispersed its contents to
the thread handler (IDLE), MPCI object (SYSI now MP Receive)
and initialize_executive_early (IO initialization). The SYSI task
no longer exists in a single processor configuration. This reduces
single processor Workspace requirements by a TCB and a stack which
is often larger than the minimum stack size. Moving the IO initialization
plus accompanying BSP hooks eliminated an initialization ordering problem
in which a global task could be created before the MPCI was initialized.

  • Property mode set to 100644
File size: 8.9 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, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __MPCI_h
18#define __MPCI_h
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <rtems/score/mppkt.h>
25#include <rtems/score/states.h>
26#include <rtems/score/thread.h>
27#include <rtems/score/threadq.h>
28#include <rtems/score/tqdata.h>
29#include <rtems/score/watchdog.h>
30#include <rtems/score/coresem.h>
31
32/*
33 *  The following constants define the stack size requirements for
34 *  the system threads.
35 */
36 
37#define MPCI_RECEIVE_SERVER_STACK_SIZE \
38  ( STACK_MINIMUM_SIZE + \
39    CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
40    _CPU_Table.extra_mpci_receive_server_stack \
41  )
42
43/*
44 *  The following defines the node number used when a broadcast is desired.
45 */
46
47#define MPCI_ALL_NODES 0
48
49/*
50 *  For packets associated with requests that don't already have a timeout,
51 *  use the one specified by this MPCI driver.  The value specified by
52 *   the MPCI driver sets an upper limit on how long a remote request
53 *   should take to complete.
54 */
55
56#define MPCI_DEFAULT_TIMEOUT    0xFFFFFFFF
57
58/*
59 *  The following records define the Multiprocessor Communications
60 *  Interface (MPCI) Table.  This table defines the user-provided
61 *  MPCI which is a required part of a multiprocessor system.
62 *
63 *  For non-blocking local operations that become remote operations,
64 *  we need a timeout.  This is a per-driver timeout: default_timeout
65 */
66
67typedef void MPCI_Entry;
68
69typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
70
71typedef MPCI_Entry ( *MPCI_get_packet_entry )(
72                 MP_packet_Prefix **
73             );
74
75typedef MPCI_Entry ( *MPCI_return_packet_entry )(
76                 MP_packet_Prefix *
77             );
78
79typedef MPCI_Entry ( *MPCI_send_entry )(
80                 unsigned32,
81                 MP_packet_Prefix *
82             );
83
84typedef MPCI_Entry ( *MPCI_receive_entry )(
85                 MP_packet_Prefix **
86             );
87
88typedef struct {
89  unsigned32                 default_timeout;        /* in ticks */
90  unsigned32                 maximum_packet_size;
91  MPCI_initialization_entry  initialization;
92  MPCI_get_packet_entry      get_packet;
93  MPCI_return_packet_entry   return_packet;
94  MPCI_send_entry            send_packet;
95  MPCI_receive_entry         receive_packet;
96} MPCI_Control;
97
98/*
99 *  The following defines the type for packet processing routines
100 *  invoked by the MPCI Receive server.
101 */
102
103typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
104 
105/*
106 *  The following enumerated type defines the list of
107 *  internal MP operations.
108 */
109 
110typedef enum {
111  MPCI_PACKETS_SYSTEM_VERIFY  =  0
112}   MPCI_Internal_Remote_operations;
113 
114/*
115 *  The following data structure defines the packet used to perform
116 *  remote event operations.
117 */
118 
119typedef struct {
120  MP_packet_Prefix                 Prefix;
121  MPCI_Internal_Remote_operations  operation;
122  unsigned32                       maximum_nodes;
123  unsigned32                       maximum_global_objects;
124}    MPCI_Internal_packet;
125
126/*
127 *  This is the core semaphore which the MPCI Receive Server blocks on.
128 */
129
130EXTERN CORE_semaphore_Control _MPCI_Semaphore;
131/*
132 *  The following thread queue is used to maintain a list of tasks
133 *  which currently have outstanding remote requests.
134 */
135
136EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
137
138/*
139 *  The following define the internal pointers to the user's
140 *  configuration information.
141 */
142 
143EXTERN MPCI_Control *_MPCI_table;
144
145/*
146 *  The following points to the MPCI Receive Server.
147 */
148 
149EXTERN Thread_Control *_MPCI_Receive_server_tcb;
150
151/*
152 *  The following table contains the process packet routines provided
153 *  by each object that supports MP operations.
154 */
155
156EXTERN MPCI_Packet_processor _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  unsigned32               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_object,
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  unsigned32        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
254unsigned32 _MPCI_Send_request_packet (
255  unsigned32         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  unsigned32        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  unsigned32 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.