annotate gcc/ada/libgnarl/a-exetim.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- A D A . E X E C U T I O N _ T I M E --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- This specification is derived from the Ada Reference Manual for use with --
kono
parents:
diff changeset
10 -- GNAT. In accordance with the copyright of that document, you can freely --
kono
parents:
diff changeset
11 -- copy and modify this specification, provided that if you redistribute a --
kono
parents:
diff changeset
12 -- modified version, any changes that you have made are clearly indicated. --
kono
parents:
diff changeset
13 -- --
kono
parents:
diff changeset
14 ------------------------------------------------------------------------------
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 -- This unit is not implemented in typical GNAT implementations that lie on
kono
parents:
diff changeset
17 -- top of operating systems, because it is infeasible to implement in such
kono
parents:
diff changeset
18 -- environments.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 -- If a target environment provides appropriate support for this package
kono
parents:
diff changeset
21 -- then the Unimplemented_Unit pragma should be removed from this spec and
kono
parents:
diff changeset
22 -- an appropriate body provided.
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 with Ada.Task_Identification;
kono
parents:
diff changeset
25 with Ada.Real_Time;
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 package Ada.Execution_Time with
kono
parents:
diff changeset
28 SPARK_Mode
kono
parents:
diff changeset
29 is
kono
parents:
diff changeset
30 pragma Preelaborate;
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 pragma Unimplemented_Unit;
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 type CPU_Time is private;
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 CPU_Time_First : constant CPU_Time;
kono
parents:
diff changeset
37 CPU_Time_Last : constant CPU_Time;
kono
parents:
diff changeset
38 CPU_Time_Unit : constant := 0.000001;
kono
parents:
diff changeset
39 CPU_Tick : constant Ada.Real_Time.Time_Span;
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 use type Ada.Task_Identification.Task_Id;
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 function Clock
kono
parents:
diff changeset
44 (T : Ada.Task_Identification.Task_Id :=
kono
parents:
diff changeset
45 Ada.Task_Identification.Current_Task)
kono
parents:
diff changeset
46 return CPU_Time
kono
parents:
diff changeset
47 with
kono
parents:
diff changeset
48 Volatile_Function,
kono
parents:
diff changeset
49 Global => Ada.Real_Time.Clock_Time,
kono
parents:
diff changeset
50 Pre => T /= Ada.Task_Identification.Null_Task_Id;
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 function "+"
kono
parents:
diff changeset
53 (Left : CPU_Time;
kono
parents:
diff changeset
54 Right : Ada.Real_Time.Time_Span) return CPU_Time
kono
parents:
diff changeset
55 with
kono
parents:
diff changeset
56 Global => null;
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 function "+"
kono
parents:
diff changeset
59 (Left : Ada.Real_Time.Time_Span;
kono
parents:
diff changeset
60 Right : CPU_Time) return CPU_Time
kono
parents:
diff changeset
61 with
kono
parents:
diff changeset
62 Global => null;
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 function "-"
kono
parents:
diff changeset
65 (Left : CPU_Time;
kono
parents:
diff changeset
66 Right : Ada.Real_Time.Time_Span) return CPU_Time
kono
parents:
diff changeset
67 with
kono
parents:
diff changeset
68 Global => null;
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 function "-"
kono
parents:
diff changeset
71 (Left : CPU_Time;
kono
parents:
diff changeset
72 Right : CPU_Time) return Ada.Real_Time.Time_Span
kono
parents:
diff changeset
73 with
kono
parents:
diff changeset
74 Global => null;
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 function "<" (Left, Right : CPU_Time) return Boolean with
kono
parents:
diff changeset
77 Global => null;
kono
parents:
diff changeset
78 function "<=" (Left, Right : CPU_Time) return Boolean with
kono
parents:
diff changeset
79 Global => null;
kono
parents:
diff changeset
80 function ">" (Left, Right : CPU_Time) return Boolean with
kono
parents:
diff changeset
81 Global => null;
kono
parents:
diff changeset
82 function ">=" (Left, Right : CPU_Time) return Boolean with
kono
parents:
diff changeset
83 Global => null;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 procedure Split
kono
parents:
diff changeset
86 (T : CPU_Time;
kono
parents:
diff changeset
87 SC : out Ada.Real_Time.Seconds_Count;
kono
parents:
diff changeset
88 TS : out Ada.Real_Time.Time_Span)
kono
parents:
diff changeset
89 with
kono
parents:
diff changeset
90 Global => null;
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 function Time_Of
kono
parents:
diff changeset
93 (SC : Ada.Real_Time.Seconds_Count;
kono
parents:
diff changeset
94 TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
kono
parents:
diff changeset
95 return CPU_Time
kono
parents:
diff changeset
96 with
kono
parents:
diff changeset
97 Global => null;
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 Interrupt_Clocks_Supported : constant Boolean := False;
kono
parents:
diff changeset
100 Separate_Interrupt_Clocks_Supported : constant Boolean := False;
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 pragma Warnings (Off, "check will fail at run time");
kono
parents:
diff changeset
103 function Clock_For_Interrupts return CPU_Time with
kono
parents:
diff changeset
104 Volatile_Function,
kono
parents:
diff changeset
105 Global => Ada.Real_Time.Clock_Time,
kono
parents:
diff changeset
106 Pre => Interrupt_Clocks_Supported;
kono
parents:
diff changeset
107 pragma Warnings (On, "check will fail at run time");
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 private
kono
parents:
diff changeset
110 pragma SPARK_Mode (Off);
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 type CPU_Time is new Ada.Real_Time.Time;
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 CPU_Time_First : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_First);
kono
parents:
diff changeset
115 CPU_Time_Last : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_Last);
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 CPU_Tick : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Tick;
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 end Ada.Execution_Time;