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