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-2006. |
---|
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 _RTEMS_SCORE_MPPKT_H |
---|
23 | #define _RTEMS_SCORE_MPPKT_H |
---|
24 | |
---|
25 | /** |
---|
26 | * @defgroup ScoreMPPacket MP Packet Handler |
---|
27 | * |
---|
28 | * This handler encapsulates the primary definition of MPCI packets. This |
---|
29 | * handler defines the part of the packet that is common to all remote |
---|
30 | * operations. |
---|
31 | */ |
---|
32 | /**@{*/ |
---|
33 | |
---|
34 | #ifdef __cplusplus |
---|
35 | extern "C" { |
---|
36 | #endif |
---|
37 | |
---|
38 | #include <rtems/score/object.h> |
---|
39 | #include <rtems/score/priority.h> |
---|
40 | #include <rtems/score/watchdog.h> |
---|
41 | |
---|
42 | /** |
---|
43 | * The following enumerated type defines the packet classes. |
---|
44 | * |
---|
45 | * @note In general, each class corresponds to a manager |
---|
46 | * which supports global operations. Each manager |
---|
47 | * defines the set of supported operations. |
---|
48 | */ |
---|
49 | typedef enum { |
---|
50 | MP_PACKET_MPCI_INTERNAL = 0, |
---|
51 | MP_PACKET_TASKS = 1, |
---|
52 | MP_PACKET_MESSAGE_QUEUE = 2, |
---|
53 | MP_PACKET_SEMAPHORE = 3, |
---|
54 | MP_PACKET_PARTITION = 4, |
---|
55 | MP_PACKET_REGION = 5, |
---|
56 | MP_PACKET_EVENT = 6, |
---|
57 | MP_PACKET_SIGNAL = 7 |
---|
58 | } MP_packet_Classes; |
---|
59 | |
---|
60 | /** |
---|
61 | * This constant defines the first entry in the MP_packet_Classes enumeration. |
---|
62 | */ |
---|
63 | #define MP_PACKET_CLASSES_FIRST MP_PACKET_MPCI_INTERNAL |
---|
64 | |
---|
65 | /** |
---|
66 | * This constant defines the last entry in the MP_packet_Classes enumeration. |
---|
67 | */ |
---|
68 | #define MP_PACKET_CLASSES_LAST MP_PACKET_SIGNAL |
---|
69 | |
---|
70 | /** |
---|
71 | * The following record contains the prefix for every packet |
---|
72 | * passed between nodes in an MP system. |
---|
73 | * |
---|
74 | * @note This structure is padded to ensure that anything following it |
---|
75 | * is on a 16 byte boundary. This is the most stringent structure |
---|
76 | * alignment rule encountered yet. |
---|
77 | */ |
---|
78 | typedef struct { |
---|
79 | /** This field indicates the API class of the operation being performed. */ |
---|
80 | MP_packet_Classes the_class; |
---|
81 | /** This field is the id of the object to be acted upon. */ |
---|
82 | Objects_Id id; |
---|
83 | /** This field is the ID of the originating thread. */ |
---|
84 | Objects_Id source_tid; |
---|
85 | /** This field is the priority of the originating thread. */ |
---|
86 | Priority_Control source_priority; |
---|
87 | /** This field is where the status of the operation will be returned. */ |
---|
88 | uint32_t return_code; |
---|
89 | /** This field is the length of the data following the prefix. */ |
---|
90 | uint32_t length; |
---|
91 | /** This field is the length of the data which required network conversion. */ |
---|
92 | uint32_t to_convert; |
---|
93 | /** This field is the requested timeout for this operation. */ |
---|
94 | Watchdog_Interval timeout; |
---|
95 | } MP_packet_Prefix; |
---|
96 | |
---|
97 | /** |
---|
98 | * An MPCI must support packets of at least this size. |
---|
99 | */ |
---|
100 | #define MP_PACKET_MINIMUM_PACKET_SIZE 64 |
---|
101 | |
---|
102 | /** |
---|
103 | * The following constant defines the number of uint32_t 's |
---|
104 | * in a packet which must be converted to native format in a |
---|
105 | * heterogeneous system. In packets longer than |
---|
106 | * MP_PACKET_MINIMUN_HETERO_CONVERSION uint32_t 's, some of the "extra" data |
---|
107 | * may a user message buffer which is not automatically endian swapped. |
---|
108 | */ |
---|
109 | #define MP_PACKET_MINIMUN_HETERO_CONVERSION \ |
---|
110 | ( sizeof( MP_packet_Prefix ) / sizeof( uint32_t ) ) |
---|
111 | |
---|
112 | #ifndef __RTEMS_APPLICATION__ |
---|
113 | #include <rtems/score/mppkt.inl> |
---|
114 | #endif |
---|
115 | |
---|
116 | #ifdef __cplusplus |
---|
117 | } |
---|
118 | #endif |
---|
119 | |
---|
120 | /**@}*/ |
---|
121 | |
---|
122 | #endif |
---|
123 | /* end of include file */ |
---|