* arm.c (FL_WBUF): Define.
[official-gcc.git] / gcc / ada / s-stoele.ads
blob1799a7e54760078417dc33895c17f1c4c5fc5209
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S Y S T E M . S T O R A G E _ E L E M E N T S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2002-2004 Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the implementation dependent sections of this file. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
24 -- MA 02111-1307, USA. --
25 -- --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
32 -- --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 -- --
36 ------------------------------------------------------------------------------
38 -- Warning: declarations in this package are ambiguous with respect to the
39 -- extra declarations that can be introduced into System using Extend_System.
40 -- It is a good idea to avoid use clauses for this package!
42 package System.Storage_Elements is
43 pragma Pure (Storage_Elements);
44 -- Note that we take advantage of the implementation permission to make
45 -- this unit Pure instead of Preelaborable; see RM 13.7.1(15).
47 -- We also add the pragma Pure_Function to the operations in this package,
48 -- because otherwise functions with parameters derived from Address are
49 -- treated as non-pure by the back-end (see exp_ch6.adb). This is because
50 -- in many cases such a parameter is used to hide read/out access to objects,
51 -- and it would be unsafe to treat such functions as pure.
53 type Storage_Offset is range
54 -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
55 +(2 ** (Integer'(Standard'Address_Size) - 1)) - Long_Long_Integer'(1);
57 subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;
59 type Storage_Element is mod 2 ** Storage_Unit;
60 for Storage_Element'Size use Storage_Unit;
62 type Storage_Array is
63 array (Storage_Offset range <>) of aliased Storage_Element;
64 for Storage_Array'Component_Size use Storage_Unit;
66 -- Address arithmetic
68 function "+" (Left : Address; Right : Storage_Offset) return Address;
69 pragma Convention (Intrinsic, "+");
70 pragma Inline_Always ("+");
71 pragma Pure_Function ("+");
73 function "+" (Left : Storage_Offset; Right : Address) return Address;
74 pragma Convention (Intrinsic, "+");
75 pragma Inline_Always ("+");
76 pragma Pure_Function ("+");
78 function "-" (Left : Address; Right : Storage_Offset) return Address;
79 pragma Convention (Intrinsic, "-");
80 pragma Inline_Always ("-");
81 pragma Pure_Function ("-");
83 function "-" (Left, Right : Address) return Storage_Offset;
84 pragma Convention (Intrinsic, "-");
85 pragma Inline_Always ("-");
86 pragma Pure_Function ("-");
88 function "mod"
89 (Left : Address;
90 Right : Storage_Offset) return Storage_Offset;
91 pragma Convention (Intrinsic, "mod");
92 pragma Inline_Always ("mod");
93 pragma Pure_Function ("mod");
95 -- Conversion to/from integers
97 type Integer_Address is mod Memory_Size;
99 function To_Address (Value : Integer_Address) return Address;
100 pragma Convention (Intrinsic, To_Address);
101 pragma Inline_Always (To_Address);
102 pragma Pure_Function (To_Address);
104 function To_Integer (Value : Address) return Integer_Address;
105 pragma Convention (Intrinsic, To_Integer);
106 pragma Inline_Always (To_Integer);
107 pragma Pure_Function (To_Integer);
109 end System.Storage_Elements;