source: rtems/cpukit/score/include/rtems/score/mpci.h @ 5e9b32b

4.104.114.84.95
Last change on this file since 5e9b32b was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 5.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 defines the node number used when a broadcast is desired.
34 */
35
36#define MPCI_ALL_NODES 0
37
38/*
39 *  For packets associated with requests that don't already have a timeout,
40 *  use the one specified by this MPCI driver.  The value specified by
41 *   the MPCI driver sets an upper limit on how long a remote request
42 *   should take to complete.
43 */
44
45#define MPCI_DEFAULT_TIMEOUT    0xFFFFFFFF
46
47/*
48 *  The following records define the Multiprocessor Communications
49 *  Interface (MPCI) Table.  This table defines the user-provided
50 *  MPCI which is a required part of a multiprocessor system.
51 *
52 *  For non-blocking local operations that become remote operations,
53 *  we need a timeout.  This is a per-driver timeout: default_timeout
54 */
55
56typedef void MPCI_Entry;
57
58typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
59
60typedef MPCI_Entry ( *MPCI_get_packet_entry )(
61                 MP_packet_Prefix **
62             );
63
64typedef MPCI_Entry ( *MPCI_return_packet_entry )(
65                 MP_packet_Prefix *
66             );
67
68typedef MPCI_Entry ( *MPCI_send_entry )(
69                 unsigned32,
70                 MP_packet_Prefix *
71             );
72
73typedef MPCI_Entry ( *MPCI_receive_entry )(
74                 MP_packet_Prefix **
75             );
76
77typedef struct {
78  unsigned32                 default_timeout;        /* in ticks */
79  unsigned32                 maximum_packet_size;
80  MPCI_initialization_entry  initialization;
81  MPCI_get_packet_entry      get_packet;
82  MPCI_return_packet_entry   return_packet;
83  MPCI_send_entry            send_packet;
84  MPCI_receive_entry         receive_packet;
85} MPCI_Control;
86
87/*
88 *  The following defines the type for packet processing routines
89 *  invoked by the MPCI Receive server.
90 */
91
92typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
93 
94/*
95 *  This is the core semaphore which the MPCI Receive Server blocks on.
96 */
97
98EXTERN CORE_semaphore_Control _MPCI_Semaphore;
99/*
100 *  The following thread queue is used to maintain a list of tasks
101 *  which currently have outstanding remote requests.
102 */
103
104EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
105
106/*
107 *  The following define the internal pointers to the user's
108 *  configuration information.
109 */
110 
111EXTERN MPCI_Control *_MPCI_table;
112
113/*
114 *  The following points to the MPCI Receive Server.
115 */
116 
117EXTERN Thread_Control *_MPCI_Receive_server_tcb;
118
119/*
120 *  The following table contains the process packet routines provided
121 *  by each object that supports MP operations.
122 */
123
124EXTERN MPCI_Packet_processor _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1];
125
126/*
127 *  _MPCI_Handler_initialization
128 *
129 *  DESCRIPTION:
130 *
131 *  This routine performs the initialization necessary for this handler.
132 */
133
134void _MPCI_Handler_initialization(
135  MPCI_Control            *users_mpci_table,
136  unsigned32               timeout_status
137);
138
139/*
140 *  _MPCI_Initialization
141 *
142 *  DESCRIPTION:
143 *
144 *  This routine initializes the MPCI driver by
145 *  invoking the user provided MPCI initialization callout.
146 */
147
148void _MPCI_Initialization ( void );
149
150/*
151 *  _MPCI_Register_packet_processor
152 *
153 *  DESCRIPTION:
154 *
155 *  This routine registers the MPCI packet processor for the
156 *  designated object class.
157 */
158 
159void _MPCI_Register_packet_processor(
160  MP_packet_Classes      the_object,
161  MPCI_Packet_processor  the_packet_processor
162 
163);
164 
165/*
166 *  _MPCI_Get_packet
167 *
168 *  DESCRIPTION:
169 *
170 *  This function obtains a packet by invoking the user provided
171 *  MPCI get packet callout.
172 */
173
174MP_packet_Prefix *_MPCI_Get_packet ( void );
175
176/*
177 *  _MPCI_Return_packet
178 *
179 *  DESCRIPTION:
180 *
181 *  This routine returns a packet by invoking the user provided
182 *  MPCI return packet callout.
183 */
184
185void _MPCI_Return_packet (
186  MP_packet_Prefix *the_packet
187);
188
189/*
190 *  _MPCI_Send_process_packet
191 *
192 *  DESCRIPTION:
193 *
194 *  This routine sends a process packet by invoking the user provided
195 *  MPCI send callout.
196 */
197
198void _MPCI_Send_process_packet (
199  unsigned32        destination,
200  MP_packet_Prefix *the_packet
201);
202
203/*
204 *  _MPCI_Send_request_packet
205 *
206 *  DESCRIPTION:
207 *
208 *  This routine sends a request packet by invoking the user provided
209 *  MPCI send callout.
210 */
211
212unsigned32 _MPCI_Send_request_packet (
213  unsigned32         destination,
214  MP_packet_Prefix  *the_packet,
215  States_Control     extra_state
216);
217
218/*
219 *  _MPCI_Send_response_packet
220 *
221 *  DESCRIPTION:
222 *
223 *  This routine sends a response packet by invoking the user provided
224 *  MPCI send callout.
225 */
226
227void _MPCI_Send_response_packet (
228  unsigned32        destination,
229  MP_packet_Prefix *the_packet
230);
231
232/*
233 *  _MPCI_Receive_packet
234 *
235 *  DESCRIPTION:
236 *
237 *  This routine receives a packet by invoking the user provided
238 *  MPCI receive callout.
239 */
240
241MP_packet_Prefix  *_MPCI_Receive_packet ( void );
242
243/*
244 *  _MPCI_Process_response
245 *
246 *  DESCRIPTION:
247 *
248 *  This routine obtains a packet by invoking the user provided
249 *  MPCI get packet callout.
250 */
251
252Thread_Control *_MPCI_Process_response (
253  MP_packet_Prefix *the_packet
254);
255
256/*PAGE
257 *
258 *  _MPCI_Receive_server
259 *
260 */
261 
262void _MPCI_Receive_server( void );
263
264/*PAGE
265 *
266 *  _MPCI_Announce
267 *
268 *  DESCRIPTION:
269 *
270 *  XXX
271 */
272 
273void _MPCI_Announce ( void );
274
275#ifdef __cplusplus
276}
277#endif
278
279#endif
280/* end of include file */
Note: See TracBrowser for help on using the repository browser.