source: rtems/c/src/ada/rtems.ads @ 29948d48

4.104.114.95
Last change on this file since 29948d48 was 29948d48, checked in by Glenn Humphrey <glenn.humphrey@…>, on 10/18/07 at 21:26:23

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

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