File: /home/oboss/Users/gec/sources/PUS_Services/Memory_Management/memory_access.ads

1     --% Compilation Unit: Memory_Access
2     --
3     --% Category: Generic Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.1 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: memory_access.ads,v $
13     --    Revision 2.1  2003/11/13 14:57:49  gec
14     --    Merged ECSS Migration branch to main trunk.
15     --
16     --    Revision 2.0.8.1  2003/11/10 10:03:40  gec
17     --    Updated memory management service in accordance with ECSS-E-70-41A.
18     --
19     --    Revision 2.0  2003/04/04 08:51:08  gec
20     --    Initial release of source files serving as baseline for OBOSS-III
21     --+    project.
22     --
23     --    Revision 1.1.1.1  2003/04/04 08:13:12  gec
24     --    Imported using TkCVS
25     --
26     --
27     --
28     --% Project: OBOSS
29     --
30     --% Copyright (C) 2003 by Terma A/S
31     --  Proprietary and intellectual rights of Terma A/S, Denmark,
32     --  are involved in the subject-matter of this material and
33     --  all manufacturing, reproduction, use, disclosure, and
34     --  sales rights pertaining to such subject-matter are
35     --  expressly reserved. This material is submitted for a
36     --  specific purpose as agreed, and the recipient by
37     --  accepting this material agrees that this material will
38     --  not be used, copied, or reproduced in whole or in part
39     --  nor its contents revealed in any manner or to any person,
40     --  except to meet the purpose for which it was submitted and
41     --  subject to the terms of the agreement.
42     --
43     --% Target Dependencies:
44     --    None
45     --% Compiler Dependencies:
46     --    None
47     
48     --~-----------------------------------------------------------------------------
49     
50     with Memory_Management_Types;
51     with ISO_Checksum;
52     generic
53     
54        --% Generic Parameter Constraints:
55        -->   None
56     
57        Block_Start_Address : in     Memory_Management_Types.Absolute_Address;
58        Block_End_Address : in     Memory_Management_Types.Absolute_Address;
59     
60        Block_Access_Kind : in     Memory_Management_Types.Access_Kind;
61     
62     package Memory_Access is
63     
64        --% Library Package:
65        --    General utility for performing reading, writing and checksum
66        --+    calculation on memory that allows byte-level access.
67        --% Active Tasks:
68        -->   None
69        --% Passive Tasks:
70        -->   None
71     
72        --% Subprogram:
73        --    Routine for writing data at a given start address within the memory
74        --+    block.
75        --% Parameter Constraints:
76        -->   None
77        --% Exceptions Raised:
78        -->   Memory_Management_Types.No_Write_Access - raised when trying to write
79        --+    to a memory block without write access.
80        -->   Memory_Management_Types.Access_Outside_Memory_Area - raised when
81        --+    trying to write outside the memory block.
82        -->   Memory_Management_Types.Unknown_Memory_Access_Error - raised when the
83        --+    write operation results in an unknown external error
84        procedure Write_Data
85              (Absolute_Address : in     Memory_Management_Types.Start_Address;
86               Data_Val         : in     Memory_Management_Types.Data);
87     
88        --% Subprogram:
89        --    Routine for reading data at a given start address and with a given
90        --+    length within the memory block.
91        --% Parameter Constraints:
92        -->   None
93        --% Exceptions Raised:
94        -->   Memory_Management_Types.No_Read_Access - raised when trying to read
95        --+    from a memory block without read access.
96        -->   Memory_Management_Types.Access_Outside_Memory_Area - raised when
97        --+    trying to read outside the memory block
98        -->   Memory_Management_Types.Unknown_Memory_Access_Error - raised when the
99        --+    read operation results an unknown external error
100        procedure Read_Data
101              (Absolute_Address : in     Memory_Management_Types.Start_Address;
102               Data_Val         :    out Memory_Management_Types.Data);
103     
104        --% Subprogram:
105        --    Routine for calculating the ISO checksum for data at a given start
106        --+    address and with a given length within the memory block.
107        --% Parameter Constraints:
108        -->   None
109        --% Exceptions Raised:
110        -->   Memory_Management_Types.No_Read_Access - raised when trying to
111        --+    calculate a checksum for a memory block without read access.
112        -->   Memory_Management_Types.Access_Outside_Memory_Area - raised when
113        --+    trying to calculate a checksum for data outside the memory block
114        -->   Memory_Management_Types.Unknown_Memory_Access_Error - raised when the
115        --+    checksum calculation results in an unknown external error
116        function Calculate_ISO_Checksum
117              (Absolute_Address : in     Memory_Management_Types.Start_Address;
118               Length           : in     Memory_Management_Types.Data_Length)
119              return ISO_Checksum.Checksum_Type;
120     
121     end Memory_Access;
122     
123     --~-----------------------------------------------------------------------------
124