source: rtems/c/src/ada/rtems.ads @ 8294a5d9

4.8
Last change on this file since 8294a5d9 was 8294a5d9, checked in by Glenn Humphrey <glenn.humphrey@…>, on 10/26/07 at 21:37:07

2007-10-26 Glenn Humphrey <glenn.humphrey@…>

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