1 | /* mppkt.h |
---|
2 | * |
---|
3 | * This package is the specification for the Packet Handler. |
---|
4 | * This handler defines the basic packet and provides |
---|
5 | * mechanisms to utilize packets based on this prefix. |
---|
6 | * Packets are the fundamental basis for messages passed between |
---|
7 | * nodes in an MP system. |
---|
8 | * |
---|
9 | * |
---|
10 | * COPYRIGHT (c) 1989-1997. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * Copyright assigned to U.S. Government, 1994. |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may in |
---|
15 | * the file LICENSE in this distribution or at |
---|
16 | * http://www.OARcorp.com/rtems/license.html. |
---|
17 | * |
---|
18 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef __MP_PACKET_h |
---|
22 | #define __MP_PACKET_h |
---|
23 | |
---|
24 | #ifdef __cplusplus |
---|
25 | extern "C" { |
---|
26 | #endif |
---|
27 | |
---|
28 | #include <rtems/score/object.h> |
---|
29 | #include <rtems/score/priority.h> |
---|
30 | #include <rtems/score/watchdog.h> |
---|
31 | |
---|
32 | /* |
---|
33 | * The following enumerated type defines the packet classes. |
---|
34 | * |
---|
35 | * NOTE: In general, each class corresponds to a manager |
---|
36 | * which supports global operations. Each manager |
---|
37 | * defines the set of supported operations. |
---|
38 | */ |
---|
39 | |
---|
40 | typedef enum { |
---|
41 | MP_PACKET_MPCI_INTERNAL = 0, |
---|
42 | MP_PACKET_TASKS = 1, |
---|
43 | MP_PACKET_MESSAGE_QUEUE = 2, |
---|
44 | MP_PACKET_SEMAPHORE = 3, |
---|
45 | MP_PACKET_PARTITION = 4, |
---|
46 | MP_PACKET_REGION = 5, |
---|
47 | MP_PACKET_EVENT = 6, |
---|
48 | MP_PACKET_SIGNAL = 7 |
---|
49 | } MP_packet_Classes; |
---|
50 | |
---|
51 | #define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL |
---|
52 | #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL |
---|
53 | |
---|
54 | /* |
---|
55 | * The following record contains the prefix for every packet |
---|
56 | * passed between nodes in an MP system. |
---|
57 | * |
---|
58 | * NOTE: This structure is padded to insure that anything |
---|
59 | * following it is on a 16 byte boundary. This is |
---|
60 | * the most stringent structure alignment rule |
---|
61 | * encountered yet (i960CA). |
---|
62 | */ |
---|
63 | |
---|
64 | typedef struct { |
---|
65 | MP_packet_Classes the_class; |
---|
66 | Objects_Id id; |
---|
67 | Objects_Id source_tid; |
---|
68 | Priority_Control source_priority; |
---|
69 | unsigned32 return_code; |
---|
70 | unsigned32 length; |
---|
71 | unsigned32 to_convert; |
---|
72 | Watchdog_Interval timeout; |
---|
73 | } MP_packet_Prefix; |
---|
74 | |
---|
75 | /* |
---|
76 | * An MPCI must support packets of at least this size. |
---|
77 | */ |
---|
78 | |
---|
79 | #define MP_PACKET_MINIMUM_PACKET_SIZE 64 |
---|
80 | |
---|
81 | /* |
---|
82 | * The following constant defines the number of unsigned32's |
---|
83 | * in a packet which must be converted to native format in a |
---|
84 | * heterogeneous system. In packets longer than |
---|
85 | * MP_PACKET_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data |
---|
86 | * may a user message buffer which is not automatically endian swapped. |
---|
87 | */ |
---|
88 | |
---|
89 | #define MP_PACKET_MINIMUN_HETERO_CONVERSION \ |
---|
90 | ( sizeof( MP_packet_Prefix ) / sizeof( unsigned32 ) ) |
---|
91 | |
---|
92 | #ifndef __RTEMS_APPLICATION__ |
---|
93 | #include <rtems/score/mppkt.inl> |
---|
94 | #endif |
---|
95 | |
---|
96 | #ifdef __cplusplus |
---|
97 | } |
---|
98 | #endif |
---|
99 | |
---|
100 | #endif |
---|
101 | /* end of include file */ |
---|