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

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

--- ai05s/ai05-0167-1.txt	2010/06/13 01:34:16	1.4
+++ ai05s/ai05-0167-1.txt	2010/10/19 03:13:37	1.5
@@ -1,4 +1,4 @@
-!standard  D.16.1                               10-06-04    AI05-0167-1/03
+!standard  D.16.1                               10-10-18    AI05-0167-1/04
 !standard  C.3.2
 !class Amendment 09-10-22
 !status work item 09-10-22
@@ -45,7 +45,7 @@
   pragma Preelaborate(Multiprocessors);
   type CPU_Range is range 0 .. <implementation-defined>;
   Not_A_Specific_CPU : constant CPU_Range := 0;
-  subtype CPU is CPU_Range range 1 .. CPU_Range'last;
+  subtype CPU is CPU_Range range 1 .. CPU_Range'Last;
   function Number_Of_CPUs return CPU;
 end System.Multiprocessors;
 
@@ -80,23 +80,6 @@
 This clause allows implementations on multiprocessor platforms to
 be partitioned into distinct dispatching domains.
 
-Syntax
-
-The form of pragma Dispatching_Domain is as follows:
-
-pragma Dispatching_Domain (expression);
-
-
-Name Resolution Rules
-
-The expected type for the expression is
-System.Multiprocessors.Dispatching_Domain.
-
-A Dispatching_Domain pragma is allowed only immediately within a
-task_definition. At most one such pragma shall appear within a
-given construct.
-
-
 Static Semantics
 
 The following language-defined library package exists:
@@ -105,14 +88,12 @@
 package System.Multiprocessors.Dispatching_Domains is
 
    Dispatching_Domain_Error : exception;
-
-   type Dispatching_Domain is private;
 
-   System_Dispatching_Domain : Dispatching_Domain;
+   type Dispatching_Domain (<>) is limited private;
 
-[Should the type be limited and System_Dispatching_Domain a constant?]
+   System_Dispatching_Domain : constant Dispatching_Domain;
 
-   function Create(First,Last : CPU) return Dispatching_Domain;
+   function Create(First, Last : CPU) return Dispatching_Domain;
 
    function Get_First_CPU(DD : Dispatching_Domain) return CPU;
 
@@ -121,7 +102,8 @@
    function Get_Dispatching_Domain(T : Task_Id := Current_Task)
             return Dispatching_Domain;
 
-   procedure Assign_Task(DD  : in out Dispatching_Domain; P : in CPU_Range;
+   procedure Assign_Task(DD  : in out Dispatching_Domain;
+                           P : in CPU_Range := Not_A_Specific_CPU;
                            T : in Task_Id := Current_Task);
 
    procedure Set_CPU(P : in CPU_Range; T : in Task_Id := Current_Task);
@@ -142,39 +124,56 @@
 within System_Dispatching_Domain.
 
 
+Syntax
+
+The form of pragma Dispatching_Domain is as follows:
+
+pragma Dispatching_Domain (expression);
+
+
+Name Resolution Rules
+
+The expected type for the expression is
+System.Multiprocessors.Dispatching_Domains.Dispatching_Domain.
+
+
+Legality Rules
+
+A Dispatching_Domain pragma is allowed only immediately within a
+task_definition. At most one such pragma shall appear within a
+given construct.
+
 Dynamic Semantics
 
-The Dispatching_Domain value determines the dispatching domain on
+The Dispatching_Domain value, indicated by the use of pragma
+Dispatching_Domain, determines the dispatching domain on
 which the task will execute; the task is said to be assigned to that
 Dispatching_Domain. A task will activate on the dispatching
 domain of its activating task. A task without a Dispatching_Domain pragma
 will activate and execute on the same dispatching domain as its activating
 task.
 
-If the Dispatching_Domain value refers to a Dispatching_Domain that has
-not yet been created the task is defined to have failed, and it becomes
-a completed task (see 9.2(1)). If a task contains a CPU pragma and a
+If a task contains a CPU pragma and a
 Dispatching_Domain pragma, and the CPU value is not contained within
 the range of processors for the Dispatching_Domain value (and is not
-Not_A_Specific_CPU), the task is defined to have failed, and it becomes
-a completed task (see 9.2(1)).
+Not_A_Specific_CPU), the activation of the task is defined to have
+failed, and it becomes a completed task (see 9.2(1)).
 
 The function Create creates and returns a Dispatching_Domain containing all
-the processors in the range First .. Last. These processor are removed from
+the processors in the range First .. Last. These processors are removed from
 System_Dispatching_Domain. A call of Create will cause the exception
-Dispatching_Domain_Error to be raised if any designated processor is not
-initially in System_Dispatching_Domain, or if the system cannot support
+Dispatching_Domain_Error to be propagated 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.
 
-[Can calls of Create be restricted to library level code only?]
+Calls to Create can only be made from the environment task prior to the call
+of the main subprogram.
 
 The function Get_First_CPU returns the number of the first processor in DD.
-The exception Dispatching_Domain_Error is raised if DD is not created.
 
 The function Get_Last_CPU returns the number of the last processor in DD.
-The exception Dispatching_Domain_Error is raised if DD is not created.
 
 The function Get_Dispatching_Domain returns the Dispatching_Domain
 on which the task is assigned.
@@ -182,19 +181,23 @@
 A call of the procedure Assign_Task assigns task T to processor P within
 Dispatching_Domain DD. Task T can now execute only on processor P unless
 P designates Not_A_Specific_CPU, in which case it can execute on any processor
-within DD. The exception Dispatching_Domain_Error is raised if T is already
+within DD. The exception Dispatching_Domain_Error is propagated if T is already
 assigned to a Dispatching_Domain other than System_Dispatching_Domain, or
 if P is not one of the processors of DD (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.
+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 processor P.
 Task T can now execute only on processor P, unless P designates
 Not_A_Specific_CPU, in which case it can execute on any processor
 within its Dispatching_Domain. The exception
-Dispatching_Domain_Error is raised if P is not one of the processors of the
+Dispatching_Domain_Error is propagated if P 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.
@@ -202,30 +205,33 @@
 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 raised if P is not one of the processors
+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).
 
 
+Implementation Requirement
+
+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.
+
+
 Implementation Advice
 
 Each dispatching domain should have separate and disjoint ready queues.
 
-
 Documentation Requirement
 
 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
+queue manipulations occur. For any Interrupt_Id whose handler
 can execute on more than one processor the implementation shall
 also document this range of processors.
 
-If the implementation has predefined dispatching domains,
-the details of these domains should be documented.
-
 
 Implementation Permissions
 
-Implementation may limit the number of dispatching domains that can be
+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.
 
@@ -233,13 +239,16 @@
 
 Add to Ada.Interrupts (C.3.2):
 
+
+with System.Multiprocessors;
+
 
-function Get_CPU(I: Interrupt_Id) return CPU_Range;
+function Get_CPU(I: Interrupt_Id) return System.Multiprocessors.CPU_Range;
 
 
 The function Get_CPU returns the processor on which the handler for I is
 executed. If the handler can execute on more than one processor the
-value Not_A_Specific_CPU is returned.
+value System.Multiprocessors.Not_A_Specific_CPU is returned.
 
 
 !discussion

Questions? Ask the ACAA Technical Agent