1 | /* mppkt.h |
---|
2 | * |
---|
3 | * This package is the specification for the Packet Handler. |
---|
4 | * This handler defines the basic RTEMS packet and provides |
---|
5 | * mechanisms to utilize packets based on this prefix. |
---|
6 | * |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * All rights assigned to U.S. Government, 1994. |
---|
11 | * |
---|
12 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
13 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
14 | * notice must appear in all copies of this file and its derivatives. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef __RTEMS_MP_PACKET_h |
---|
20 | #define __RTEMS_MP_PACKET_h |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | #include <rtems/object.h> |
---|
27 | #include <rtems/priority.h> |
---|
28 | #include <rtems/watchdog.h> |
---|
29 | |
---|
30 | /* |
---|
31 | * The following enumerated type defines the packet classes |
---|
32 | * supported by RTEMS. |
---|
33 | * |
---|
34 | * NOTE: In general, each class corresponds to a manager |
---|
35 | * which supports global operations. Each manager |
---|
36 | * defines the set of supported operations. |
---|
37 | */ |
---|
38 | |
---|
39 | typedef enum { |
---|
40 | RTEMS_MP_PACKET_INTERNAL_THREADS = 0, |
---|
41 | RTEMS_MP_PACKET_TASKS = 1, |
---|
42 | RTEMS_MP_PACKET_MESSAGE_QUEUE = 2, |
---|
43 | RTEMS_MP_PACKET_SEMAPHORE = 3, |
---|
44 | RTEMS_MP_PACKET_PARTITION = 4, |
---|
45 | RTEMS_MP_PACKET_REGION = 5, |
---|
46 | RTEMS_MP_PACKET_EVENT = 6, |
---|
47 | RTEMS_MP_PACKET_SIGNAL = 7 |
---|
48 | } rtems_mp_packet_classes; |
---|
49 | |
---|
50 | #define MP_PACKET_CLASSES_FIRST RTEMS_MP_PACKET_INTERNAL_THREADS |
---|
51 | #define MP_PACKET_CLASSES_LAST RTEMS_MP_PACKET_SIGNAL |
---|
52 | |
---|
53 | /* |
---|
54 | * The following record contains the prefix for every packet |
---|
55 | * passed between RTEMS nodes. |
---|
56 | * |
---|
57 | * NOTE: This structure is padded to insure that anything |
---|
58 | * following it is on a 16 byte boundary. This is |
---|
59 | * the most stringent structure alignment rule |
---|
60 | * the RTEMS project has encountered yet (i960CA). |
---|
61 | */ |
---|
62 | |
---|
63 | typedef struct { |
---|
64 | rtems_mp_packet_classes the_class; |
---|
65 | Objects_Id id; |
---|
66 | Objects_Id source_tid; |
---|
67 | rtems_task_priority source_priority; |
---|
68 | rtems_status_code return_code; |
---|
69 | unsigned32 length; |
---|
70 | unsigned32 to_convert; |
---|
71 | rtems_interval timeout; |
---|
72 | } rtems_packet_prefix; |
---|
73 | |
---|
74 | /* |
---|
75 | * An MPCI must support packets of at least this size. |
---|
76 | */ |
---|
77 | |
---|
78 | #define RTEMS_MINIMUM_PACKET_SIZE 64 |
---|
79 | |
---|
80 | /* |
---|
81 | * The following constant defines the number of unsigned32's |
---|
82 | * in a packet which must be converted to native format in a |
---|
83 | * heterogeneous system. In packets longer than |
---|
84 | * RTEMS_MINIMUN_HETERO_CONVERSION unsigned32's, some of the "extra" data |
---|
85 | * may a user message buffer which is not automatically endian swapped. |
---|
86 | */ |
---|
87 | |
---|
88 | #define RTEMS_MINIMUN_HETERO_CONVERSION ( sizeof( rtems_packet_prefix ) / 4 ) |
---|
89 | |
---|
90 | /* |
---|
91 | * _Mp_packet_Is_valid_packet_class |
---|
92 | * |
---|
93 | * DESCRIPTION: |
---|
94 | * |
---|
95 | * This function returns TRUE if the the_packet_class is valid, |
---|
96 | * and FALSE otherwise. |
---|
97 | */ |
---|
98 | |
---|
99 | STATIC INLINE boolean _Mp_packet_Is_valid_packet_class ( |
---|
100 | rtems_mp_packet_classes the_packet_class |
---|
101 | ); |
---|
102 | |
---|
103 | /* |
---|
104 | * _Mp_packet_Is_null |
---|
105 | * |
---|
106 | * DESCRIPTION: |
---|
107 | * |
---|
108 | * This function returns TRUE if the the_packet_class is null, |
---|
109 | * and FALSE otherwise. |
---|
110 | */ |
---|
111 | |
---|
112 | STATIC INLINE boolean _Mp_packet_Is_null ( |
---|
113 | rtems_packet_prefix *the_packet |
---|
114 | ); |
---|
115 | |
---|
116 | #include <rtems/mppkt.inl> |
---|
117 | |
---|
118 | #ifdef __cplusplus |
---|
119 | } |
---|
120 | #endif |
---|
121 | |
---|
122 | #endif |
---|
123 | /* end of include file */ |
---|