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

Differences between 1.13 and version 1.14
Log of other versions for file ai05s/ai05-0167-1.txt

--- ai05s/ai05-0167-1.txt	2011/04/30 07:28:36	1.13
+++ ai05s/ai05-0167-1.txt	2011/05/10 23:04:40	1.14
@@ -1,5 +1,7 @@
-!standard  D.16.1                               11-04-14    AI05-0167-1/10
-!standard  C.3.2
+!standard  D.16.1(0)                             11-05-10    AI05-0167-1/11
+!standard  C.3.2(2)
+!standard  C.3.2(10)
+!standard  C.3.2(22/1)
 !class Amendment 09-10-22
 !status Amendment 2012 11-03-15
 !status ARG Approved  8-0-0  11-03-17
@@ -129,11 +131,9 @@
 environment task executes. At program start-up all processors are contained
 within System_Dispatching_Domain.
 
-Static Semantics
-
-  For a task type (including the anonymous type of a single_task_definition),
-  the following language-defined representation aspect may be specified:
-    Dispatching_Domain
+For a task type (including the anonymous type of a single_task_declaration),
+the following language-defined representation aspect may be specified:
+   Dispatching_Domain
       The value of aspect Dispatching_Domain is an expression, which shall be of
       type Dispatching_Domains.Dispatching_Domain. This aspect is the domain to
       which the task (or all objects of the task type) are assigned.
@@ -155,7 +155,7 @@
 If both Dispatching_Domain and CPU are specified for a task, and the CPU
 value is not contained within the range of processors for the domain
 (and is not Not_A_Specific_CPU), the activation of the task is defined to
-have failed, and it becomes a completed task (see 9.2(1)).
+have failed, and it becomes a completed task (see 9.2).
 
 The function Create creates and returns a Dispatching_Domain containing all the
 processors in the range First .. Last. These processors are removed from
@@ -501,9 +501,218 @@
 !example
 
 ** TBD **
+
+!corrigendum C.3.2(2)
+
+@drepl
+@xcode<@b<with> System;
+@b<package> Ada.Interrupts @b<is>
+   @b<type> Interrupt_Id @b<is> @ft<@i<implementation-defined>>;
+   @b<type> Parameterless_Handler @i<is>
+      @b<access protected procedure>;>
+@dby
+@xcode<@b<with> System;
+@b<with> System.Multiprocessors;
+@b<package> Ada.Interrupts @b<is>
+   @b<type> Interrupt_Id @b<is> @ft<@i<implementation-defined>>;
+   @b<type> Parameterless_Handler @i<is>
+      @b<access protected procedure>;>
+
+!corrigendum C.3.2(10)
+
+@dinsa
+@xcode<   @b<function> Reference(Interrupt : Interrupt_Id)
+      @b<return> System.Address;>
+@dinst
+@xcode<   @b<function> Get_CPU(Interrupt: Interrupt_Id)
+      @b<return> System.Multiprocessors.CPU_Range;>
+
+!corrigendum C.3.2(22/1)
+
+@dinsa
+The Reference function returns a value of type System.Address that can be used
+to attach a task entry via an address clause (see J.7.1) to the interrupt
+specified by Interrupt. This function raises Program_Error if attaching task
+entries to interrupts (or to this particular interrupt) is not supported.
+@dinst
+The function Get_CPU returns the processor on which the handler for Interrupt is
+executed. If the handler can execute on more than one processor the value
+System.Multiprocessors.Not_A_Specific_CPU is returned.
+
+!corrigendum D.16.1(0)
+
+@dinsc
+
+This clause allows implementations on multiprocessor platforms to be
+partitioned into distinct dispatching domains during program
+startup.
+
+@s8<@i<Static Semantics>>
+
+The following language-defined library package exists:
+
+@xcode<@b<with> Ada.Real_Time;
+@b<package> System.Multiprocessors.Dispatching_Domains @b<is>
+   @b<pragma> Preelaborate(Dispatching_Domains);
+
+   Dispatching_Domain_Error : @b<exception>;
+
+   @b<type> Dispatching_Domain (<@>) @b<is limited private>;
+
+   System_Dispatching_Domain : @b<constant> Dispatching_Domain;
+
+   @b<function> Create (First, Last : CPU) @b<return> Dispatching_Domain;
+
+   @b<function> Get_First_CPU (Domain : Dispatching_Domain) @b<return> CPU;
+
+   @b<function> Get_Last_CPU  (Domain : Dispatching_Domain) @b<return> CPU;
+
+   @b<function> Get_Dispatching_Domain (T : Task_Id := Current_Task)
+            @b<return> Dispatching_Domain;
+
+   @b<procedure> Assign_Task (Domain : @b<in out> Dispatching_Domain;
+                          CPU     : @b<in>     CPU_Range := Not_A_Specific_CPU;
+                          T       : @b<in>     Task_Id   := Current_Task);
+
+   @b<procedure> Set_CPU (CPU : @b<in> CPU_Range; T : @b<in> Task_Id := Current_Task);
+
+   @b<function> Get_CPU (T : Task_Id := Current_Task) @b<return> CPU_Range;
+
+   @b<procedure> Delay_Until_And_Set_CPU (
+       Delay_Until_Time : @b<in> Ada.Real_Time.Time; CPU : @b<in> CPU_Range);
+
+@b<private>
+   ... -- @ft<@i<not specified by the language>>
+@b<end> System.Multiprocessors.Dispatching_Domains;>
+
+The type Dispatching_Domain represents a series of processors on which a task
+may execute. Each processor is contained within exactly one Dispatching_Domain.
+System_Dispatching_Domain contains the processor or processors on which the
+environment task executes. At program start-up all processors are contained
+within System_Dispatching_Domain.
+
+For a task type (including the anonymous type of a single_task_declaration),
+the following language-defined representation aspect may be specified:
+@xhang<@xterm<Dispatching_Domain>
+The value of aspect Dispatching_Domain is an @fa<expression>, which shall be of
+type Dispatching_Domains.Dispatching_Domain. This aspect is the domain to
+which the task (or all objects of the task type) are assigned.>
+
+@s8<@i<Legality Rules>>
+
+The Dispatching_Domain aspect shall not be specified for a task interface.
+
+@s8<@i<Dynamic Semantics>>
+
+The expression specifed for the Dispatching_Domain aspect of a task is evaluated
+for each task object (see 9.1). The Dispatching_Domain value is then associated
+with the task object whose task declaration specifies the aspect.
+
+If a task is not explictly assigned to any domain,
+it is assigned to that of the activating task.
+A task always executes on some CPU in its domain.
+
+If both Dispatching_Domain and CPU are specified for a task, and the CPU
+value is not contained within the range of processors for the domain
+(and is not Not_A_Specific_CPU), the activation of the task is defined to
+have failed, and it becomes a completed task (see 9.2).
+
+The function Create creates and returns a Dispatching_Domain containing all the
+processors in the range First .. Last. These processors are removed from
+System_Dispatching_Domain. A call of Create will raise Dispatching_Domain_Error
+if any designated processor is not currently in System_Dispatching_Domain, or if
+the system cannot support a distinct domain over the processors identified, or
+if a processor has a task assigned to it, or if the allocation would leave
+System_Dispatching_Domain empty. A call of Create will raise
+Dispatching_Domain_Error if the calling task is not the environment task, or
+if Create is called after the call to the main subprogram.
+
+The function Get_First_CPU returns the first CPU in Domain; Get_Last_CPU
+returns the last one.
+
+The function Get_Dispatching_Domain returns the Dispatching_Domain
+on which the task is assigned.
+
+A call of the procedure Assign_Task assigns task T to the CPU within
+Dispatching_Domain Domain. Task T can now execute only on CPU unless CPU
+designates Not_A_Specific_CPU, in which case it can execute on any processor
+within Domain. The exception Dispatching_Domain_Error is propagated if T is
+already assigned to a Dispatching_Domain other than System_Dispatching_Domain,
+or if CPU is not one of the processors of Domain (and is not
+Not_A_Specific_CPU). A call of Assign_Task is a task dispatching point for task
+T. If T is the Current_Task the effect is immediate, otherwise the effect is as
+soon as practical. Assigning a task to System_Dispatching_Domain that is already
+assigned to that domain has no effect.
+
+A call of procedure Set_CPU assigns task T to the CPU.
+Task T can now execute only on CPU, unless CPU designates Not_A_Specific_CPU, in
+which case it can execute on any processor within its Dispatching_Domain. The
+exception Dispatching_Domain_Error is propagated if CPU is not one of the
+processors of the Dispatching_Domain on which T is assigned (and is not
+Not_A_Specific_CPU). A call of Set_CPU is a task dispatching point for task T.
+If T is the Current_Task the effect is immediate, otherwise the effect is as
+soon as practical.
+
+The function Get_CPU returns the processor assigned to task T, or
+Not_A_Specific_CPU if the task is not assigned to a processor.
+
+A call of Delay_Until_And_Set_CPU delays the calling task for
+the designated time and then assigns the task to the specified
+processor when the delay expires. The exception
+Dispatching_Domain_Error is propagated if P is not one of the processors
+of the calling task's Dispatching_Domain (and is not Not_A_Specific_CPU).
+
+@s8<@i<Implementation Requirements>>
+
+The implementation shall perform the operations Assign_Task, Set_CPU,
+Get_CPU and Delay_Until_And_Set_CPU atomically with respect to any of
+these operations on the same dispatching_domain, processor or task.
+
+@s8<@i<Implementation Advice>>
+
+Each dispatching domain should have separate and disjoint ready queues.
+
+@s8<@i<Documentation Requirements>>
+
+The implementation shall document the processor(s) on which the
+clock interrupt is handled and hence where delay queue and ready
+queue manipulations occur. For any Interrupt_Id whose handler
+can execute on more than one processor the implementation shall
+also document this set of processors.
+
+@s8<@i<Implementation Permissions>>
+
+An implementation may limit the number of dispatching domains that can be
+created and raise Dispatching_Domain_Error if an attempt is made
+to exceed this number.
+
+
+!corrigendum J.15.11(0)
+
+@dinsc
+
+@s8<@i<Syntax>>
+
+The form of a @fa<pragma> Dispatching_Domain as follows:
+
+@xcode<   @ft<@b<pragma> Dispatching_Domain (@fa<expression>);>>
+
+@s8<@i<Name Resolution Rules>>
+
+The expected type for the @fa<expression> is
+System.Multiprocessors.Dispatching_Domains.Dispatching_Domain.
+
+@s8<@i<Legality Rules>>
+
+A Dispatching_Domain pragma is allowed only immediately within a @fa<task_definition>.
+At most one such pragma shall appear within a given @fa<task_definition>.
 
---!corrigendum D.16(1)
+@s8<@i<Static Semantics>>
 
+For an implementation that supports Annex D, a pragma Dispatching_Domain specifies
+the value of the Dispatching_Domain aspect (see D.16.1). The @fa<expression> is
+associated with the aspect for the task type or
+@fa<single_task_declaration> that contains the pragma.
 
 !ACATS test
 
@@ -548,7 +757,8 @@
 Dynamic Semantics
 
 A pragma Dispatching_Domain assigns the task to the specified domain.
-During activation, a task executes in the domain of the activating task; afterward, it executes in the domain to which it is assigned.
+During activation, a task executes in the domain of the activating task; afterward,
+it executes in the domain to which it is assigned.
 If the task is not assigned to any domain, it executes in that of the activating task.
 
 ----------------

Questions? Ask the ACAA Technical Agent