[1987020] | 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 |
---|
[c499856] | 18 | -- http://www.rtems.org/license/LICENSE. |
---|
[1987020] | 19 | -- |
---|
| 20 | |
---|
| 21 | package body RTEMS.Port is |
---|
| 22 | |
---|
| 23 | -- |
---|
| 24 | -- Dual Ported Memory Manager |
---|
| 25 | -- |
---|
| 26 | |
---|
| 27 | procedure Create |
---|
| 28 | (Name : in RTEMS.Name; |
---|
| 29 | Internal_Start : in RTEMS.Address; |
---|
| 30 | External_Start : in RTEMS.Address; |
---|
| 31 | Length : in RTEMS.Unsigned32; |
---|
| 32 | ID : out RTEMS.ID; |
---|
| 33 | Result : out RTEMS.Status_Codes) |
---|
| 34 | is |
---|
| 35 | function Create_Base |
---|
| 36 | (Name : RTEMS.Name; |
---|
| 37 | Internal_Start : RTEMS.Address; |
---|
| 38 | External_Start : RTEMS.Address; |
---|
| 39 | Length : RTEMS.Unsigned32; |
---|
| 40 | ID : access RTEMS.ID) |
---|
| 41 | return RTEMS.Status_Codes; |
---|
| 42 | pragma Import (C, Create_Base, "rtems_port_create"); |
---|
| 43 | ID_Base : aliased RTEMS.ID; |
---|
| 44 | begin |
---|
| 45 | |
---|
| 46 | Result := |
---|
| 47 | Create_Base |
---|
| 48 | (Name, |
---|
| 49 | Internal_Start, |
---|
| 50 | External_Start, |
---|
| 51 | Length, |
---|
| 52 | ID_Base'Access); |
---|
| 53 | ID := ID_Base; |
---|
| 54 | |
---|
| 55 | end Create; |
---|
| 56 | |
---|
| 57 | procedure Ident |
---|
| 58 | (Name : in RTEMS.Name; |
---|
| 59 | ID : out RTEMS.ID; |
---|
| 60 | Result : out RTEMS.Status_Codes) |
---|
| 61 | is |
---|
| 62 | function Ident_Base |
---|
| 63 | (Name : RTEMS.Name; |
---|
| 64 | ID : access RTEMS.ID) |
---|
| 65 | return RTEMS.Status_Codes; |
---|
| 66 | pragma Import (C, Ident_Base, "rtems_port_ident"); |
---|
| 67 | ID_Base : aliased RTEMS.ID; |
---|
| 68 | begin |
---|
| 69 | |
---|
| 70 | Result := Ident_Base (Name, ID_Base'Access); |
---|
| 71 | ID := ID_Base; |
---|
| 72 | |
---|
| 73 | end Ident; |
---|
| 74 | |
---|
| 75 | procedure Delete |
---|
| 76 | (ID : in RTEMS.ID; |
---|
| 77 | Result : out RTEMS.Status_Codes) |
---|
| 78 | is |
---|
| 79 | function Delete_Base (ID : RTEMS.ID) return RTEMS.Status_Codes; |
---|
| 80 | pragma Import (C, Delete_Base, "rtems_port_delete"); |
---|
| 81 | begin |
---|
| 82 | |
---|
| 83 | Result := Delete_Base (ID); |
---|
| 84 | |
---|
| 85 | end Delete; |
---|
| 86 | |
---|
| 87 | procedure External_To_Internal |
---|
| 88 | (ID : in RTEMS.ID; |
---|
| 89 | External : in RTEMS.Address; |
---|
| 90 | Internal : out RTEMS.Address; |
---|
| 91 | Result : out RTEMS.Status_Codes) |
---|
| 92 | is |
---|
| 93 | function External_To_Internal_Base |
---|
| 94 | (ID : RTEMS.ID; |
---|
| 95 | External : RTEMS.Address; |
---|
| 96 | Internal : access RTEMS.Address) |
---|
| 97 | return RTEMS.Status_Codes; |
---|
| 98 | pragma Import |
---|
| 99 | (C, |
---|
| 100 | External_To_Internal_Base, |
---|
| 101 | "rtems_port_external_to_internal"); |
---|
| 102 | Internal_Base : aliased RTEMS.Address; |
---|
| 103 | begin |
---|
| 104 | |
---|
| 105 | Result := |
---|
| 106 | External_To_Internal_Base (ID, External, Internal_Base'Access); |
---|
| 107 | Internal := Internal_Base; |
---|
| 108 | |
---|
| 109 | end External_To_Internal; |
---|
| 110 | |
---|
| 111 | procedure Internal_To_External |
---|
| 112 | (ID : in RTEMS.ID; |
---|
| 113 | Internal : in RTEMS.Address; |
---|
| 114 | External : out RTEMS.Address; |
---|
| 115 | Result : out RTEMS.Status_Codes) |
---|
| 116 | is |
---|
| 117 | function Internal_To_External_Base |
---|
| 118 | (ID : RTEMS.ID; |
---|
| 119 | Internal : RTEMS.Address; |
---|
| 120 | External : access RTEMS.Address) |
---|
| 121 | return RTEMS.Status_Codes; |
---|
| 122 | pragma Import |
---|
| 123 | (C, |
---|
| 124 | Internal_To_External_Base, |
---|
| 125 | "rtems_port_internal_to_external"); |
---|
| 126 | External_Base : aliased RTEMS.Address; |
---|
| 127 | begin |
---|
| 128 | |
---|
| 129 | Result := |
---|
| 130 | Internal_To_External_Base (ID, Internal, External_Base'Access); |
---|
| 131 | External := External_Base; |
---|
| 132 | |
---|
| 133 | end Internal_To_External; |
---|
| 134 | |
---|
| 135 | end RTEMS.Port; |
---|