CVS difference for ai05s/ai05-0170-1.txt

Differences between 1.3 and version 1.4
Log of other versions for file ai05s/ai05-0170-1.txt

--- ai05s/ai05-0170-1.txt	2010/06/13 01:40:08	1.3
+++ ai05s/ai05-0170-1.txt	2010/08/10 06:21:26	1.4
@@ -1,9 +1,11 @@
-!standard  D.14(9/2)                                10-06-04    AI05-0170-1/03
+!standard  D.14(9/2)                                10-08-09    AI05-0170-1/04
 !standard  D.14(11/2)
 !standard  D.14(13/2)
 !standard  D.14(18/2)
 !standard  D.14.3(0)
 !class Amendment 09-10-22
+!status Amendment 2012 10-08-09
+!status ARG Approved  10-0-0  10-06-18
 !status work item 09-10-22
 !status received 09-10-22
 !priority Medium
@@ -75,7 +77,7 @@
 
 !wording
 
-Add to package Ada.Execution_Time in D.14: [Where? After D.14(9/2)?? Editor.]
+Add to package Ada.Execution_Time after D.14(9/2):
 
 Interrupt_Clocks_Supported : constant Boolean := <implementation-defined>;
 
@@ -95,30 +97,32 @@
 task, if any, is charged the execution time that is consumed by interrupt
 handlers. The Boolean constant Separate_Interrupt_Clocks_Supported is set to
 True if the implementation separately accounts for the execution time of
-individual interrupt handlers. If set to True the package
-Ada.Execution_Time.Interrrupts must be supported (see D.14.3).
+individual interrupt handlers.
 
-Add to end of 13/2:
-The execution time value for the Clock_For_Interrupts is initialised to zero.
+Add to end of D.14(13/2):
+The execution time value for the Clock_For_Interrupts is initialized to zero.
 
 
 
-Add to Dynamic Semantics [Where? After D.14(18/2)?? Editor.]
+Add to after D.14(18/2):
 
 The function Clock_For_Interrupts returns the total cumulative time spent
 executing within all interrupt handlers. This time is not allocated to any
 task execution time clock. If Interrupt_Clocks_Supported is set to False
-the function will return a value equal to Time_Of(0).
+the function raises Program_Error.
 
 
 
 Add a new D.14.3
 
+Execution Time of Interrupt Handlers
+
 This clause describes a language-defined package to measure the execution
 time of interrupt handlers.
 
 Static Semantics
-The following language-defined library exists:
+
+The following language-defined library package exists:
 
 with Ada.Interrupts;
 package Ada.Execution_Time.Interrupts is
@@ -139,10 +143,10 @@
 
 
 Dynamic Semantics
+
 The function Clock returns the current cumulative execution time of the
 interrupt identified by I. If Separate_Interrupt_Clocks_Supported is
-set to False the function will always return a value equal to
-Ada.Execution_Time.Time_Of(0).
+set to False the function raises Program_Error.
 
 
 The function Supported returns True if the implementation is monitoring
@@ -175,9 +179,8 @@
 thus introducing the ability for the system to detect execution time
 violations in interrupt handlers.
 
-Since all this functionality may not be available on all platforms it
-is only proposed as implementation advice, to be implemented when
-appropriate.
+Since all this functionality may not be available on all platforms,
+we also provide the ability to test whether it is present.
 
 In [1] and [2] the overheads incurred by the implementation of these
 new services have been measured, and found that they are very low in
@@ -195,16 +198,20 @@
 interrupts to a specific processor in multiprocessor systems. It seems
 that using pseudo-task IDs instead would require defining these for
 each processor, which would add complexity to the API.
+
+The new package is always present (even though its operations may
+just raise Program_Error), in order that programs can be written that
+depend on its services if the Separate_Interrupt_Clocks_Supported
+value is True, and falls back to some other technique if it is not
+supported. Such a program will need to with the new package, and
+that requires it exists even if it is not usefully implemented.
 
-Parts number 2 and 3 of this proposal define new optional Ada packages
-as "implementation advice". An alternative would be to make these
-packages mandatory if the Real-Time Annex is supported, and allow the
-implementation to provide dummy implementations for the subprograms, for
-instance clocks that always return zero (meaning that interrupt time
-is not measured) or timers which never expire (because the clocks on
-which they are based do not advance).
-Original Proposal is as follows.
+The third part of the original proposal was dropped, as it seems
+to add overhead to interrupt handlers even when not used.
 
+
+The original IRTAW Proposal follows:
+
 This proposal contains three parts, listed in order
 of importance. Each one is based on the previous one and adds new
 services that are useful to real-time applications.
@@ -312,8 +319,107 @@
 !example
 
 ** TBD **
+
+!corrigendum D.14(9/2)
+
+@dinsa
+@xcode<  @b<function> Time_Of (SC : Seconds_Count;
+              TS : Time_Span := Time_Span_Zero) @b<return> CPU_Time;>
+@dinss
+@xcode<  Interrupt_Clocks_Supported : @b<constant> Boolean := @i<@ft<implementation-defined>>;>
+
+@xcode<  Separate_Interrupt_Clocks_Supported : @b<constant> Boolean :=
+    @i<@ft<implementation-defined>>;>
+
+@xcode<  @b<function> Clock_For_Interrupts @b<return> CPU_Time;>
+
+
+!corrigendum D.14(11/2)
+
+@drepl
+The @i<execution time> or CPU time of a given task is defined as the time spent
+the system executing that task, including the time spent executing run-time or
+system services on its behalf. The mechanism used to measure execution time is
+implementation defined. It is implementation defined which task, if any, is
+charged the execution time that is consumed by interrupt handlers and run-time
+services on behalf of the system.
+@dby
+The @i<execution time> or CPU time of a given task is defined as the time spent
+by the system executing that task, including the time spent executing run-time
+or system services on its behalf. The mechanism used to measure execution time
+is implementation defined. The Boolean constant Interrupt_Clocks_Supported is
+set to True if the implementation separately accounts for the execution time
+of interrupt handlers. If it is set to False it is implementation defined which
+task, if any, is charged the execution time that is consumed by interrupt
+handlers. The Boolean constant Separate_Interrupt_Clocks_Supported is set to
+True if the implementation separately accounts for the execution time of
+individual interrupt handlers.
+
+
+!corrigendum D.14(13/2):
+
+@dinsa
+CPU_Time_First and CPU_Time_Last are the smallest
+and largest values of the CPU_Time type, respectively.
+@dinst
+The execution time value for the Clock_For_Interrupts is initialized to zero.
+
+
+!corrigendum D.14(18/2)
+
+@dinsa
+The effects of the Split and Time_Of operations are
+follows, treating values of type CPU_Time, Time_Span, and
+Seconds_Count as mathematical integers. The effect of Split (T, SC,
+TS) is to set SC and TS to values such that T*CPU_Time_Unit = SC*1.0 +
+TS*CPU_Time_Unit, and 0.0 <= TS*CPU_Time_Unit < 1.0. The value
+returned by Time_Of(SC,TS) is the execution-time value T such that
+T*CPU_Time_Unit=SC*1.0 + TS*CPU_Time_Unit.
+@dinst
+The function Clock_For_Interrupts returns the total cumulative time spent
+executing within all interrupt handlers. This time is not allocated to any
+task execution time clock. If Interrupt_Clocks_Supported is set to False
+the function raises Program_Error.
+
 
---!corrigendum D.14(29/2)
+!corrigendum D.14.3
+
+@dinsc
+
+This clause describes a language-defined package to measure the execution
+time of interrupt handlers.
+
+@s8<@i<Static Semantics>>
+
+The following language-defined library package exists:
+
+@xcode<@b<with> Ada.Interrupts;
+@b<package> Ada.Execution_Time.Interrupts @b<is>
+   @b<function> Clock (I : Ada.Interrupts.Interrupt_ID)
+        @b<return> CPU_Time;
+   @b<function> Supported (I : Ada.Interrupts.Interrupt_ID)
+        @b<return> Boolean;
+@b<end> Ada.Execution_Time.Interrupts;>
+
+The execution time or CPU time of a given interrupt I is defined as the time
+spent by the system executing interrupt handlers identified by I, including
+the time spent executing run-time or system services on its behalf.
+The mechanism used to measure execution time is implementation defined.
+Time spent executing interrupt handlers is distinct from time spent
+executing any task.
+
+For each interrupt ID, the execution time value is initially set to zero.
+
+@s8<@i<Dynamic Semantics>>
+
+The function Clock returns the current cumulative execution time of the
+interrupt identified by I. If Separate_Interrupt_Clocks_Supported is
+set to False the function raises Program_Error.
+
+The function Supported returns True if the implementation is monitoring
+the execution time of interrupt I. Otherwise it returns False. For any
+interrupt ID I for which Supported(I) returns False, the function Clock(I)
+will return a value equal to Ada.Execution_Time.Time_Of(0).
 
 
 !ACATS test

Questions? Ask the ACAA Technical Agent