source: rtems/cpukit/ada/rtems.ads @ 5c1af4c

4.104.114.84.95
Last change on this file since 5c1af4c was 80f2885b, checked in by Joel Sherrill <joel.sherrill@…>, on 05/20/05 at 19:15:41

2005-05-14 Sergei Organov <osv@…>

PR 746/rtems
Optimize realloc(). The problem is that realloc() can neither grow
nor shrink efficiently the current memory region without support
from underlying heap/region modules. The patch introduces one new
routine for each of heap and region modules, _Heap_Resize_block(),
and rtems_region_resize_segment(), respectively, and uses the
latter to optimize realloc().

The implementation of _Heap_Resize_block() lead to changing of the
heap allocation strategy: now the heap manager, when splits larger
free block into used and new free parts, makes the first part of
the block used, not the last one as it was before. Due to this new
strategy, _Heap_Resize_block() never needs to change the user
pointer.

Caveat: unlike previous heap implementation, first few bytes of
the contents of the memory allocated from the heap are now almost
never all zero. This can trigger bugs in client code that have not
been visible before this patch.

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