source: rtems/c/src/ada/rtems.ads @ d81d057

4.104.114.84.95
Last change on this file since d81d057 was a6ec372, checked in by Joel Sherrill <joel.sherrill@…>, on 04/02/07 at 20:53:05

2007-04-02 Jennifer Averett <jennifer.averrett@…>

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