Daily bump.
[official-gcc.git] / gcc / ada / gnatpsys.adb
blob9e65c2a25377fc8ecd239e95797c666110c01f1b
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT SYSTEM UTILITIES --
4 -- --
5 -- G N A T P S Y S --
6 -- --
7 -- B o d y --
8 -- --
9 -- $Revision: 1.3 $ --
10 -- --
11 -- Copyright (C) 1997 Free Software Foundation, Inc. --
12 -- --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 -- --
27 ------------------------------------------------------------------------------
29 -- Program to print out listing of System package with all constants
30 -- appearing explicitly.
32 with Ada.Text_IO;
33 with System; use System;
34 with Gnatvsn;
36 procedure GnatPsys is
37 pragma Ident (Gnatvsn.Gnat_Version_String);
39 procedure P (Item : String) renames Ada.Text_IO.Put_Line;
41 begin
42 P ("package System is");
44 P ("pragma Pure (System);");
46 P ("");
48 P (" type Name is (SYSTEM_NAME_GNAT);");
50 P (" System_Name : constant Name := SYSTEM_NAME_GNAT;");
52 P ("");
54 P (" -- System-Dependent Named Numbers");
56 P ("");
58 P (" Min_Int : constant := -(2 **" &
59 Long_Long_Integer'Image (Long_Long_Integer'Size - 1) & ");");
61 P (" Max_Int : constant := 2 **" &
62 Long_Long_Integer'Image (Long_Long_Integer'Size - 1) & " - 1;");
64 P ("");
66 P (" Max_Binary_Modulus : constant := 2 **" &
67 Long_Long_Integer'Image (Long_Long_Integer'Size) & ";");
69 P (" Max_Nonbinary_Modulus : constant :=" &
70 Integer'Image (Integer'Last) & ";");
72 P ("");
74 P (" Max_Base_Digits : constant :=" &
75 Natural'Image (Long_Long_Float'Digits) & ";");
77 P (" Max_Digits : constant :=" &
78 Natural'Image (Long_Long_Float'Digits) & ";");
80 P ("");
82 P (" Max_Mantissa : constant := 63;");
84 P (" Fine_Delta : constant := 2.0 ** (-Max_Mantissa);");
86 P ("");
88 P (" Tick : constant :=" &
89 Duration'Image (Duration (Standard'Tick)) & ";");
91 P ("");
93 P (" -- Storage-related Declarations");
95 P ("");
97 P (" type Address is private;");
99 P (" Null_Address : constant Address;");
101 P ("");
103 P (" Storage_Unit : constant :=" &
104 Natural'Image (Standard'Storage_Unit) & ";");
106 P (" Word_Size : constant :=" &
107 Natural'Image (Standard'Word_Size) & ";");
109 P (" Memory_Size : constant := 2 **" &
110 Natural'Image (Standard'Address_Size) & ";");
112 P ("");
113 P (" -- Address comparison");
114 P ("");
115 P (" function ""<"" (Left, Right : Address) return Boolean;");
116 P (" function ""<="" (Left, Right : Address) return Boolean;");
117 P (" function "">"" (Left, Right : Address) return Boolean;");
118 P (" function "">="" (Left, Right : Address) return Boolean;");
119 P (" function ""="" (Left, Right : Address) return Boolean;");
120 P ("");
121 P (" pragma Import (Intrinsic, ""<""); ");
122 P (" pragma Import (Intrinsic, ""<="");");
123 P (" pragma Import (Intrinsic, "">""); ");
124 P (" pragma Import (Intrinsic, "">="");");
125 P (" pragma Import (Intrinsic, ""=""); ");
126 P ("");
127 P (" -- Other System-Dependent Declarations");
128 P ("");
129 P (" type Bit_Order is (High_Order_First, Low_Order_First);");
130 P (" Default_Bit_Order : constant Bit_Order;");
131 P ("");
132 P (" -- Priority-related Declarations (RM D.1)");
133 P ("");
134 P (" subtype Any_Priority is Integer range 0 .." &
135 Natural'Image (Standard'Max_Interrupt_Priority) & ";");
137 P ("");
139 P (" subtype Priority is Any_Priority range 0 .." &
140 Natural'Image (Standard'Max_Priority) & ";");
142 P ("");
144 P (" subtype Interrupt_Priority is Any_Priority range" &
145 Natural'Image (Standard'Max_Priority + 1) & " .." &
146 Natural'Image (Standard'Max_Interrupt_Priority) & ";");
148 P ("");
150 P (" Default_Priority : constant Priority :=" &
151 Natural'Image ((Priority'First + Priority'Last) / 2) & ";");
153 P ("");
155 P ("private");
157 P ("");
159 P (" type Address is mod Memory_Size; ");
161 P (" Null_Address : constant Address := 0; ");
163 P (" ");
165 P (" Default_Bit_Order : constant Bit_Order := " &
166 Bit_Order'Image (Bit_Order'Val (Standard'Default_Bit_Order)) & ";");
168 P ("");
170 P ("end System;");
171 end GnatPsys;