13.7 The Package System
This Reference Manual output has not been verified, and may contain omissions or errors. Report any problems on the tracking issue
[For each implementation there is a library package called System which includes the definitions of certain configuration-dependent characteristics.]
Static Semantics
2The following language-defined library package exists:
package System
with Pure is
4type Name is implementation-defined-enumeration-type;
System_Name : constant Name := implementation-defined;
5-- System-Dependent Named Numbers:
6Min_Int : constant := root_integer'First;
Max_Int : constant := root_integer'Last;
7Max_Binary_Modulus : constant := implementation-defined;
Max_Nonbinary_Modulus : constant := implementation-defined;
8Max_Base_Digits : constant := root_real'Digits;
Max_Digits : constant := implementation-defined;
9Max_Mantissa : constant := implementation-defined;
Fine_Delta : constant := implementation-defined;
10Tick : constant := implementation-defined;
11-- Storage-related Declarations:
12type Address is implementation-defined;
Null_Address : constant Address;
13Storage_Unit : constant := implementation-defined;
Word_Size : constant := implementation-defined * Storage_Unit;
Memory_Size : constant := implementation-defined;
14/3-- Address Comparison:
function "<" (Left, Right : Address) return Boolean
with Convention => Intrinsic;
function "<="(Left, Right : Address) return Boolean
with Convention => Intrinsic;
function ">" (Left, Right : Address) return Boolean
with Convention => Intrinsic;
function ">="(Left, Right : Address) return Boolean
with Convention => Intrinsic;
function "=" (Left, Right : Address) return Boolean
with Convention => Intrinsic;
-- function "/=" (Left, Right : Address) return Boolean;
-- "/=" is implicitly defined
15/2-- Other System-Dependent Declarations:
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order := implementation-defined;
16-- Priority-related declarations (see D.1):
subtype Any_Priority is Integer range implementation-defined;
subtype Priority is Any_Priority range Any_Priority'First ..
implementation-defined;
subtype Interrupt_Priority is Any_Priority range Priority'Last+1 ..
Any_Priority'Last;
17Default_Priority : constant Priority :=
(Priority'First + Priority'Last)/2;
18private
... -- not specified by the language
end System;
19Name is an enumeration subtype. Values of type Name are the names of alternative machine configurations handled by the implementation. System_Name represents the current machine configuration.
The named numbers Fine_Delta and Tick are of the type universal_real; the others are of the type universal_integer.
The meanings of the named numbers are:
[ Min_Int
- The smallest (most negative) value allowed for the expressions of a
signed_integer_type_definition
. 23
Max_Int- The largest (most positive) value allowed for the expressions of a
signed_integer_type_definition
. 24
Max_Binary_Modulus- A power of two such that it, and all lesser positive powers of two, are allowed as the modulus of a
modular_type_definition
. 25
Max_Nonbinary_Modulus- A value such that it, and all lesser positive integers, are allowed as the modulus of a
modular_type_definition
.
Max_Base_Digits
- The largest value allowed for the requested decimal precision in a
floating_point_definition
. 27
Max_Digits- The largest value allowed for the requested decimal precision in a
floating_point_definition
that has noreal_range_specification
. Max_Digits is less than or equal to Max_Base_Digits. 28
Max_Mantissa- The largest possible number of binary digits in the mantissa of machine numbers of a user-defined ordinary fixed point type. (The mantissa is defined in Annex G.)
Fine_Delta- The smallest delta allowed in an
ordinary_fixed_point_definition
that has thereal_range_specification
range –1.0 .. 1.0. ] 30
Tick- A period in seconds approximating the real time interval during which the value of Calendar.Clock remains constant.
delay_statement
has no relation to Tick. In particular, it is possible that the clock used for the delay_statement
is less accurate than Calendar.Clock.Storage_Unit
- The number of bits per storage element.
Word_Size- The number of bits per word.
Memory_Size- An implementation-defined value [that is intended to reflect the memory size of the configuration in storage elements.]
Address is a definite, nonlimited type with preelaborable initialization (see 10.2.1). Address represents machine addresses capable of addressing individual storage elements. Null_Address is an address that is distinct from the address of any object or program unit.
Default_Bit_Order shall be a static constant. See 13.5.3 for an explanation of Bit_Order and Default_Bit_Order.
Implementation Permissions
36/2An implementation may add additional implementation-defined declarations to package System and its children. [However, it is usually better for the implementation to provide additional functionality via implementation-defined children of System.]
Implementation Advice
37Address should be a private type.
Extensions to Ada 83
Wording Changes from Ada 83
Extensions to Ada 95
13.7.1 The Package System.Storage_Elements
Static Semantics
1The following language-defined library package exists:
package System.Storage_Elements
with Pure is
3type Storage_Offset is range implementation-defined;
4subtype Storage_Count is Storage_Offset range 0..Storage_Offset'Last;
5type Storage_Element is mod implementation-defined;
for Storage_Element'Size use Storage_Unit;
type Storage_Array is array
(Storage_Offset range <>) of aliased Storage_Element;
for Storage_Array'Component_Size use Storage_Unit;
6-- Address Arithmetic:
7/3function "+"(Left : Address; Right : Storage_Offset) return Address
with Convention => Intrinsic;
function "+"(Left : Storage_Offset; Right : Address) return Address
with Convention => Intrinsic;
function "-"(Left : Address; Right : Storage_Offset) return Address
with Convention => Intrinsic;
function "-"(Left, Right : Address) return Storage_Offset
with Convention => Intrinsic;
8/3function "mod"(Left : Address; Right : Storage_Offset)
return Storage_Offset
with Convention => Intrinsic;
9-- Conversion to/from integers:
10/3type Integer_Address is implementation-defined;
function To_Address(Value : Integer_Address) return Address
with Convention => Intrinsic;
function To_Integer(Value : Address) return Integer_Address
with Convention => Intrinsic;
11/3end System.Storage_Elements;
Storage_Element represents a storage element. Storage_Offset represents an offset in storage elements. Storage_Count represents a number of storage elements. Storage_Array represents a contiguous sequence of storage elements.
Integer_Address is a [(signed or modular)] integer subtype. To_Address and To_Integer convert back and forth between this type and Address.
Implementation Requirements
14Storage_Offset'Last shall be greater than or equal to Integer'Last or the largest possible storage offset, whichever is smaller. Storage_Offset'First shall be <= (–Storage_Offset'Last).
Paragraph 15 was deleted.
Implementation Advice
16Operations in System and its children should reflect the target environment semantics as closely as is reasonable. For example, on most machines, it makes sense for address arithmetic to “wrap around”. Operations that do not make sense should raise Program_Error.
Extensions to Ada 95
13.7.2 The Package System.Address_To_Access_Conversions
Static Semantics
1The following language-defined generic library package exists:
generic
type Object(<>) is limited private;
package System.Address_To_Access_Conversions
with Preelaborate, Nonblocking, Global => in out synchronized is
3/3type Object_Pointer is access all Object;
function To_Pointer(Value : Address) return Object_Pointer
with Convention => Intrinsic;
function To_Address(Value : Object_Pointer) return Address
with Convention => Intrinsic;
4/3end System.Address_To_Access_Conversions;
5/2The To_Pointer and To_Address subprograms convert back and forth between values of types Object_Pointer and Address. To_Pointer(X'Address) is equal to X'Unchecked_Access for any X that allows Unchecked_Access. To_Pointer(Null_Address) returns null. For other addresses, the behavior is unspecified. To_Address(null) returns Null_Address. To_Address(Y), where Y /= null, returns Y.all'Address.
Implementation Permissions
6An implementation may place restrictions on instantiations of Address_To_Access_Conversions.