1 | /** |
---|
2 | * @file rtems/rtems/types.h |
---|
3 | * |
---|
4 | * This include file defines the types used by the RTEMS API. |
---|
5 | */ |
---|
6 | |
---|
7 | /* COPYRIGHT (c) 1989-2008. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _RTEMS_RTEMS_TYPES_H |
---|
18 | #define _RTEMS_RTEMS_TYPES_H |
---|
19 | |
---|
20 | /** |
---|
21 | * @defgroup ClassicTypes Classic API Types |
---|
22 | * |
---|
23 | * This encapsulates functionality which XXX |
---|
24 | */ |
---|
25 | /**@{*/ |
---|
26 | |
---|
27 | /* |
---|
28 | * RTEMS basic type definitions |
---|
29 | */ |
---|
30 | |
---|
31 | #include <stdint.h> |
---|
32 | #include <rtems/score/heap.h> |
---|
33 | #include <rtems/score/object.h> |
---|
34 | #include <rtems/score/priority.h> |
---|
35 | #include <rtems/score/tod.h> |
---|
36 | #include <rtems/score/watchdog.h> |
---|
37 | #include <rtems/rtems/modes.h> |
---|
38 | #if defined(RTEMS_MULTIPROCESSING) |
---|
39 | #include <rtems/score/mpci.h> |
---|
40 | #include <rtems/score/mppkt.h> |
---|
41 | #endif |
---|
42 | |
---|
43 | #ifdef __cplusplus |
---|
44 | extern "C" { |
---|
45 | #endif |
---|
46 | |
---|
47 | /** This type defines a single precision float. */ |
---|
48 | #ifdef RTEMS_DEPRECATED_TYPES |
---|
49 | typedef single_precision rtems_single; |
---|
50 | |
---|
51 | /** This type defines a double precision float. */ |
---|
52 | typedef double_precision rtems_double; |
---|
53 | |
---|
54 | /** This type defines the RTEMS boolean type . */ |
---|
55 | typedef boolean rtems_boolean; |
---|
56 | #endif |
---|
57 | |
---|
58 | /** This type defines is for Classic API object names. */ |
---|
59 | typedef uint32_t rtems_name; |
---|
60 | |
---|
61 | /** |
---|
62 | * This type defines is for RTEMS object Id. Although this |
---|
63 | * type name is specific to the Classic API, the format of |
---|
64 | * an object Id is the same across all APIs. |
---|
65 | */ |
---|
66 | typedef Objects_Id rtems_id; |
---|
67 | |
---|
68 | /** |
---|
69 | * This defines a value that is an invalid object Id. |
---|
70 | */ |
---|
71 | #define RTEMS_ID_NONE OBJECTS_ID_NONE |
---|
72 | |
---|
73 | /** |
---|
74 | * This type is the public name for task context area. |
---|
75 | */ |
---|
76 | typedef Context_Control rtems_context; |
---|
77 | |
---|
78 | #if (CPU_HARDWARE_FP == TRUE) || (CPU_SOFTWARE_FP == TRUE) |
---|
79 | /** |
---|
80 | * This type is the public name for task floating point context area. |
---|
81 | */ |
---|
82 | typedef Context_Control_fp rtems_context_fp; |
---|
83 | #endif |
---|
84 | |
---|
85 | /** |
---|
86 | * This type is the public name for the architecture specific |
---|
87 | * stack frame built as part of vectoring an interrupt. |
---|
88 | */ |
---|
89 | typedef CPU_Interrupt_frame rtems_interrupt_frame; |
---|
90 | |
---|
91 | /** |
---|
92 | * This type defines the public name for the information |
---|
93 | * structure returned by the Heap Handler via the Region |
---|
94 | * Manager. |
---|
95 | */ |
---|
96 | typedef Heap_Information_block region_information_block; |
---|
97 | |
---|
98 | /** |
---|
99 | * This type defines the public name for the type that is |
---|
100 | * used to manage intervals specified by clock ticks. |
---|
101 | */ |
---|
102 | typedef Watchdog_Interval rtems_interval; |
---|
103 | |
---|
104 | /** |
---|
105 | * This is the public type used to represent the CPU usage per thread. |
---|
106 | * |
---|
107 | * @note When using nanosecond granularity timing, RTEMS may internally |
---|
108 | * use a variety of represenations. |
---|
109 | */ |
---|
110 | #ifndef __RTEMS_USE_TICKS_CPU_USAGE_STATISTICS__ |
---|
111 | typedef struct timespec rtems_thread_cpu_usage_t; |
---|
112 | #else |
---|
113 | typedef uint32_t Thread_CPU_usage_t; |
---|
114 | #endif |
---|
115 | |
---|
116 | |
---|
117 | /** |
---|
118 | * The following record defines the time of control block. This |
---|
119 | * control block is used to maintain the current time of day. |
---|
120 | * |
---|
121 | * @note This is an RTEID (a.k.a. Classic API) style time/date. |
---|
122 | */ |
---|
123 | typedef struct { |
---|
124 | /** This field is the year, A.D. */ |
---|
125 | uint32_t year; |
---|
126 | /** This field is the month, 1 -> 12 */ |
---|
127 | uint32_t month; |
---|
128 | /** This field is the day, 1 -> 31 */ |
---|
129 | uint32_t day; |
---|
130 | /** This field is the hour, 0 -> 23 */ |
---|
131 | uint32_t hour; |
---|
132 | /** This field is the minute, 0 -> 59 */ |
---|
133 | uint32_t minute; |
---|
134 | /** This field is the second, 0 -> 59 */ |
---|
135 | uint32_t second; |
---|
136 | /** This field is the elapsed ticks between secs */ |
---|
137 | uint32_t ticks; |
---|
138 | } rtems_time_of_day; |
---|
139 | |
---|
140 | /** |
---|
141 | * This defines the public name for an RTEMS API task mode type. |
---|
142 | */ |
---|
143 | typedef Modes_Control rtems_mode; |
---|
144 | |
---|
145 | /* |
---|
146 | * MPCI related entries |
---|
147 | */ |
---|
148 | #if defined(RTEMS_MULTIPROCESSING) |
---|
149 | /** |
---|
150 | * This defines the public name for the set of MPCI packet |
---|
151 | * classes which are internally dispatched to the managers. |
---|
152 | */ |
---|
153 | typedef MP_packet_Classes rtems_mp_packet_classes; |
---|
154 | |
---|
155 | /** |
---|
156 | * This defines the public name for the common prefix |
---|
157 | * found at the beginning of each MPCI packet sent between |
---|
158 | * nodes. This can be thought of as an envelope. |
---|
159 | */ |
---|
160 | typedef MP_packet_Prefix rtems_packet_prefix; |
---|
161 | |
---|
162 | /** |
---|
163 | * This defines the public name for the type for an indirect pointer |
---|
164 | * to the initialization entry point for an MPCI handler. |
---|
165 | */ |
---|
166 | typedef MPCI_initialization_entry rtems_mpci_initialization_entry; |
---|
167 | |
---|
168 | /** |
---|
169 | * This defines the public name for the type for an indirect pointer |
---|
170 | * to the get_packet entry point for an MPCI handler. |
---|
171 | */ |
---|
172 | typedef MPCI_get_packet_entry rtems_mpci_get_packet_entry; |
---|
173 | |
---|
174 | /** |
---|
175 | * This defines the public name for the type for an indirect pointer |
---|
176 | * to the return_packet entry point for an MPCI handler. |
---|
177 | */ |
---|
178 | typedef MPCI_return_packet_entry rtems_mpci_return_packet_entry; |
---|
179 | |
---|
180 | /** |
---|
181 | * This defines the public name for the type for an indirect pointer |
---|
182 | * to the send_packet entry point for an MPCI handler. |
---|
183 | */ |
---|
184 | typedef MPCI_send_entry rtems_mpci_send_packet_entry; |
---|
185 | |
---|
186 | /** |
---|
187 | * This defines the public name for the type for an indirect pointer |
---|
188 | * to the receive entry point for an MPCI handler. |
---|
189 | */ |
---|
190 | typedef MPCI_receive_entry rtems_mpci_receive_packet_entry; |
---|
191 | |
---|
192 | /** |
---|
193 | * This defines the public name for the return type from every |
---|
194 | * MPCI handler routine. |
---|
195 | */ |
---|
196 | typedef MPCI_Entry rtems_mpci_entry; |
---|
197 | |
---|
198 | /** |
---|
199 | * This defines the public name for the structure which is used to |
---|
200 | * configure an MPCI handler. |
---|
201 | */ |
---|
202 | typedef MPCI_Control rtems_mpci_table; |
---|
203 | |
---|
204 | #endif |
---|
205 | |
---|
206 | #ifdef __cplusplus |
---|
207 | } |
---|
208 | #endif |
---|
209 | |
---|
210 | /**@}*/ |
---|
211 | |
---|
212 | #endif |
---|
213 | /* end of include file */ |
---|