OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [include/] [rtems/] [score/] [mpci.h] - Blame information for rev 1771

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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.OARcorp.com/rtems/license.html.
12
 *
13
 *  mpci.h,v 1.13 1999/11/17 17:50:36 joel Exp
14
 */
15
 
16
#ifndef __MPCI_h
17
#define __MPCI_h
18
 
19
#ifdef __cplusplus
20
extern "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
 
66
typedef void MPCI_Entry;
67
 
68
typedef MPCI_Entry ( *MPCI_initialization_entry )( void );
69
 
70
typedef MPCI_Entry ( *MPCI_get_packet_entry )(
71
                 MP_packet_Prefix **
72
             );
73
 
74
typedef MPCI_Entry ( *MPCI_return_packet_entry )(
75
                 MP_packet_Prefix *
76
             );
77
 
78
typedef MPCI_Entry ( *MPCI_send_entry )(
79
                 unsigned32,
80
                 MP_packet_Prefix *
81
             );
82
 
83
typedef MPCI_Entry ( *MPCI_receive_entry )(
84
                 MP_packet_Prefix **
85
             );
86
 
87
typedef struct {
88
  unsigned32                 default_timeout;        /* in ticks */
89
  unsigned32                 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
 
102
typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
103
 
104
/*
105
 *  The following enumerated type defines the list of
106
 *  internal MP operations.
107
 */
108
 
109
typedef 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
 
118
typedef struct {
119
  MP_packet_Prefix                 Prefix;
120
  MPCI_Internal_Remote_operations  operation;
121
  unsigned32                       maximum_nodes;
122
  unsigned32                       maximum_global_objects;
123
}    MPCI_Internal_packet;
124
 
125
/*
126
 *  This is the core semaphore which the MPCI Receive Server blocks on.
127
 */
128
 
129
SCORE_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
 
135
SCORE_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
 
142
SCORE_EXTERN MPCI_Control *_MPCI_table;
143
 
144
/*
145
 *  The following points to the MPCI Receive Server.
146
 */
147
 
148
SCORE_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
 
155
SCORE_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
 
166
void _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
 
179
void _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
 
190
void _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
 
201
void _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
 
216
MP_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
 
227
void _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
 
240
void _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
 
254
unsigned32 _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
 
269
void _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
 
283
MP_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
 
294
Thread_Control *_MPCI_Process_response (
295
  MP_packet_Prefix *the_packet
296
);
297
 
298
/*PAGE
299
 *
300
 *  _MPCI_Receive_server
301
 *
302
 */
303
 
304
Thread _MPCI_Receive_server(
305
  unsigned32 ignored
306
);
307
 
308
/*PAGE
309
 *
310
 *  _MPCI_Announce
311
 *
312
 *  DESCRIPTION:
313
 *
314
 *  XXX
315
 */
316
 
317
void _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
 
328
void _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
 
366
void _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 */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.