1 | -- |
---|
2 | -- RTEMS / Body |
---|
3 | -- |
---|
4 | -- DESCRIPTION: |
---|
5 | -- |
---|
6 | -- This package provides the interface to the RTEMS API. |
---|
7 | -- |
---|
8 | -- |
---|
9 | -- DEPENDENCIES: |
---|
10 | -- |
---|
11 | -- |
---|
12 | -- |
---|
13 | -- COPYRIGHT (c) 1997-2011. |
---|
14 | -- On-Line Applications Research Corporation (OAR). |
---|
15 | -- |
---|
16 | -- The license and distribution terms for this file may in |
---|
17 | -- the file LICENSE in this distribution or at |
---|
18 | -- http://www.rtems.com/license/LICENSE. |
---|
19 | -- |
---|
20 | -- $Id$ |
---|
21 | -- |
---|
22 | |
---|
23 | package body RTEMS.Port is |
---|
24 | |
---|
25 | -- |
---|
26 | -- Dual Ported Memory Manager |
---|
27 | -- |
---|
28 | |
---|
29 | procedure Create |
---|
30 | (Name : in RTEMS.Name; |
---|
31 | Internal_Start : in RTEMS.Address; |
---|
32 | External_Start : in RTEMS.Address; |
---|
33 | Length : in RTEMS.Unsigned32; |
---|
34 | ID : out RTEMS.ID; |
---|
35 | Result : out RTEMS.Status_Codes) |
---|
36 | is |
---|
37 | function Create_Base |
---|
38 | (Name : RTEMS.Name; |
---|
39 | Internal_Start : RTEMS.Address; |
---|
40 | External_Start : RTEMS.Address; |
---|
41 | Length : RTEMS.Unsigned32; |
---|
42 | ID : access RTEMS.ID) |
---|
43 | return RTEMS.Status_Codes; |
---|
44 | pragma Import (C, Create_Base, "rtems_port_create"); |
---|
45 | ID_Base : aliased RTEMS.ID; |
---|
46 | begin |
---|
47 | |
---|
48 | Result := |
---|
49 | Create_Base |
---|
50 | (Name, |
---|
51 | Internal_Start, |
---|
52 | External_Start, |
---|
53 | Length, |
---|
54 | ID_Base'Access); |
---|
55 | ID := ID_Base; |
---|
56 | |
---|
57 | end Create; |
---|
58 | |
---|
59 | procedure Ident |
---|
60 | (Name : in RTEMS.Name; |
---|
61 | ID : out RTEMS.ID; |
---|
62 | Result : out RTEMS.Status_Codes) |
---|
63 | is |
---|
64 | function Ident_Base |
---|
65 | (Name : RTEMS.Name; |
---|
66 | ID : access RTEMS.ID) |
---|
67 | return RTEMS.Status_Codes; |
---|
68 | pragma Import (C, Ident_Base, "rtems_port_ident"); |
---|
69 | ID_Base : aliased RTEMS.ID; |
---|
70 | begin |
---|
71 | |
---|
72 | Result := Ident_Base (Name, ID_Base'Access); |
---|
73 | ID := ID_Base; |
---|
74 | |
---|
75 | end Ident; |
---|
76 | |
---|
77 | procedure Delete |
---|
78 | (ID : in RTEMS.ID; |
---|
79 | Result : out RTEMS.Status_Codes) |
---|
80 | is |
---|
81 | function Delete_Base (ID : RTEMS.ID) return RTEMS.Status_Codes; |
---|
82 | pragma Import (C, Delete_Base, "rtems_port_delete"); |
---|
83 | begin |
---|
84 | |
---|
85 | Result := Delete_Base (ID); |
---|
86 | |
---|
87 | end Delete; |
---|
88 | |
---|
89 | procedure External_To_Internal |
---|
90 | (ID : in RTEMS.ID; |
---|
91 | External : in RTEMS.Address; |
---|
92 | Internal : out RTEMS.Address; |
---|
93 | Result : out RTEMS.Status_Codes) |
---|
94 | is |
---|
95 | function External_To_Internal_Base |
---|
96 | (ID : RTEMS.ID; |
---|
97 | External : RTEMS.Address; |
---|
98 | Internal : access RTEMS.Address) |
---|
99 | return RTEMS.Status_Codes; |
---|
100 | pragma Import |
---|
101 | (C, |
---|
102 | External_To_Internal_Base, |
---|
103 | "rtems_port_external_to_internal"); |
---|
104 | Internal_Base : aliased RTEMS.Address; |
---|
105 | begin |
---|
106 | |
---|
107 | Result := |
---|
108 | External_To_Internal_Base (ID, External, Internal_Base'Access); |
---|
109 | Internal := Internal_Base; |
---|
110 | |
---|
111 | end External_To_Internal; |
---|
112 | |
---|
113 | procedure Internal_To_External |
---|
114 | (ID : in RTEMS.ID; |
---|
115 | Internal : in RTEMS.Address; |
---|
116 | External : out RTEMS.Address; |
---|
117 | Result : out RTEMS.Status_Codes) |
---|
118 | is |
---|
119 | function Internal_To_External_Base |
---|
120 | (ID : RTEMS.ID; |
---|
121 | Internal : RTEMS.Address; |
---|
122 | External : access RTEMS.Address) |
---|
123 | return RTEMS.Status_Codes; |
---|
124 | pragma Import |
---|
125 | (C, |
---|
126 | Internal_To_External_Base, |
---|
127 | "rtems_port_internal_to_external"); |
---|
128 | External_Base : aliased RTEMS.Address; |
---|
129 | begin |
---|
130 | |
---|
131 | Result := |
---|
132 | Internal_To_External_Base (ID, Internal, External_Base'Access); |
---|
133 | External := External_Base; |
---|
134 | |
---|
135 | end Internal_To_External; |
---|
136 | |
---|
137 | end RTEMS.Port; |
---|