1 | -- |
---|
2 | -- RTEMS / Specification |
---|
3 | -- |
---|
4 | -- DESCRIPTION: |
---|
5 | -- |
---|
6 | -- This package provides the interface to the RTEMS API. |
---|
7 | -- |
---|
8 | -- DEPENDENCIES: |
---|
9 | -- |
---|
10 | -- |
---|
11 | -- |
---|
12 | -- COPYRIGHT (c) 1997. |
---|
13 | -- On-Line Applications Research Corporation (OAR). |
---|
14 | -- |
---|
15 | -- The license and distribution terms for this file may in |
---|
16 | -- the file LICENSE in this distribution or at |
---|
17 | -- http://www.OARcorp.com/rtems/license.html. |
---|
18 | -- |
---|
19 | -- $Id$ |
---|
20 | -- |
---|
21 | |
---|
22 | with System; |
---|
23 | with System.Storage_Elements; use System.Storage_Elements; |
---|
24 | with Interfaces; |
---|
25 | with Interfaces.C; |
---|
26 | |
---|
27 | package RTEMS is |
---|
28 | pragma Elaborate_Body (RTEMS); |
---|
29 | |
---|
30 | Structure_Alignment : constant := 8; |
---|
31 | |
---|
32 | -- |
---|
33 | -- RTEMS Base Types |
---|
34 | -- |
---|
35 | |
---|
36 | subtype Unsigned8 is Interfaces.Unsigned_8; |
---|
37 | subtype Unsigned16 is Interfaces.Unsigned_16; |
---|
38 | subtype Unsigned32 is Interfaces.Unsigned_32; |
---|
39 | subtype Signed32 is Interfaces.Integer_32; |
---|
40 | |
---|
41 | type Unsigned32_Pointer is access all RTEMS.Unsigned32; |
---|
42 | type Unsigned16_Pointer is access all RTEMS.Unsigned16; |
---|
43 | type Unsigned8_Pointer is access all RTEMS.Unsigned8; |
---|
44 | type Signed32_Pointer is access all RTEMS.Signed32; |
---|
45 | |
---|
46 | subtype Boolean is RTEMS.Unsigned32; |
---|
47 | subtype Address is System.Address; |
---|
48 | subtype Single is Interfaces.C.C_float; |
---|
49 | subtype Double is Interfaces.C.Double; |
---|
50 | |
---|
51 | -- |
---|
52 | -- The following define the size of each of the base types in |
---|
53 | -- both bits and system units. |
---|
54 | -- |
---|
55 | |
---|
56 | Unsigned8_Bits : constant := 7; |
---|
57 | Unsigned16_Bits : constant := 15; |
---|
58 | Unsigned32_Bits : constant := 31; |
---|
59 | Boolean_Bits : constant := 31; |
---|
60 | Address_Bits : constant := 31; |
---|
61 | Single_Bits : constant := 31; |
---|
62 | Double_Bits : constant := 63; |
---|
63 | |
---|
64 | Unsigned8_Units : constant := 1; |
---|
65 | Unsigned16_Units : constant := 2; |
---|
66 | Unsigned32_Units : constant := 4; |
---|
67 | Boolean_Units : constant := 4; |
---|
68 | Address_Units : constant := 4; |
---|
69 | Single_Units : constant := 4; |
---|
70 | Double_Units : constant := 8; |
---|
71 | |
---|
72 | Null_Address : constant RTEMS.Address := |
---|
73 | System.Storage_Elements.To_Address(0); |
---|
74 | |
---|
75 | True : constant RTEMS.Boolean := 1; |
---|
76 | False : constant RTEMS.Boolean := 0; |
---|
77 | |
---|
78 | -- More Types |
---|
79 | -- |
---|
80 | |
---|
81 | subtype Name is RTEMS.Unsigned32; |
---|
82 | subtype ID is RTEMS.Unsigned32; |
---|
83 | subtype Interval is RTEMS.Unsigned32; |
---|
84 | subtype Attribute is RTEMS.Unsigned32; |
---|
85 | subtype Mode is RTEMS.Unsigned32; |
---|
86 | subtype Option is RTEMS.Unsigned32; |
---|
87 | subtype Task_Priority is RTEMS.Unsigned32; |
---|
88 | subtype Notepad_Index is RTEMS.Unsigned32 range 0 .. 15; |
---|
89 | |
---|
90 | subtype Event_Set is RTEMS.Unsigned32; |
---|
91 | subtype Signal_Set is RTEMS.Unsigned32; |
---|
92 | subtype Debug_Set is RTEMS.Unsigned32; |
---|
93 | subtype Device_Major_Number is RTEMS.Unsigned32; |
---|
94 | subtype Device_Minor_Number is RTEMS.Unsigned32; |
---|
95 | subtype Vector_Number is RTEMS.Unsigned32; |
---|
96 | subtype ISR_Level is RTEMS.Unsigned32; |
---|
97 | |
---|
98 | subtype Node is RTEMS.Unsigned32; |
---|
99 | |
---|
100 | -- |
---|
101 | -- Task Related Types |
---|
102 | -- XXXX fix this |
---|
103 | subtype Task_Argument is RTEMS.Unsigned32; |
---|
104 | type Task_Argument_PTR is access all Task_Argument; |
---|
105 | |
---|
106 | -- XXXX fix this |
---|
107 | subtype TCB is RTEMS.Unsigned32; |
---|
108 | type TCB_Pointer is access all RTEMS.TCB; |
---|
109 | |
---|
110 | subtype Task_States is RTEMS.Unsigned32; |
---|
111 | |
---|
112 | type Task_Entry is access procedure ( |
---|
113 | Argument : RTEMS.Unsigned32 |
---|
114 | ); |
---|
115 | |
---|
116 | -- |
---|
117 | -- Clock and Time of Day Types |
---|
118 | -- |
---|
119 | |
---|
120 | type Time_Of_Day is |
---|
121 | record |
---|
122 | Year : RTEMS.Unsigned32; -- year, A.D. |
---|
123 | Month : RTEMS.Unsigned32; -- month, 1 .. 12 |
---|
124 | Day : RTEMS.Unsigned32; -- day, 1 .. 31 |
---|
125 | Hour : RTEMS.Unsigned32; -- hour, 0 .. 23 |
---|
126 | Minute : RTEMS.Unsigned32; -- minute, 0 .. 59 |
---|
127 | Second : RTEMS.Unsigned32; -- second, 0 .. 59 |
---|
128 | Ticks : RTEMS.Unsigned32; -- elapsed ticks between seconds |
---|
129 | end record; |
---|
130 | |
---|
131 | type Clock_Time_Value is |
---|
132 | record |
---|
133 | Seconds : RTEMS.Unsigned32; |
---|
134 | Microseconds : RTEMS.Unsigned32; |
---|
135 | end record; |
---|
136 | |
---|
137 | type Clock_Get_Options is ( |
---|
138 | Clock_Get_TOD, |
---|
139 | Clock_Get_Seconds_Since_Epoch, |
---|
140 | Clock_Get_Ticks_Since_Boot, |
---|
141 | Clock_Get_Ticks_Per_Seconds, |
---|
142 | Clock_Get_Time_Value |
---|
143 | ); |
---|
144 | |
---|
145 | -- |
---|
146 | -- Device Driver Entry Prototype |
---|
147 | -- |
---|
148 | |
---|
149 | type Device_Driver_Entry is access function ( |
---|
150 | Major : in RTEMS.Device_Major_Number; |
---|
151 | Minor : in RTEMS.Device_Major_Number; |
---|
152 | Argument : in RTEMS.Unsigned32; |
---|
153 | ID : in RTEMS.Unsigned32 |
---|
154 | ) return RTEMS.Unsigned32; |
---|
155 | |
---|
156 | type Driver_Address_Table_Entry is |
---|
157 | record |
---|
158 | Initialization : RTEMS.Device_Driver_Entry; |
---|
159 | Open : RTEMS.Device_Driver_Entry; |
---|
160 | Close : RTEMS.Device_Driver_Entry; |
---|
161 | Read : RTEMS.Device_Driver_Entry; |
---|
162 | Write : RTEMS.Device_Driver_Entry; |
---|
163 | Control : RTEMS.Device_Driver_Entry; |
---|
164 | end record; |
---|
165 | |
---|
166 | type Driver_Address_Table is array ( RTEMS.Unsigned32 |
---|
167 | range 1 .. RTEMS.Unsigned32'Last ) of RTEMS.Driver_Address_Table_Entry; |
---|
168 | |
---|
169 | type Driver_Address_Table_Pointer is access all Driver_Address_Table; |
---|
170 | |
---|
171 | type Driver_Name_t is |
---|
172 | record |
---|
173 | Device_Name : RTEMS.Address; |
---|
174 | Device_Name_Length : RTEMS.Unsigned32; |
---|
175 | Major : RTEMS.Device_Major_Number; |
---|
176 | Minor : RTEMS.Device_Minor_Number; |
---|
177 | |
---|
178 | end record; |
---|
179 | |
---|
180 | -- |
---|
181 | -- Ident Options |
---|
182 | -- |
---|
183 | |
---|
184 | Search_All_Nodes : constant RTEMS.Node := 0; |
---|
185 | |
---|
186 | -- |
---|
187 | -- Options |
---|
188 | -- |
---|
189 | |
---|
190 | Default_Options : constant RTEMS.Option := 16#0000#; |
---|
191 | |
---|
192 | Wait : constant RTEMS.Option := 16#0000#; |
---|
193 | No_Wait : constant RTEMS.Option := 16#0001#; |
---|
194 | |
---|
195 | Event_All : constant RTEMS.Option := 16#0000#; |
---|
196 | Event_Any : constant RTEMS.Option := 16#0002#; |
---|
197 | |
---|
198 | -- |
---|
199 | -- Mode constants |
---|
200 | -- |
---|
201 | |
---|
202 | Default_Modes : constant RTEMS.Mode := 16#0000#; |
---|
203 | |
---|
204 | All_Mode_Masks : constant RTEMS.Mode := 16#0000_ffff#; |
---|
205 | Current_Mode : constant RTEMS.Mode := 16#0000_0000#; |
---|
206 | Preempt_Mask : constant RTEMS.Mode := 16#0000_0100#; |
---|
207 | Timeslice_Mask : constant RTEMS.Mode := 16#0000_0200#; |
---|
208 | ASR_Mask : constant RTEMS.Mode := 16#0000_0400#; |
---|
209 | Interrupt_Mask : RTEMS.Mode; |
---|
210 | Preempt : constant RTEMS.Mode := 16#0000_0000#; |
---|
211 | No_Preempt : constant RTEMS.Mode := 16#0000_0100#; |
---|
212 | No_Timeslice : constant RTEMS.Mode := 16#0000_0000#; |
---|
213 | Timeslice : constant RTEMS.Mode := 16#0000_0200#; |
---|
214 | ASR : constant RTEMS.Mode := 16#0000_0000#; |
---|
215 | No_ASR : constant RTEMS.Mode := 16#0000_0400#; |
---|
216 | |
---|
217 | pragma Import (C, Interrupt_Mask, "rtems_interrupt_mask"); |
---|
218 | |
---|
219 | -- |
---|
220 | -- Attribute constants |
---|
221 | -- |
---|
222 | |
---|
223 | Default_Attributes : constant RTEMS.Attribute := 16#00000000#; |
---|
224 | No_Floating_Point : constant RTEMS.Attribute := 16#00000000#; |
---|
225 | Floating_Point : constant RTEMS.Attribute := 16#00000001#; |
---|
226 | Local : constant RTEMS.Attribute := 16#00000000#; |
---|
227 | Global : constant RTEMS.Attribute := 16#00000002#; |
---|
228 | FIFO : constant RTEMS.Attribute := 16#00000000#; |
---|
229 | Priority : constant RTEMS.Attribute := 16#00000004#; |
---|
230 | Counting_Semaphore : constant RTEMS.Attribute := 16#00000000#; |
---|
231 | Binary_Semaphore : constant RTEMS.Attribute := 16#00000010#; |
---|
232 | No_Inherit_Priority : constant RTEMS.Attribute := 16#00000000#; |
---|
233 | Inherit_Priority : constant RTEMS.Attribute := 16#00000020#; |
---|
234 | No_Priority_Ceiling : constant RTEMS.Attribute := 16#00000000#; |
---|
235 | Priority_Ceiling : constant RTEMS.Attribute := 16#00000040#; |
---|
236 | |
---|
237 | function Interrupt_Level ( |
---|
238 | Level : in RTEMS.Unsigned32 |
---|
239 | ) return RTEMS.Attribute; |
---|
240 | pragma Import (C, Interrupt_Level, "rtems_interrupt_level_attribute"); |
---|
241 | |
---|
242 | Minimum_Stack_Size : RTEMS.Unsigned32; |
---|
243 | pragma Import (C, Minimum_Stack_Size, "rtems_minimum_stack_size"); |
---|
244 | |
---|
245 | |
---|
246 | -- |
---|
247 | -- Notepad index constants |
---|
248 | -- |
---|
249 | |
---|
250 | Notepad_0 : constant RTEMS.Unsigned32 := 0; |
---|
251 | Notepad_1 : constant RTEMS.Unsigned32 := 1; |
---|
252 | Notepad_2 : constant RTEMS.Unsigned32 := 2; |
---|
253 | Notepad_3 : constant RTEMS.Unsigned32 := 3; |
---|
254 | Notepad_4 : constant RTEMS.Unsigned32 := 4; |
---|
255 | Notepad_5 : constant RTEMS.Unsigned32 := 5; |
---|
256 | Notepad_6 : constant RTEMS.Unsigned32 := 6; |
---|
257 | Notepad_7 : constant RTEMS.Unsigned32 := 7; |
---|
258 | Notepad_8 : constant RTEMS.Unsigned32 := 8; |
---|
259 | Notepad_9 : constant RTEMS.Unsigned32 := 9; |
---|
260 | Notepad_10 : constant RTEMS.Unsigned32 := 10; |
---|
261 | Notepad_11 : constant RTEMS.Unsigned32 := 11; |
---|
262 | Notepad_12 : constant RTEMS.Unsigned32 := 12; |
---|
263 | Notepad_13 : constant RTEMS.Unsigned32 := 13; |
---|
264 | Notepad_14 : constant RTEMS.Unsigned32 := 14; |
---|
265 | Notepad_15 : constant RTEMS.Unsigned32 := 15; |
---|
266 | |
---|
267 | -- |
---|
268 | -- Miscellaneous |
---|
269 | -- |
---|
270 | |
---|
271 | No_Timeout : constant RTEMS.Interval := 0; |
---|
272 | Self : constant RTEMS.ID := 0; |
---|
273 | Period_Status : constant RTEMS.Interval := 0; |
---|
274 | Yield_Processor : constant RTEMS.Interval := 0; |
---|
275 | Current_Priority : constant RTEMS.Task_Priority := 0; |
---|
276 | No_Priority : constant RTEMS.Task_Priority := 0; |
---|
277 | |
---|
278 | |
---|
279 | -- |
---|
280 | -- Extension Callouts and Table |
---|
281 | -- |
---|
282 | |
---|
283 | type Thread_Create_Extension is access procedure ( |
---|
284 | Current_Task : in RTEMS.TCB_Pointer; |
---|
285 | New_Task : in RTEMS.TCB_Pointer |
---|
286 | ); |
---|
287 | |
---|
288 | type Thread_Start_Extension is access procedure ( |
---|
289 | Current_Task : in RTEMS.TCB_Pointer; |
---|
290 | Started_Task : in RTEMS.TCB_Pointer |
---|
291 | ); |
---|
292 | |
---|
293 | type Thread_Restart_Extension is access procedure ( |
---|
294 | Current_Task : in RTEMS.TCB_Pointer; |
---|
295 | Restarted_Task : in RTEMS.TCB_Pointer |
---|
296 | ); |
---|
297 | |
---|
298 | type Thread_Delete_Extension is access procedure ( |
---|
299 | Current_Task : in RTEMS.TCB_Pointer; |
---|
300 | Deleted_Task : in RTEMS.TCB_Pointer |
---|
301 | ); |
---|
302 | |
---|
303 | type Thread_Switch_Extension is access procedure ( |
---|
304 | Current_Task : in RTEMS.TCB_Pointer; |
---|
305 | Heir_Task : in RTEMS.TCB_Pointer |
---|
306 | ); |
---|
307 | |
---|
308 | type Thread_Post_Switch_Extension is access procedure ( |
---|
309 | Current_Task : in RTEMS.TCB_Pointer |
---|
310 | ); |
---|
311 | |
---|
312 | type Thread_Begin_Extension is access procedure ( |
---|
313 | Current_Task : in RTEMS.TCB_Pointer |
---|
314 | ); |
---|
315 | |
---|
316 | type Thread_Exitted_Extension is access procedure ( |
---|
317 | Current_Task : in RTEMS.TCB_Pointer |
---|
318 | ); |
---|
319 | |
---|
320 | type Fatal_Error_Extension is access procedure ( |
---|
321 | Error : in RTEMS.Unsigned32 |
---|
322 | ); |
---|
323 | |
---|
324 | type Extensions_Table is |
---|
325 | record |
---|
326 | Thread_Create : RTEMS.Thread_Create_Extension; |
---|
327 | Thread_Start : RTEMS.Thread_Start_Extension; |
---|
328 | Thread_Restart : RTEMS.Thread_Restart_Extension; |
---|
329 | Thread_Delete : RTEMS.Thread_Delete_Extension; |
---|
330 | Thread_Switch : RTEMS.Thread_Switch_Extension; |
---|
331 | Thread_Post_Switch : RTEMS.Thread_Post_Switch_Extension; |
---|
332 | Thread_Begin : RTEMS.Thread_Begin_Extension; |
---|
333 | Thread_Exitted : RTEMS.Thread_Exitted_Extension; |
---|
334 | Fatal : RTEMS.Fatal_Error_Extension; |
---|
335 | end record; |
---|
336 | |
---|
337 | type Extensions_Table_Pointer is access all Extensions_Table; |
---|
338 | |
---|
339 | -- |
---|
340 | -- The following type define a pointer to a watchdog/timer service routine. |
---|
341 | -- |
---|
342 | |
---|
343 | type Timer_Service_Routine is access procedure ( |
---|
344 | ID : in RTEMS.ID; |
---|
345 | User_Data : in RTEMS.Address |
---|
346 | ); |
---|
347 | |
---|
348 | -- |
---|
349 | -- The following type define a pointer to a signal service routine. |
---|
350 | -- |
---|
351 | |
---|
352 | type ASR_Handler is access procedure ( |
---|
353 | Signals : in RTEMS.Signal_Set |
---|
354 | ); |
---|
355 | |
---|
356 | -- |
---|
357 | -- The following type defines the status information returned |
---|
358 | -- about a period. |
---|
359 | -- |
---|
360 | |
---|
361 | type Rate_Monotonic_Period_States is ( |
---|
362 | Inactive, -- off chain, never initialized |
---|
363 | Owner_Is_Blocking, -- on chain, owner is blocking on it |
---|
364 | Active, -- on chain, running continuously |
---|
365 | Expired_While_Blocking, -- on chain, expired while owner was was blocking |
---|
366 | Expired -- off chain, will be reset by next |
---|
367 | -- rtems_rate_monotonic_period |
---|
368 | ); |
---|
369 | |
---|
370 | for Rate_Monotonic_Period_States'Size use 32; |
---|
371 | |
---|
372 | for Rate_Monotonic_Period_States use ( |
---|
373 | Inactive => 0, |
---|
374 | Owner_Is_Blocking => 1, |
---|
375 | Active => 2, |
---|
376 | Expired_While_Blocking => 3, |
---|
377 | Expired => 4 |
---|
378 | ); |
---|
379 | |
---|
380 | type Rate_Monotonic_Period_Status is |
---|
381 | record |
---|
382 | State : RTEMS.Rate_Monotonic_Period_States; |
---|
383 | Ticks_Since_Last_Period : RTEMS.Unsigned32; |
---|
384 | Ticks_Executed_Since_Last_Period : RTEMS.Unsigned32; |
---|
385 | end record; |
---|
386 | |
---|
387 | -- |
---|
388 | -- Method Completions Status Codes |
---|
389 | -- |
---|
390 | |
---|
391 | type Status_Codes is ( |
---|
392 | Successful, -- successful completion |
---|
393 | Task_Exitted, -- returned from a task |
---|
394 | MP_Not_Configured, -- multiprocessing not configured |
---|
395 | Invalid_Name, -- invalid object name |
---|
396 | Invalid_ID, -- invalid object id |
---|
397 | Too_Many, -- too many |
---|
398 | Timeout, -- timed out waiting |
---|
399 | Object_Was_Deleted, -- object deleted while waiting |
---|
400 | Invalid_Size, -- specified size was invalid |
---|
401 | Invalid_Address, -- address specified is invalid |
---|
402 | Invalid_Number, -- number was invalid |
---|
403 | Not_Defined, -- item has not been initialized |
---|
404 | Resource_In_Use, -- resources still outstanding |
---|
405 | Unsatisfied, -- request not satisfied |
---|
406 | Incorrect_State, -- task is in wrong state |
---|
407 | Already_Suspended, -- task already in state |
---|
408 | Illegal_On_Self, -- illegal on calling task |
---|
409 | Illegal_On_Remote_Object, -- illegal for remote object |
---|
410 | Called_From_ISR, -- called from wrong environment |
---|
411 | Invalid_Priority, -- invalid task priority |
---|
412 | Invalid_Clock, -- invalid date/time |
---|
413 | Invalid_Node, -- invalid node id |
---|
414 | Not_Configured, -- directive not configured |
---|
415 | Not_Owner_Of_Resource, -- not owner of resource |
---|
416 | Not_Implemented, -- directive not implemented |
---|
417 | Internal_Error, -- RTEMS inconsistency detected |
---|
418 | No_Memory, -- no memory left in heap |
---|
419 | IO_Error, -- driver IO error |
---|
420 | Proxy_Blocking -- internal multiprocessing only |
---|
421 | ); |
---|
422 | |
---|
423 | for Status_Codes'Size use 32; |
---|
424 | |
---|
425 | for Status_Codes use ( |
---|
426 | Successful => 0, |
---|
427 | Task_Exitted => 1, |
---|
428 | MP_Not_Configured => 2, |
---|
429 | Invalid_Name => 3, |
---|
430 | Invalid_ID => 4, |
---|
431 | Too_Many => 5, |
---|
432 | Timeout => 6, |
---|
433 | Object_Was_Deleted => 7, |
---|
434 | Invalid_Size => 8, |
---|
435 | Invalid_Address => 9, |
---|
436 | Invalid_NumbeR => 10, |
---|
437 | Not_Defined => 11, |
---|
438 | Resource_In_Use => 12, |
---|
439 | Unsatisfied => 13, |
---|
440 | Incorrect_State => 14, |
---|
441 | Already_Suspended => 15, |
---|
442 | Illegal_On_Self => 16, |
---|
443 | Illegal_On_Remote_Object => 17, |
---|
444 | Called_From_ISR => 18, |
---|
445 | Invalid_Priority => 19, |
---|
446 | Invalid_Clock => 20, |
---|
447 | Invalid_Node => 21, |
---|
448 | Not_Configured => 22, |
---|
449 | Not_Owner_Of_Resource => 23, |
---|
450 | Not_ImplementeD => 24, |
---|
451 | Internal_Error => 25, |
---|
452 | No_Memory => 26, |
---|
453 | IO_Error => 27, |
---|
454 | Proxy_Blocking => 28 |
---|
455 | ); |
---|
456 | |
---|
457 | -- |
---|
458 | -- RTEMS Events |
---|
459 | -- |
---|
460 | |
---|
461 | Pending_Events : constant RTEMS.Event_Set := 16#0000_0000#; |
---|
462 | All_Events : constant RTEMS.Event_Set := 16#FFFF_FFFF#; |
---|
463 | Event_0 : constant RTEMS.Event_Set := 16#0000_0001#; |
---|
464 | Event_1 : constant RTEMS.Event_Set := 16#0000_0002#; |
---|
465 | Event_2 : constant RTEMS.Event_Set := 16#0000_0004#; |
---|
466 | Event_3 : constant RTEMS.Event_Set := 16#0000_0008#; |
---|
467 | Event_4 : constant RTEMS.Event_Set := 16#0000_0010#; |
---|
468 | Event_5 : constant RTEMS.Event_Set := 16#0000_0020#; |
---|
469 | Event_6 : constant RTEMS.Event_Set := 16#0000_0040#; |
---|
470 | Event_7 : constant RTEMS.Event_Set := 16#0000_0080#; |
---|
471 | Event_8 : constant RTEMS.Event_Set := 16#0000_0100#; |
---|
472 | Event_9 : constant RTEMS.Event_Set := 16#0000_0200#; |
---|
473 | Event_10 : constant RTEMS.Event_Set := 16#0000_0400#; |
---|
474 | Event_11 : constant RTEMS.Event_Set := 16#0000_0800#; |
---|
475 | Event_12 : constant RTEMS.Event_Set := 16#0000_1000#; |
---|
476 | Event_13 : constant RTEMS.Event_Set := 16#0000_2000#; |
---|
477 | Event_14 : constant RTEMS.Event_Set := 16#0000_4000#; |
---|
478 | Event_15 : constant RTEMS.Event_Set := 16#0000_8000#; |
---|
479 | Event_16 : constant RTEMS.Event_Set := 16#0001_0000#; |
---|
480 | Event_17 : constant RTEMS.Event_Set := 16#0002_0000#; |
---|
481 | Event_18 : constant RTEMS.Event_Set := 16#0004_0000#; |
---|
482 | Event_19 : constant RTEMS.Event_Set := 16#0008_0000#; |
---|
483 | Event_20 : constant RTEMS.Event_Set := 16#0010_0000#; |
---|
484 | Event_21 : constant RTEMS.Event_Set := 16#0020_0000#; |
---|
485 | Event_22 : constant RTEMS.Event_Set := 16#0040_0000#; |
---|
486 | Event_23 : constant RTEMS.Event_Set := 16#0080_0000#; |
---|
487 | Event_24 : constant RTEMS.Event_Set := 16#0100_0000#; |
---|
488 | Event_25 : constant RTEMS.Event_Set := 16#0200_0000#; |
---|
489 | Event_26 : constant RTEMS.Event_Set := 16#0400_0000#; |
---|
490 | Event_27 : constant RTEMS.Event_Set := 16#0800_0000#; |
---|
491 | Event_28 : constant RTEMS.Event_Set := 16#1000_0000#; |
---|
492 | Event_29 : constant RTEMS.Event_Set := 16#2000_0000#; |
---|
493 | Event_30 : constant RTEMS.Event_Set := 16#4000_0000#; |
---|
494 | Event_31 : constant RTEMS.Event_Set := 16#8000_0000#; |
---|
495 | |
---|
496 | -- |
---|
497 | -- RTEMS Signals |
---|
498 | -- |
---|
499 | |
---|
500 | All_Signals : constant RTEMS.Signal_Set := 16#7FFFFFFF#; |
---|
501 | Signal_0 : constant RTEMS.Signal_Set := 16#00000001#; |
---|
502 | Signal_1 : constant RTEMS.Signal_Set := 16#00000002#; |
---|
503 | Signal_2 : constant RTEMS.Signal_Set := 16#00000004#; |
---|
504 | Signal_3 : constant RTEMS.Signal_Set := 16#00000008#; |
---|
505 | Signal_4 : constant RTEMS.Signal_Set := 16#00000010#; |
---|
506 | Signal_5 : constant RTEMS.Signal_Set := 16#00000020#; |
---|
507 | Signal_6 : constant RTEMS.Signal_Set := 16#00000040#; |
---|
508 | Signal_7 : constant RTEMS.Signal_Set := 16#00000080#; |
---|
509 | Signal_8 : constant RTEMS.Signal_Set := 16#00000100#; |
---|
510 | Signal_9 : constant RTEMS.Signal_Set := 16#00000200#; |
---|
511 | Signal_10 : constant RTEMS.Signal_Set := 16#00000400#; |
---|
512 | Signal_11 : constant RTEMS.Signal_Set := 16#00000800#; |
---|
513 | Signal_12 : constant RTEMS.Signal_Set := 16#00001000#; |
---|
514 | Signal_13 : constant RTEMS.Signal_Set := 16#00002000#; |
---|
515 | Signal_14 : constant RTEMS.Signal_Set := 16#00004000#; |
---|
516 | Signal_15 : constant RTEMS.Signal_Set := 16#00008000#; |
---|
517 | Signal_16 : constant RTEMS.Signal_Set := 16#00010000#; |
---|
518 | Signal_17 : constant RTEMS.Signal_Set := 16#00020000#; |
---|
519 | Signal_18 : constant RTEMS.Signal_Set := 16#00040000#; |
---|
520 | Signal_19 : constant RTEMS.Signal_Set := 16#00080000#; |
---|
521 | Signal_20 : constant RTEMS.Signal_Set := 16#00100000#; |
---|
522 | Signal_21 : constant RTEMS.Signal_Set := 16#00200000#; |
---|
523 | Signal_22 : constant RTEMS.Signal_Set := 16#00400000#; |
---|
524 | Signal_23 : constant RTEMS.Signal_Set := 16#00800000#; |
---|
525 | Signal_24 : constant RTEMS.Signal_Set := 16#01000000#; |
---|
526 | Signal_25 : constant RTEMS.Signal_Set := 16#02000000#; |
---|
527 | Signal_26 : constant RTEMS.Signal_Set := 16#04000000#; |
---|
528 | Signal_27 : constant RTEMS.Signal_Set := 16#08000000#; |
---|
529 | Signal_28 : constant RTEMS.Signal_Set := 16#10000000#; |
---|
530 | Signal_29 : constant RTEMS.Signal_Set := 16#20000000#; |
---|
531 | Signal_30 : constant RTEMS.Signal_Set := 16#40000000#; |
---|
532 | Signal_31 : constant RTEMS.Signal_Set := 16#80000000#; |
---|
533 | |
---|
534 | -- |
---|
535 | -- RTEMS API Configuration Information |
---|
536 | -- |
---|
537 | |
---|
538 | type Initialization_Tasks_Table_Entry is |
---|
539 | record |
---|
540 | Name : RTEMS.Name; -- task name |
---|
541 | Stack_Size : RTEMS.Unsigned32; -- task stack size |
---|
542 | Initial_Priority : RTEMS.Task_priority; -- task priority |
---|
543 | Attribute_Set : RTEMS.Attribute; -- task attributes |
---|
544 | Entry_Point : RTEMS.Task_Entry; -- task entry point |
---|
545 | Mode_Set : RTEMS.Mode; -- task initial mode |
---|
546 | Argument : RTEMS.Unsigned32; -- task argument |
---|
547 | end record; |
---|
548 | |
---|
549 | type Initialization_Tasks_Table is array ( RTEMS.Unsigned32 range <> ) of |
---|
550 | RTEMS.Initialization_Tasks_Table_Entry; |
---|
551 | |
---|
552 | type Initialization_Tasks_Table_Pointer is access all |
---|
553 | Initialization_Tasks_Table; |
---|
554 | |
---|
555 | type API_Configuration_Table is |
---|
556 | record |
---|
557 | Maximum_Tasks : RTEMS.Unsigned32; |
---|
558 | Maximum_Timers : RTEMS.Unsigned32; |
---|
559 | Maximum_Semaphores : RTEMS.Unsigned32; |
---|
560 | Maximum_Message_queues : RTEMS.Unsigned32; |
---|
561 | Maximum_Partitions : RTEMS.Unsigned32; |
---|
562 | Maximum_Regions : RTEMS.Unsigned32; |
---|
563 | Maximum_Ports : RTEMS.Unsigned32; |
---|
564 | Maximum_Periods : RTEMS.Unsigned32; |
---|
565 | Number_Of_Initialization_Tasks : RTEMS.Unsigned32; |
---|
566 | User_Initialization_Tasks_Table : |
---|
567 | RTEMS.Initialization_Tasks_Table_Pointer; |
---|
568 | end record; |
---|
569 | |
---|
570 | type API_Configuration_Table_Pointer is access all API_Configuration_Table; |
---|
571 | |
---|
572 | -- |
---|
573 | -- RTEMS POSIX API Configuration Information |
---|
574 | -- |
---|
575 | |
---|
576 | type POSIX_Thread_Entry is access procedure ( |
---|
577 | Argument : in RTEMS.Address |
---|
578 | ); |
---|
579 | |
---|
580 | type POSIX_Initialization_Threads_Table_Entry is |
---|
581 | record |
---|
582 | Thread_Entry : RTEMS.POSIX_Thread_Entry; |
---|
583 | end record; |
---|
584 | |
---|
585 | type POSIX_Initialization_Threads_Table is array |
---|
586 | ( RTEMS.Unsigned32 range <> ) of |
---|
587 | RTEMS.POSIX_Initialization_Threads_Table_Entry; |
---|
588 | |
---|
589 | type POSIX_Initialization_Threads_Table_Pointer is access all |
---|
590 | POSIX_Initialization_Threads_Table; |
---|
591 | |
---|
592 | type POSIX_API_Configuration_Table_Entry is |
---|
593 | record |
---|
594 | Maximum_Threads : Interfaces.C.Int; |
---|
595 | Maximum_Mutexes : Interfaces.C.Int; |
---|
596 | Maximum_Condition_Variables : Interfaces.C.Int; |
---|
597 | Maximum_Keys : Interfaces.C.Int; |
---|
598 | Maximum_Queued_Signals : Interfaces.C.Int; |
---|
599 | Number_Of_Initialization_Tasks : Interfaces.C.Int; |
---|
600 | User_Initialization_Tasks_Table : |
---|
601 | RTEMS.POSIX_Initialization_Threads_Table_Pointer; |
---|
602 | end record; |
---|
603 | |
---|
604 | type POSIX_API_Configuration_Table is array ( RTEMS.Unsigned32 range <> ) of |
---|
605 | RTEMS.POSIX_API_Configuration_Table_Entry; |
---|
606 | |
---|
607 | type POSIX_API_Configuration_Table_Pointer is access all |
---|
608 | RTEMS.POSIX_API_Configuration_Table; |
---|
609 | |
---|
610 | -- |
---|
611 | -- MPCI Information include MPCI Configuration |
---|
612 | -- |
---|
613 | |
---|
614 | type Configuration_Table_Pointer; |
---|
615 | |
---|
616 | type MP_Packet_Classes is ( |
---|
617 | MP_PACKET_MPCI_INTERNAL, |
---|
618 | MP_PACKET_TASKS, |
---|
619 | MP_PACKET_MESSAGE_QUEUE, |
---|
620 | MP_PACKET_SEMAPHORE, |
---|
621 | MP_PACKET_PARTITION, |
---|
622 | MP_PACKET_REGION, |
---|
623 | MP_PACKET_EVENT, |
---|
624 | MP_PACKET_SIGNAL |
---|
625 | ); |
---|
626 | |
---|
627 | for MP_Packet_Classes use ( |
---|
628 | MP_PACKET_MPCI_INTERNAL => 0, |
---|
629 | MP_PACKET_TASKS => 1, |
---|
630 | MP_PACKET_MESSAGE_QUEUE => 2, |
---|
631 | MP_PACKET_SEMAPHORE => 3, |
---|
632 | MP_PACKET_PARTITION => 4, |
---|
633 | MP_PACKET_REGION => 5, |
---|
634 | MP_PACKET_EVENT => 6, |
---|
635 | MP_PACKET_SIGNAL => 7 |
---|
636 | ); |
---|
637 | |
---|
638 | type Packet_Prefix is |
---|
639 | record |
---|
640 | The_Class : RTEMS.MP_Packet_Classes; |
---|
641 | ID : RTEMS.ID; |
---|
642 | Source_TID : RTEMS.ID; |
---|
643 | Source_Priority : RTEMS.Task_Priority; |
---|
644 | Return_Code : RTEMS.Unsigned32; |
---|
645 | Length : RTEMS.Unsigned32; |
---|
646 | To_Convert : RTEMS.Unsigned32; |
---|
647 | Timeout : RTEMS.Interval; |
---|
648 | end record; |
---|
649 | |
---|
650 | type Packet_Prefix_Pointer is access all Packet_Prefix; |
---|
651 | |
---|
652 | type MPCI_Initialization_Entry is access procedure ( |
---|
653 | Configuration : in RTEMS.Configuration_Table_Pointer |
---|
654 | ); |
---|
655 | |
---|
656 | type MPCI_Get_Packet_Entry is access procedure ( |
---|
657 | Packet : access RTEMS.Packet_Prefix_Pointer |
---|
658 | ); |
---|
659 | |
---|
660 | type MPCI_Return_Packet_Entry is access procedure ( |
---|
661 | Packet : in RTEMS.Packet_Prefix_Pointer |
---|
662 | ); |
---|
663 | |
---|
664 | type MPCI_Send_Entry is access procedure ( |
---|
665 | Packet : in RTEMS.Packet_Prefix_Pointer |
---|
666 | ); |
---|
667 | |
---|
668 | type MPCI_Receive_Entry is access procedure ( |
---|
669 | Packet : access RTEMS.Packet_Prefix_Pointer |
---|
670 | ); |
---|
671 | |
---|
672 | type MPCI_Table is |
---|
673 | record |
---|
674 | Default_Timeout : RTEMS.Unsigned32; -- in ticks |
---|
675 | Maximum_Packet_Size : RTEMS.Unsigned32; |
---|
676 | Initialization : RTEMS.MPCI_Initialization_Entry; |
---|
677 | Get_Packet : RTEMS.MPCI_Get_Packet_Entry; |
---|
678 | Return_Packet : RTEMS.MPCI_Return_Packet_Entry; |
---|
679 | Send : RTEMS.MPCI_Send_Entry; |
---|
680 | Receive : RTEMS.MPCI_Receive_Entry; |
---|
681 | end record; |
---|
682 | |
---|
683 | type MPCI_Table_Pointer is access all MPCI_Table; |
---|
684 | |
---|
685 | -- |
---|
686 | -- Configuration Information |
---|
687 | -- |
---|
688 | |
---|
689 | type Multiprocessing_Table is |
---|
690 | record |
---|
691 | Node : RTEMS.Unsigned32; |
---|
692 | Maximum_Nodes : RTEMS.Unsigned32; |
---|
693 | Maximum_Global_Objects : RTEMS.Unsigned32; |
---|
694 | Maximum_Proxies : RTEMS.Unsigned32; |
---|
695 | User_MPCI_Table : RTEMS.MPCI_Table_Pointer; |
---|
696 | end record; |
---|
697 | |
---|
698 | type Multiprocessing_Table_Pointer is access all Multiprocessing_Table; |
---|
699 | |
---|
700 | type Configuration_Table is |
---|
701 | record |
---|
702 | Work_Space_Start : RTEMS.Address; |
---|
703 | Work_Space_Size : RTEMS.Unsigned32; |
---|
704 | Maximum_Extensions : RTEMS.Unsigned32; |
---|
705 | Microseconds_Per_Tick : RTEMS.Unsigned32; |
---|
706 | Ticks_Per_Timeslice : RTEMS.Unsigned32; |
---|
707 | Maximum_Devices : RTEMS.Unsigned32; |
---|
708 | Maximum_Drivers : RTEMS.Unsigned32; |
---|
709 | Number_Of_Device_Drivers : RTEMS.Unsigned32; |
---|
710 | Device_Driver_Table : RTEMS.Driver_Address_Table_Pointer; |
---|
711 | Number_Of_Initial_Extensions : RTEMS.Unsigned32; |
---|
712 | User_Extension_Table : RTEMS.Extensions_Table_Pointer; |
---|
713 | User_Multiprocessing_Table : RTEMS.Multiprocessing_Table_Pointer; |
---|
714 | |
---|
715 | RTEMS_API_Configuration : RTEMS.API_Configuration_Table_Pointer; |
---|
716 | POSIX_API_Configuration : RTEMS.POSIX_API_Configuration_Table_Pointer; |
---|
717 | ITRON_API_Configuration : RTEMS.Address; -- XXX FIX ME |
---|
718 | end record; |
---|
719 | |
---|
720 | type Configuration_Table_Pointer is access all Configuration_Table; |
---|
721 | |
---|
722 | -- |
---|
723 | -- For now, do not provide access to the CPU Table from Ada. |
---|
724 | -- When this type is provided, a CPU dependent file must |
---|
725 | -- define it. |
---|
726 | -- |
---|
727 | |
---|
728 | subtype CPU_Table is RTEMS.Address; |
---|
729 | type CPU_Table_Pointer is access all CPU_Table; |
---|
730 | |
---|
731 | -- |
---|
732 | -- Utility Functions |
---|
733 | -- |
---|
734 | |
---|
735 | function From_Ada_Boolean ( |
---|
736 | Ada_Boolean : Standard.Boolean |
---|
737 | ) return RTEMS.Boolean; |
---|
738 | |
---|
739 | function To_Ada_Boolean ( |
---|
740 | RTEMS_Boolean : RTEMS.Boolean |
---|
741 | ) return Standard.Boolean; |
---|
742 | |
---|
743 | function Milliseconds_To_Microseconds ( |
---|
744 | Milliseconds : RTEMS.Unsigned32 |
---|
745 | ) return RTEMS.Unsigned32; |
---|
746 | |
---|
747 | function Microseconds_To_Ticks ( |
---|
748 | Microseconds : RTEMS.Unsigned32 |
---|
749 | ) return RTEMS.Interval; |
---|
750 | |
---|
751 | function Milliseconds_To_Ticks ( |
---|
752 | Milliseconds : RTEMS.Unsigned32 |
---|
753 | ) return RTEMS.Interval; |
---|
754 | |
---|
755 | function Build_Name ( |
---|
756 | C1 : in Character; |
---|
757 | C2 : in Character; |
---|
758 | C3 : in Character; |
---|
759 | C4 : in Character |
---|
760 | ) return RTEMS.Name; |
---|
761 | |
---|
762 | procedure Name_To_Characters ( |
---|
763 | Name : in RTEMS.Name; |
---|
764 | C1 : out Character; |
---|
765 | C2 : out Character; |
---|
766 | C3 : out Character; |
---|
767 | C4 : out Character |
---|
768 | ); |
---|
769 | |
---|
770 | function Get_Node ( |
---|
771 | ID : in RTEMS.ID |
---|
772 | ) return RTEMS.Unsigned32; |
---|
773 | |
---|
774 | function Get_Index ( |
---|
775 | ID : in RTEMS.ID |
---|
776 | ) return RTEMS.Unsigned32; |
---|
777 | |
---|
778 | function Are_Statuses_Equal ( |
---|
779 | Status : in RTEMS.Status_Codes; |
---|
780 | Desired : in RTEMS.Status_Codes |
---|
781 | ) return Standard.Boolean; |
---|
782 | |
---|
783 | function Is_Status_Successful ( |
---|
784 | Status : in RTEMS.Status_Codes |
---|
785 | ) return Standard.Boolean; |
---|
786 | |
---|
787 | function Subtract ( |
---|
788 | Left : in RTEMS.Address; |
---|
789 | Right : in RTEMS.Address |
---|
790 | ) return RTEMS.Unsigned32; |
---|
791 | |
---|
792 | function Are_Equal ( |
---|
793 | Left : in RTEMS.Address; |
---|
794 | Right : in RTEMS.Address |
---|
795 | ) return Standard.Boolean; |
---|
796 | -- |
---|
797 | -- RTEMS API |
---|
798 | -- |
---|
799 | |
---|
800 | -- |
---|
801 | -- Initialization Manager |
---|
802 | -- |
---|
803 | |
---|
804 | procedure Initialize_Executive ( |
---|
805 | Configuration_Table : in RTEMS.Configuration_Table_Pointer; |
---|
806 | CPU_Table : in RTEMS.CPU_Table_Pointer |
---|
807 | ); |
---|
808 | |
---|
809 | procedure Initialize_Executive_Early ( |
---|
810 | Configuration_Table : in RTEMS.Configuration_Table_Pointer; |
---|
811 | CPU_Table : in RTEMS.CPU_Table_Pointer; |
---|
812 | Level : out RTEMS.ISR_Level |
---|
813 | ); |
---|
814 | |
---|
815 | procedure Initialize_Executive_Late ( |
---|
816 | BSP_Level : in RTEMS.ISR_Level |
---|
817 | ); |
---|
818 | |
---|
819 | procedure Shutdown_Executive ( |
---|
820 | Result : in RTEMS.Unsigned32 |
---|
821 | ); |
---|
822 | |
---|
823 | -- |
---|
824 | -- Task Manager |
---|
825 | -- |
---|
826 | |
---|
827 | procedure Task_Create ( |
---|
828 | Name : in RTEMS.Name; |
---|
829 | Initial_Priority : in RTEMS.Task_Priority; |
---|
830 | Stack_Size : in Unsigned32; |
---|
831 | Initial_Modes : in RTEMS.Mode; |
---|
832 | Attribute_Set : in RTEMS.Attribute; |
---|
833 | ID : out RTEMS.ID; |
---|
834 | Result : out RTEMS.Status_Codes |
---|
835 | ); |
---|
836 | |
---|
837 | procedure Task_Ident ( |
---|
838 | Name : in RTEMS.Name; |
---|
839 | Node : in RTEMS.Node; |
---|
840 | ID : out RTEMS.ID; |
---|
841 | Result : out RTEMS.Status_Codes |
---|
842 | ); |
---|
843 | |
---|
844 | procedure Task_Start ( |
---|
845 | ID : in RTEMS.ID; |
---|
846 | Entry_Point : in RTEMS.Task_Entry; |
---|
847 | Argument : in RTEMS.Task_Argument; |
---|
848 | Result : out RTEMS.Status_Codes |
---|
849 | ); |
---|
850 | |
---|
851 | procedure Task_Restart ( |
---|
852 | ID : in RTEMS.ID; |
---|
853 | Argument : in RTEMS.Task_Argument; |
---|
854 | Result : out RTEMS.Status_Codes |
---|
855 | ); |
---|
856 | |
---|
857 | procedure Task_Delete ( |
---|
858 | ID : in RTEMS.ID; |
---|
859 | Result : out RTEMS.Status_Codes |
---|
860 | ); |
---|
861 | |
---|
862 | procedure Task_Suspend ( |
---|
863 | ID : in RTEMS.ID; |
---|
864 | Result : out RTEMS.Status_Codes |
---|
865 | ); |
---|
866 | |
---|
867 | procedure Task_Resume ( |
---|
868 | ID : in RTEMS.ID; |
---|
869 | Result : out RTEMS.Status_Codes |
---|
870 | ); |
---|
871 | |
---|
872 | procedure Task_Set_Priority ( |
---|
873 | ID : in RTEMS.ID; |
---|
874 | New_Priority : in RTEMS.Task_Priority; |
---|
875 | Old_Priority : out RTEMS.Task_Priority; |
---|
876 | Result : out RTEMS.Status_Codes |
---|
877 | ); |
---|
878 | |
---|
879 | procedure Task_Mode ( |
---|
880 | Mode_Set : in RTEMS.Mode; |
---|
881 | Mask : in RTEMS.Mode; |
---|
882 | Previous_Mode_Set : out RTEMS.Mode; |
---|
883 | Result : out RTEMS.Status_Codes |
---|
884 | ); |
---|
885 | |
---|
886 | procedure Task_Get_Note ( |
---|
887 | ID : in RTEMS.ID; |
---|
888 | Notepad : in RTEMS.Notepad_Index; |
---|
889 | Note : out RTEMS.Unsigned32; |
---|
890 | Result : out RTEMS.Status_Codes |
---|
891 | ); |
---|
892 | |
---|
893 | procedure Task_Set_Note ( |
---|
894 | ID : in RTEMS.ID; |
---|
895 | Notepad : in RTEMS.Notepad_Index; |
---|
896 | Note : in RTEMS.Unsigned32; |
---|
897 | Result : out RTEMS.Status_Codes |
---|
898 | ); |
---|
899 | |
---|
900 | procedure Task_Wake_When ( |
---|
901 | Time_Buffer : in RTEMS.Time_Of_Day; |
---|
902 | Result : out RTEMS.Status_Codes |
---|
903 | ); |
---|
904 | |
---|
905 | procedure Task_Wake_After ( |
---|
906 | Ticks : in RTEMS.Interval; |
---|
907 | Result : out RTEMS.Status_Codes |
---|
908 | ); |
---|
909 | |
---|
910 | -- |
---|
911 | -- Interrupt Manager |
---|
912 | -- |
---|
913 | |
---|
914 | procedure Interrupt_Catch ( |
---|
915 | New_ISR_Handler : in RTEMS.Address; |
---|
916 | Vector : in RTEMS.Vector_Number; |
---|
917 | Old_ISR_Handler : out RTEMS.Address; |
---|
918 | Result : out RTEMS.Status_Codes |
---|
919 | ); |
---|
920 | |
---|
921 | function Interrupt_Disable return RTEMS.ISR_Level; |
---|
922 | pragma Interface (C, Interrupt_Disable); |
---|
923 | pragma Interface_Name (Interrupt_Disable, "rtems_interrupt_disable"); |
---|
924 | |
---|
925 | procedure Interrupt_Enable ( |
---|
926 | Level : in RTEMS.ISR_Level |
---|
927 | ); |
---|
928 | pragma Interface (C, Interrupt_Enable); |
---|
929 | pragma Interface_Name (Interrupt_Enable, "rtems_interrupt_enable"); |
---|
930 | |
---|
931 | procedure Interrupt_Flash ( |
---|
932 | Level : in RTEMS.ISR_Level |
---|
933 | ); |
---|
934 | pragma Interface (C, Interrupt_Flash); |
---|
935 | pragma Interface_Name (Interrupt_Flash, "rtems_interrupt_flash"); |
---|
936 | |
---|
937 | function Interrupt_Is_In_Progress return RTEMS.Boolean; |
---|
938 | pragma Interface (C, Interrupt_Is_In_Progress); |
---|
939 | pragma Interface_Name |
---|
940 | (Interrupt_Is_In_Progress, "rtems_interrupt_is_in_progress"); |
---|
941 | |
---|
942 | -- |
---|
943 | -- Clock Manager |
---|
944 | -- |
---|
945 | |
---|
946 | procedure Clock_Get ( |
---|
947 | Option : in RTEMS.Clock_Get_Options; |
---|
948 | Time_Buffer : in RTEMS.Address; |
---|
949 | Result : out RTEMS.Status_Codes |
---|
950 | ); |
---|
951 | |
---|
952 | procedure Clock_Set ( |
---|
953 | Time_Buffer : in RTEMS.Time_Of_Day; |
---|
954 | Result : out RTEMS.Status_Codes |
---|
955 | ); |
---|
956 | |
---|
957 | procedure Clock_Tick ( |
---|
958 | Result : out RTEMS.Status_Codes |
---|
959 | ); |
---|
960 | |
---|
961 | -- |
---|
962 | -- Extension Manager |
---|
963 | -- |
---|
964 | |
---|
965 | procedure Extension_Create ( |
---|
966 | Name : in RTEMS.Name; |
---|
967 | Table : in RTEMS.Extensions_Table_Pointer; |
---|
968 | ID : out RTEMS.ID; |
---|
969 | Result : out RTEMS.Status_Codes |
---|
970 | ); |
---|
971 | |
---|
972 | procedure Extension_Ident ( |
---|
973 | Name : in RTEMS.Name; |
---|
974 | ID : out RTEMS.ID; |
---|
975 | Result : out RTEMS.Status_Codes |
---|
976 | ); |
---|
977 | |
---|
978 | procedure Extension_Delete ( |
---|
979 | ID : in RTEMS.ID; |
---|
980 | Result : out RTEMS.Status_Codes |
---|
981 | ); |
---|
982 | |
---|
983 | |
---|
984 | -- |
---|
985 | -- Timer Manager |
---|
986 | -- |
---|
987 | |
---|
988 | procedure Timer_Create ( |
---|
989 | Name : in RTEMS.Name; |
---|
990 | ID : out RTEMS.ID; |
---|
991 | Result : out RTEMS.Status_Codes |
---|
992 | ); |
---|
993 | |
---|
994 | procedure Timer_Ident ( |
---|
995 | Name : in RTEMS.Name; |
---|
996 | ID : out RTEMS.ID; |
---|
997 | Result : out RTEMS.Status_Codes |
---|
998 | ); |
---|
999 | |
---|
1000 | procedure Timer_Delete ( |
---|
1001 | ID : in RTEMS.ID; |
---|
1002 | Result : out RTEMS.Status_Codes |
---|
1003 | ); |
---|
1004 | |
---|
1005 | procedure Timer_Fire_After ( |
---|
1006 | ID : in RTEMS.ID; |
---|
1007 | Ticks : in RTEMS.Interval; |
---|
1008 | Routine : in RTEMS.Timer_Service_Routine; |
---|
1009 | User_Data : in RTEMS.Address; |
---|
1010 | Result : out RTEMS.Status_Codes |
---|
1011 | ); |
---|
1012 | |
---|
1013 | procedure Timer_Server_Fire_After ( |
---|
1014 | ID : in RTEMS.ID; |
---|
1015 | Ticks : in RTEMS.Interval; |
---|
1016 | Routine : in RTEMS.Timer_Service_Routine; |
---|
1017 | User_Data : in RTEMS.Address; |
---|
1018 | Result : out RTEMS.Status_Codes |
---|
1019 | ); |
---|
1020 | |
---|
1021 | procedure Timer_Fire_When ( |
---|
1022 | ID : in RTEMS.ID; |
---|
1023 | Wall_Time : in RTEMS.Time_Of_Day; |
---|
1024 | Routine : in RTEMS.Timer_Service_Routine; |
---|
1025 | User_Data : in RTEMS.Address; |
---|
1026 | Result : out RTEMS.Status_Codes |
---|
1027 | ); |
---|
1028 | |
---|
1029 | procedure Timer_Server_Fire_When ( |
---|
1030 | ID : in RTEMS.ID; |
---|
1031 | Wall_Time : in RTEMS.Time_Of_Day; |
---|
1032 | Routine : in RTEMS.Timer_Service_Routine; |
---|
1033 | User_Data : in RTEMS.Address; |
---|
1034 | Result : out RTEMS.Status_Codes |
---|
1035 | ); |
---|
1036 | |
---|
1037 | procedure Timer_Reset ( |
---|
1038 | ID : in RTEMS.ID; |
---|
1039 | Result : out RTEMS.Status_Codes |
---|
1040 | ); |
---|
1041 | |
---|
1042 | procedure Timer_Cancel ( |
---|
1043 | ID : in RTEMS.ID; |
---|
1044 | Result : out RTEMS.Status_Codes |
---|
1045 | ); |
---|
1046 | |
---|
1047 | procedure Timer_Initiate_Server ( |
---|
1048 | Server_Priority : in RTEMS.Task_Priority; |
---|
1049 | Stack_Size : in Unsigned32; |
---|
1050 | Attribute_Set : in RTEMS.Attribute; |
---|
1051 | Result : out RTEMS.Status_Codes |
---|
1052 | ); |
---|
1053 | |
---|
1054 | -- |
---|
1055 | -- Semaphore Manager |
---|
1056 | -- |
---|
1057 | |
---|
1058 | procedure Semaphore_Create ( |
---|
1059 | Name : in RTEMS.Name; |
---|
1060 | Count : in RTEMS.Unsigned32; |
---|
1061 | Attribute_Set : in RTEMS.Attribute; |
---|
1062 | Priority_Ceiling : in RTEMS.Task_Priority; |
---|
1063 | ID : out RTEMS.ID; |
---|
1064 | Result : out RTEMS.Status_Codes |
---|
1065 | ); |
---|
1066 | |
---|
1067 | procedure Semaphore_Delete ( |
---|
1068 | ID : in RTEMS.ID; |
---|
1069 | Result : out RTEMS.Status_Codes |
---|
1070 | ); |
---|
1071 | |
---|
1072 | procedure Semaphore_Ident ( |
---|
1073 | Name : in RTEMS.Name; |
---|
1074 | Node : in RTEMS.Unsigned32; |
---|
1075 | ID : out RTEMS.ID; |
---|
1076 | Result : out RTEMS.Status_Codes |
---|
1077 | ); |
---|
1078 | |
---|
1079 | procedure Semaphore_Obtain ( |
---|
1080 | ID : in RTEMS.ID; |
---|
1081 | Option_Set : in RTEMS.Option; |
---|
1082 | Timeout : in RTEMS.Interval; |
---|
1083 | Result : out RTEMS.Status_Codes |
---|
1084 | ); |
---|
1085 | |
---|
1086 | procedure Semaphore_Release ( |
---|
1087 | ID : in RTEMS.ID; |
---|
1088 | Result : out RTEMS.Status_Codes |
---|
1089 | ); |
---|
1090 | |
---|
1091 | |
---|
1092 | -- |
---|
1093 | -- Message Queue Manager |
---|
1094 | -- |
---|
1095 | |
---|
1096 | procedure Message_Queue_Create ( |
---|
1097 | Name : in RTEMS.Name; |
---|
1098 | Count : in RTEMS.Unsigned32; |
---|
1099 | Max_Message_Size : in RTEMS.Unsigned32; |
---|
1100 | Attribute_Set : in RTEMS.Attribute; |
---|
1101 | ID : out RTEMS.ID; |
---|
1102 | Result : out RTEMS.Status_Codes |
---|
1103 | ); |
---|
1104 | |
---|
1105 | procedure Message_Queue_Ident ( |
---|
1106 | Name : in RTEMS.Name; |
---|
1107 | Node : in RTEMS.Unsigned32; |
---|
1108 | ID : out RTEMS.ID; |
---|
1109 | Result : out RTEMS.Status_Codes |
---|
1110 | ); |
---|
1111 | |
---|
1112 | procedure Message_Queue_Delete ( |
---|
1113 | ID : in RTEMS.ID; |
---|
1114 | Result : out RTEMS.Status_Codes |
---|
1115 | ); |
---|
1116 | |
---|
1117 | procedure Message_Queue_Send ( |
---|
1118 | ID : in RTEMS.ID; |
---|
1119 | Buffer : in RTEMS.Address; |
---|
1120 | Size : in RTEMS.Unsigned32; |
---|
1121 | Result : out RTEMS.Status_Codes |
---|
1122 | ); |
---|
1123 | |
---|
1124 | procedure Message_Queue_Urgent ( |
---|
1125 | ID : in RTEMS.ID; |
---|
1126 | Buffer : in RTEMS.Address; |
---|
1127 | Size : in RTEMS.Unsigned32; |
---|
1128 | Result : out RTEMS.Status_Codes |
---|
1129 | ); |
---|
1130 | |
---|
1131 | procedure Message_Queue_Broadcast ( |
---|
1132 | ID : in RTEMS.ID; |
---|
1133 | Buffer : in RTEMS.Address; |
---|
1134 | Size : in RTEMS.Unsigned32; |
---|
1135 | Count : out RTEMS.Unsigned32; |
---|
1136 | Result : out RTEMS.Status_Codes |
---|
1137 | ); |
---|
1138 | |
---|
1139 | procedure Message_Queue_Receive ( |
---|
1140 | ID : in RTEMS.ID; |
---|
1141 | Buffer : in RTEMS.Address; |
---|
1142 | Option_Set : in RTEMS.Option; |
---|
1143 | Timeout : in RTEMS.Interval; |
---|
1144 | Size : out RTEMS.Unsigned32; |
---|
1145 | Result : out RTEMS.Status_Codes |
---|
1146 | ); |
---|
1147 | |
---|
1148 | procedure Message_Queue_Flush ( |
---|
1149 | ID : in RTEMS.ID; |
---|
1150 | Count : out RTEMS.Unsigned32; |
---|
1151 | Result : out RTEMS.Status_Codes |
---|
1152 | ); |
---|
1153 | |
---|
1154 | |
---|
1155 | -- |
---|
1156 | -- Event Manager |
---|
1157 | -- |
---|
1158 | |
---|
1159 | procedure Event_Send ( |
---|
1160 | ID : in RTEMS.ID; |
---|
1161 | Event_In : in RTEMS.Event_Set; |
---|
1162 | Result : out RTEMS.Status_Codes |
---|
1163 | ); |
---|
1164 | |
---|
1165 | procedure Event_Receive ( |
---|
1166 | Event_In : in RTEMS.Event_Set; |
---|
1167 | Option_Set : in RTEMS.Option; |
---|
1168 | Ticks : in RTEMS.Interval; |
---|
1169 | Event_Out : out RTEMS.Event_Set; |
---|
1170 | Result : out RTEMS.Status_Codes |
---|
1171 | ); |
---|
1172 | |
---|
1173 | -- |
---|
1174 | -- Signal Manager |
---|
1175 | -- |
---|
1176 | |
---|
1177 | procedure Signal_Catch ( |
---|
1178 | ASR_Handler : in RTEMS.ASR_Handler; |
---|
1179 | Mode_Set : in RTEMS.Mode; |
---|
1180 | Result : out RTEMS.Status_Codes |
---|
1181 | ); |
---|
1182 | |
---|
1183 | procedure Signal_Send ( |
---|
1184 | ID : in RTEMS.ID; |
---|
1185 | Signal_Set : in RTEMS.Signal_Set; |
---|
1186 | Result : out RTEMS.Status_Codes |
---|
1187 | ); |
---|
1188 | |
---|
1189 | |
---|
1190 | -- |
---|
1191 | -- Partition Manager |
---|
1192 | -- |
---|
1193 | |
---|
1194 | procedure Partition_Create ( |
---|
1195 | Name : in RTEMS.Name; |
---|
1196 | Starting_Address : in RTEMS.Address; |
---|
1197 | Length : in RTEMS.Unsigned32; |
---|
1198 | Buffer_Size : in RTEMS.Unsigned32; |
---|
1199 | Attribute_Set : in RTEMS.Attribute; |
---|
1200 | ID : out RTEMS.ID; |
---|
1201 | Result : out RTEMS.Status_Codes |
---|
1202 | ); |
---|
1203 | |
---|
1204 | procedure Partition_Ident ( |
---|
1205 | Name : in RTEMS.Name; |
---|
1206 | Node : in RTEMS.Unsigned32; |
---|
1207 | ID : out RTEMS.ID; |
---|
1208 | Result : out RTEMS.Status_Codes |
---|
1209 | ); |
---|
1210 | |
---|
1211 | procedure Partition_Delete ( |
---|
1212 | ID : in RTEMS.ID; |
---|
1213 | Result : out RTEMS.Status_Codes |
---|
1214 | ); |
---|
1215 | |
---|
1216 | procedure Partition_Get_Buffer ( |
---|
1217 | ID : in RTEMS.ID; |
---|
1218 | Buffer : out RTEMS.Address; |
---|
1219 | Result : out RTEMS.Status_Codes |
---|
1220 | ); |
---|
1221 | |
---|
1222 | procedure Partition_Return_Buffer ( |
---|
1223 | ID : in RTEMS.ID; |
---|
1224 | Buffer : in RTEMS.Address; |
---|
1225 | Result : out RTEMS.Status_Codes |
---|
1226 | ); |
---|
1227 | |
---|
1228 | |
---|
1229 | -- |
---|
1230 | -- Region Manager |
---|
1231 | -- |
---|
1232 | |
---|
1233 | procedure Region_Create ( |
---|
1234 | Name : in RTEMS.Name; |
---|
1235 | Starting_Address : in RTEMS.Address; |
---|
1236 | Length : in RTEMS.Unsigned32; |
---|
1237 | Page_Size : in RTEMS.Unsigned32; |
---|
1238 | Attribute_Set : in RTEMS.Attribute; |
---|
1239 | ID : out RTEMS.ID; |
---|
1240 | Result : out RTEMS.Status_Codes |
---|
1241 | ); |
---|
1242 | |
---|
1243 | procedure Region_Ident ( |
---|
1244 | Name : in RTEMS.Name; |
---|
1245 | ID : out RTEMS.ID; |
---|
1246 | Result : out RTEMS.Status_Codes |
---|
1247 | ); |
---|
1248 | |
---|
1249 | procedure Region_Delete ( |
---|
1250 | ID : in RTEMS.ID; |
---|
1251 | Result : out RTEMS.Status_Codes |
---|
1252 | ); |
---|
1253 | |
---|
1254 | procedure Region_Extend ( |
---|
1255 | ID : in RTEMS.ID; |
---|
1256 | Starting_Address : in RTEMS.Address; |
---|
1257 | Length : in RTEMS.Unsigned32; |
---|
1258 | Result : out RTEMS.Status_Codes |
---|
1259 | ); |
---|
1260 | |
---|
1261 | procedure Region_Get_Segment ( |
---|
1262 | ID : in RTEMS.ID; |
---|
1263 | Size : in RTEMS.Unsigned32; |
---|
1264 | Option_Set : in RTEMS.Option; |
---|
1265 | Timeout : in RTEMS.Interval; |
---|
1266 | Segment : out RTEMS.Address; |
---|
1267 | Result : out RTEMS.Status_Codes |
---|
1268 | ); |
---|
1269 | |
---|
1270 | procedure Region_Get_Segment_Size ( |
---|
1271 | ID : in RTEMS.ID; |
---|
1272 | Segment : in RTEMS.Address; |
---|
1273 | Size : out RTEMS.Unsigned32; |
---|
1274 | Result : out RTEMS.Status_Codes |
---|
1275 | ); |
---|
1276 | |
---|
1277 | procedure Region_Return_Segment ( |
---|
1278 | ID : in RTEMS.ID; |
---|
1279 | Segment : in RTEMS.Address; |
---|
1280 | Result : out RTEMS.Status_Codes |
---|
1281 | ); |
---|
1282 | |
---|
1283 | |
---|
1284 | -- |
---|
1285 | -- Dual Ported Memory Manager |
---|
1286 | -- |
---|
1287 | |
---|
1288 | procedure Port_Create ( |
---|
1289 | Name : in RTEMS.Name; |
---|
1290 | Internal_Start : in RTEMS.Address; |
---|
1291 | External_Start : in RTEMS.Address; |
---|
1292 | Length : in RTEMS.Unsigned32; |
---|
1293 | ID : out RTEMS.ID; |
---|
1294 | Result : out RTEMS.Status_Codes |
---|
1295 | ); |
---|
1296 | |
---|
1297 | procedure Port_Ident ( |
---|
1298 | Name : in RTEMS.Name; |
---|
1299 | ID : out RTEMS.ID; |
---|
1300 | Result : out RTEMS.Status_Codes |
---|
1301 | ); |
---|
1302 | |
---|
1303 | procedure Port_Delete ( |
---|
1304 | ID : in RTEMS.ID; |
---|
1305 | Result : out RTEMS.Status_Codes |
---|
1306 | ); |
---|
1307 | |
---|
1308 | procedure Port_External_To_Internal ( |
---|
1309 | ID : in RTEMS.ID; |
---|
1310 | External : in RTEMS.Address; |
---|
1311 | Internal : out RTEMS.Address; |
---|
1312 | Result : out RTEMS.Status_Codes |
---|
1313 | ); |
---|
1314 | |
---|
1315 | procedure Port_Internal_To_External ( |
---|
1316 | ID : in RTEMS.ID; |
---|
1317 | Internal : in RTEMS.Address; |
---|
1318 | External : out RTEMS.Address; |
---|
1319 | Result : out RTEMS.Status_Codes |
---|
1320 | ); |
---|
1321 | |
---|
1322 | -- |
---|
1323 | -- Input/Output Manager |
---|
1324 | -- |
---|
1325 | |
---|
1326 | procedure IO_Initialize ( |
---|
1327 | Major : in RTEMS.Device_Major_Number; |
---|
1328 | Minor : in RTEMS.Device_Minor_Number; |
---|
1329 | Argument : in RTEMS.Address; |
---|
1330 | Result : out RTEMS.Status_Codes |
---|
1331 | ); |
---|
1332 | |
---|
1333 | procedure IO_Register_Name ( |
---|
1334 | Name : in String; |
---|
1335 | Major : in RTEMS.Device_Major_Number; |
---|
1336 | Minor : in RTEMS.Device_Minor_Number; |
---|
1337 | Result : out RTEMS.Status_Codes |
---|
1338 | ); |
---|
1339 | |
---|
1340 | procedure IO_Lookup_Name ( |
---|
1341 | Name : in String; |
---|
1342 | Device_Info : out RTEMS.Driver_Name_t; |
---|
1343 | Result : out RTEMS.Status_Codes |
---|
1344 | ); |
---|
1345 | |
---|
1346 | procedure IO_Open ( |
---|
1347 | Major : in RTEMS.Device_Major_Number; |
---|
1348 | Minor : in RTEMS.Device_Minor_Number; |
---|
1349 | Argument : in RTEMS.Address; |
---|
1350 | Result : out RTEMS.Status_Codes |
---|
1351 | ); |
---|
1352 | |
---|
1353 | procedure IO_Close ( |
---|
1354 | Major : in RTEMS.Device_Major_Number; |
---|
1355 | Minor : in RTEMS.Device_Minor_Number; |
---|
1356 | Argument : in RTEMS.Address; |
---|
1357 | Result : out RTEMS.Status_Codes |
---|
1358 | ); |
---|
1359 | |
---|
1360 | procedure IO_Read ( |
---|
1361 | Major : in RTEMS.Device_Major_Number; |
---|
1362 | Minor : in RTEMS.Device_Minor_Number; |
---|
1363 | Argument : in RTEMS.Address; |
---|
1364 | Result : out RTEMS.Status_Codes |
---|
1365 | ); |
---|
1366 | |
---|
1367 | procedure IO_Write ( |
---|
1368 | Major : in RTEMS.Device_Major_Number; |
---|
1369 | Minor : in RTEMS.Device_Minor_Number; |
---|
1370 | Argument : in RTEMS.Address; |
---|
1371 | Result : out RTEMS.Status_Codes |
---|
1372 | ); |
---|
1373 | |
---|
1374 | procedure IO_Control ( |
---|
1375 | Major : in RTEMS.Device_Major_Number; |
---|
1376 | Minor : in RTEMS.Device_Minor_Number; |
---|
1377 | Argument : in RTEMS.Address; |
---|
1378 | Result : out RTEMS.Status_Codes |
---|
1379 | ); |
---|
1380 | |
---|
1381 | |
---|
1382 | -- |
---|
1383 | -- Fatal Error Manager |
---|
1384 | -- |
---|
1385 | |
---|
1386 | procedure Fatal_Error_Occurred ( |
---|
1387 | The_Error : in RTEMS.Unsigned32 |
---|
1388 | ); |
---|
1389 | |
---|
1390 | |
---|
1391 | -- |
---|
1392 | -- Rate Monotonic Manager |
---|
1393 | -- |
---|
1394 | |
---|
1395 | procedure Rate_Monotonic_Create ( |
---|
1396 | Name : in RTEMS.Name; |
---|
1397 | ID : out RTEMS.ID; |
---|
1398 | Result : out RTEMS.Status_Codes |
---|
1399 | ); |
---|
1400 | |
---|
1401 | procedure Rate_Monotonic_Ident ( |
---|
1402 | Name : in RTEMS.Name; |
---|
1403 | ID : out RTEMS.ID; |
---|
1404 | Result : out RTEMS.Status_Codes |
---|
1405 | ); |
---|
1406 | |
---|
1407 | procedure Rate_Monotonic_Delete ( |
---|
1408 | ID : in RTEMS.ID; |
---|
1409 | Result : out RTEMS.Status_Codes |
---|
1410 | ); |
---|
1411 | |
---|
1412 | procedure Rate_Monotonic_Cancel ( |
---|
1413 | ID : in RTEMS.ID; |
---|
1414 | Result : out RTEMS.Status_Codes |
---|
1415 | ); |
---|
1416 | |
---|
1417 | procedure Rate_Monotonic_Period ( |
---|
1418 | ID : in RTEMS.ID; |
---|
1419 | Length : in RTEMS.Interval; |
---|
1420 | Result : out RTEMS.Status_Codes |
---|
1421 | ); |
---|
1422 | |
---|
1423 | procedure Rate_Monotonic_Get_Status ( |
---|
1424 | ID : in RTEMS.ID; |
---|
1425 | Status : out RTEMS.Rate_Monotonic_Period_Status; |
---|
1426 | Result : out RTEMS.Status_Codes |
---|
1427 | ); |
---|
1428 | |
---|
1429 | |
---|
1430 | -- |
---|
1431 | -- Debug Manager |
---|
1432 | -- |
---|
1433 | |
---|
1434 | Debug_All_Mask : constant RTEMS.Debug_Set := 16#ffffffff#; |
---|
1435 | Debug_Region : constant RTEMS.Debug_Set := 16#00000001#; |
---|
1436 | |
---|
1437 | procedure Debug_Enable ( |
---|
1438 | To_Be_Enabled : in RTEMS.Debug_Set |
---|
1439 | ); |
---|
1440 | |
---|
1441 | procedure Debug_Disable ( |
---|
1442 | To_Be_Disabled : in RTEMS.Debug_Set |
---|
1443 | ); |
---|
1444 | |
---|
1445 | function Debug_Is_Enabled ( |
---|
1446 | Level : in RTEMS.Debug_Set |
---|
1447 | ) return RTEMS.Boolean; |
---|
1448 | |
---|
1449 | -- |
---|
1450 | -- Some Useful Data Items |
---|
1451 | -- |
---|
1452 | |
---|
1453 | Configuration : RTEMS.Configuration_Table_Pointer; |
---|
1454 | pragma Import (C, Configuration, "_Configuration_Table"); |
---|
1455 | |
---|
1456 | end RTEMS; |
---|