Commit 7cda9727 by Robert Dewar Committed by Arnaud Charlet

s-taprop-vxworks.adb, [...]: Minor reformatting.

2011-08-31  Robert Dewar  <dewar@adacore.com>

	* s-taprop-vxworks.adb, sem_ch5.adb, s-taprop-tru64.adb, exp_alfa.adb,
	s-taprop-vms.adb, bindgen.adb, s-mudido.adb, s-mudido.ads,
	sem_res.adb, expander.adb, s-taprop-mingw.adb, s-taprop-linux.adb,
	s-taprop-solaris.adb, s-mudido-affinity.adb, vms_conv.adb,
	s-taprop-irix.adb, s-taprop.ads, s-taskin.adb, s-taskin.ads,
	s-taprop-hpux-dce.adb, a-chtgbo.adb, s-taprop-posix.adb: Minor
	reformatting.

From-SVN: r178357
parent 0a190dfd
2011-08-31 Robert Dewar <dewar@adacore.com>
* s-taprop-vxworks.adb, sem_ch5.adb, s-taprop-tru64.adb, exp_alfa.adb,
s-taprop-vms.adb, bindgen.adb, s-mudido.adb, s-mudido.ads,
sem_res.adb, expander.adb, s-taprop-mingw.adb, s-taprop-linux.adb,
s-taprop-solaris.adb, s-mudido-affinity.adb, vms_conv.adb,
s-taprop-irix.adb, s-taprop.ads, s-taskin.adb, s-taskin.ads,
s-taprop-hpux-dce.adb, a-chtgbo.adb, s-taprop-posix.adb: Minor
reformatting.
2011-08-31 Hristian Kirtchev <kirtchev@adacore.com> 2011-08-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12 (Check_Private_View): Revert previous change. * sem_ch12 (Check_Private_View): Revert previous change.
......
...@@ -139,6 +139,14 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Operations is ...@@ -139,6 +139,14 @@ package body Ada.Containers.Hash_Tables.Generic_Bounded_Operations is
N : Nodes_Type renames HT.Nodes; N : Nodes_Type renames HT.Nodes;
begin begin
-- This subprogram "deallocates" a node by relinking the node off of the
-- active list and onto the free list. Previously it would flag index
-- value 0 as an error. The precondition was weakened, so that index
-- value 0 is now allowed, and this value is interpreted to mean "do
-- nothing". This makes its behavior analogous to the behavior of
-- Ada.Unchecked_Conversion, and allows callers to avoid having to add
-- special-case checks at the point of call.
if X = 0 then if X = 0 then
return; return;
end if; end if;
......
...@@ -240,7 +240,9 @@ package body Bindgen is ...@@ -240,7 +240,9 @@ package body Bindgen is
-- Local Subprograms -- -- Local Subprograms --
----------------------- -----------------------
procedure Check_File_In_Partition (File_Name : String; Flag : out Boolean); procedure Check_File_In_Partition
(File_Name : String;
Flag : out Boolean);
-- If the file indicated by File_Name is in the partition the Flag is set -- If the file indicated by File_Name is in the partition the Flag is set
-- to True, False otherwise. -- to True, False otherwise.
...@@ -401,7 +403,9 @@ package body Bindgen is ...@@ -401,7 +403,9 @@ package body Bindgen is
----------------------------- -----------------------------
procedure Check_File_In_Partition procedure Check_File_In_Partition
(File_Name : String; Flag : out Boolean) is (File_Name : String;
Flag : out Boolean)
is
begin begin
for J in Units.First .. Units.Last loop for J in Units.First .. Units.Last loop
if Get_Name_String (Units.Table (J).Sfile) = File_Name then if Get_Name_String (Units.Table (J).Sfile) = File_Name then
......
...@@ -89,7 +89,6 @@ package body Exp_Alfa is ...@@ -89,7 +89,6 @@ package body Exp_Alfa is
when others => when others =>
null; null;
end case; end case;
end Expand_Alfa; end Expand_Alfa;
......
...@@ -127,15 +127,19 @@ package body Expander is ...@@ -127,15 +127,19 @@ package body Expander is
else else
Debug_A_Entry ("expanding ", N); Debug_A_Entry ("expanding ", N);
-- Processing depends on node kind. For full details on the expansion
-- activity required in each case, see bodies of corresponding expand
-- routines.
begin begin
-- In ALFA mode we only need a very limited subset of the usual
-- expansions. This limited subset is implemented in Expand_Alfa.
if ALFA_Mode then if ALFA_Mode then
Expand_Alfa (N); Expand_Alfa (N);
-- Here for normal non-ALFA mode
else else
-- Processing depends on node kind. For full details on the
-- expansion activity required in each case, see bodies of
-- corresponding expand routines.
case Nkind (N) is case Nkind (N) is
...@@ -451,12 +455,12 @@ package body Expander is ...@@ -451,12 +455,12 @@ package body Expander is
when N_Variant_Part => when N_Variant_Part =>
Expand_N_Variant_Part (N); Expand_N_Variant_Part (N);
-- For all other node kinds, no expansion activity is required -- For all other node kinds, no expansion activity required
when others => null; when others =>
null;
end case; end case;
end if; end if;
exception exception
......
...@@ -45,8 +45,8 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -45,8 +45,8 @@ package body System.Multiprocessors.Dispatching_Domains is
-- Local data -- -- Local data --
---------------- ----------------
Dispatching_Domain_Tasks : Dispatching_Domain_Tasks : array (CPU'First .. Number_Of_CPUs) of Natural :=
array (CPU'First .. Number_Of_CPUs) of Natural := (others => 0); (others => 0);
-- We need to store whether there are tasks allocated to concrete -- We need to store whether there are tasks allocated to concrete
-- processors in the default system dispatching domain because we need to -- processors in the default system dispatching domain because we need to
-- check it before creating a new dispatching domain. -- check it before creating a new dispatching domain.
...@@ -135,12 +135,14 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -135,12 +135,14 @@ package body System.Multiprocessors.Dispatching_Domains is
use type System.Tasking.Task_Id; use type System.Tasking.Task_Id;
Valid_System_Domain : constant Boolean := Valid_System_Domain : constant Boolean :=
(First > CPU'First and then (First > CPU'First
and then
not (System_Dispatching_Domain (CPU'First .. First - 1) = not (System_Dispatching_Domain (CPU'First .. First - 1) =
(CPU'First .. First - 1 => False))) (CPU'First .. First - 1 => False)))
or else or else (Last < Number_Of_CPUs
(Last < Number_Of_CPUs and then and then not
not (System_Dispatching_Domain (Last + 1 .. Number_Of_CPUs) = (System_Dispatching_Domain
(Last + 1 .. Number_Of_CPUs) =
(Last + 1 .. Number_Of_CPUs => False))); (Last + 1 .. Number_Of_CPUs => False)));
-- Constant that indicates whether there would exist a non-empty system -- Constant that indicates whether there would exist a non-empty system
-- dispatching domain after the creation of this dispatching domain. -- dispatching domain after the creation of this dispatching domain.
...@@ -231,7 +233,9 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -231,7 +233,9 @@ package body System.Multiprocessors.Dispatching_Domains is
----------------------------- -----------------------------
procedure Delay_Until_And_Set_CPU procedure Delay_Until_And_Set_CPU
(Delay_Until_Time : Ada.Real_Time.Time; CPU : CPU_Range) is (Delay_Until_Time : Ada.Real_Time.Time;
CPU : CPU_Range)
is
begin begin
-- Not supported atomically by the underlying operating systems. -- Not supported atomically by the underlying operating systems.
-- Operating systems use to migrate the task immediately after the call -- Operating systems use to migrate the task immediately after the call
...@@ -258,8 +262,8 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -258,8 +262,8 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_CPU function Get_CPU
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return CPU_Range
return CPU_Range is is
begin begin
return Convert_Ids (T).Common.Base_CPU; return Convert_Ids (T).Common.Base_CPU;
end Get_CPU; end Get_CPU;
...@@ -270,8 +274,8 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -270,8 +274,8 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_Dispatching_Domain function Get_Dispatching_Domain
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return Dispatching_Domain
return Dispatching_Domain is is
begin begin
return Dispatching_Domain (Convert_Ids (T).Common.Domain); return Dispatching_Domain (Convert_Ids (T).Common.Domain);
end Get_Dispatching_Domain; end Get_Dispatching_Domain;
...@@ -366,8 +370,8 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -366,8 +370,8 @@ package body System.Multiprocessors.Dispatching_Domains is
-- Change the number of tasks attached to a given task in the system -- Change the number of tasks attached to a given task in the system
-- domain if needed. -- domain if needed.
if not Dispatching_Domains_Frozen and then if not Dispatching_Domains_Frozen
(Domain = null or else Domain = ST.System_Domain) and then (Domain = null or else Domain = ST.System_Domain)
then then
-- Reduce the number of tasks attached to the CPU from which this -- Reduce the number of tasks attached to the CPU from which this
-- task is being moved, if needed. -- task is being moved, if needed.
......
...@@ -57,7 +57,6 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -57,7 +57,6 @@ package body System.Multiprocessors.Dispatching_Domains is
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task)
is is
pragma Unreferenced (Domain, CPU, T); pragma Unreferenced (Domain, CPU, T);
begin begin
raise Dispatching_Domain_Error with "dispatching domains not supported"; raise Dispatching_Domain_Error with "dispatching domains not supported";
end Assign_Task; end Assign_Task;
...@@ -68,7 +67,6 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -68,7 +67,6 @@ package body System.Multiprocessors.Dispatching_Domains is
function Create (First, Last : CPU) return Dispatching_Domain is function Create (First, Last : CPU) return Dispatching_Domain is
pragma Unreferenced (First, Last); pragma Unreferenced (First, Last);
begin begin
raise Dispatching_Domain_Error with "dispatching domains not supported"; raise Dispatching_Domain_Error with "dispatching domains not supported";
return System_Dispatching_Domain; return System_Dispatching_Domain;
...@@ -79,10 +77,10 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -79,10 +77,10 @@ package body System.Multiprocessors.Dispatching_Domains is
----------------------------- -----------------------------
procedure Delay_Until_And_Set_CPU procedure Delay_Until_And_Set_CPU
(Delay_Until_Time : Ada.Real_Time.Time; CPU : CPU_Range) (Delay_Until_Time : Ada.Real_Time.Time;
CPU : CPU_Range)
is is
pragma Unreferenced (Delay_Until_Time, CPU); pragma Unreferenced (Delay_Until_Time, CPU);
begin begin
raise Dispatching_Domain_Error with "dispatching domains not supported"; raise Dispatching_Domain_Error with "dispatching domains not supported";
end Delay_Until_And_Set_CPU; end Delay_Until_And_Set_CPU;
...@@ -102,11 +100,9 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -102,11 +100,9 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_CPU function Get_CPU
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return CPU_Range
return CPU_Range
is is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
return Not_A_Specific_CPU; return Not_A_Specific_CPU;
end Get_CPU; end Get_CPU;
...@@ -117,11 +113,9 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -117,11 +113,9 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_Dispatching_Domain function Get_Dispatching_Domain
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return Dispatching_Domain
return Dispatching_Domain
is is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
return System_Dispatching_Domain; return System_Dispatching_Domain;
end Get_Dispatching_Domain; end Get_Dispatching_Domain;
...@@ -132,7 +126,6 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -132,7 +126,6 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_First_CPU (Domain : Dispatching_Domain) return CPU is function Get_First_CPU (Domain : Dispatching_Domain) return CPU is
pragma Unreferenced (Domain); pragma Unreferenced (Domain);
begin begin
return CPU'First; return CPU'First;
end Get_First_CPU; end Get_First_CPU;
...@@ -143,7 +136,6 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -143,7 +136,6 @@ package body System.Multiprocessors.Dispatching_Domains is
function Get_Last_CPU (Domain : Dispatching_Domain) return CPU is function Get_Last_CPU (Domain : Dispatching_Domain) return CPU is
pragma Unreferenced (Domain); pragma Unreferenced (Domain);
begin begin
return Number_Of_CPUs; return Number_Of_CPUs;
end Get_Last_CPU; end Get_Last_CPU;
...@@ -158,7 +150,6 @@ package body System.Multiprocessors.Dispatching_Domains is ...@@ -158,7 +150,6 @@ package body System.Multiprocessors.Dispatching_Domains is
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task)
is is
pragma Unreferenced (CPU, T); pragma Unreferenced (CPU, T);
begin begin
raise Dispatching_Domain_Error with "dispatching domains not supported"; raise Dispatching_Domain_Error with "dispatching domains not supported";
end Set_CPU; end Set_CPU;
......
...@@ -39,8 +39,7 @@ package System.Multiprocessors.Dispatching_Domains is ...@@ -39,8 +39,7 @@ package System.Multiprocessors.Dispatching_Domains is
function Get_Dispatching_Domain function Get_Dispatching_Domain
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return Dispatching_Domain;
return Dispatching_Domain;
procedure Assign_Task procedure Assign_Task
(Domain : in out Dispatching_Domain; (Domain : in out Dispatching_Domain;
...@@ -55,15 +54,16 @@ package System.Multiprocessors.Dispatching_Domains is ...@@ -55,15 +54,16 @@ package System.Multiprocessors.Dispatching_Domains is
function Get_CPU function Get_CPU
(T : Ada.Task_Identification.Task_Id := (T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) Ada.Task_Identification.Current_Task) return CPU_Range;
return CPU_Range;
procedure Delay_Until_And_Set_CPU procedure Delay_Until_And_Set_CPU
(Delay_Until_Time : Ada.Real_Time.Time; CPU : CPU_Range); (Delay_Until_Time : Ada.Real_Time.Time;
CPU : CPU_Range);
private private
type Dispatching_Domain is new System.Tasking.Dispatching_Domain_Access; type Dispatching_Domain is new System.Tasking.Dispatching_Domain_Access;
System_Dispatching_Domain : constant Dispatching_Domain := System_Dispatching_Domain : constant Dispatching_Domain :=
Dispatching_Domain (System.Tasking.System_Domain); Dispatching_Domain
(System.Tasking.System_Domain);
end System.Multiprocessors.Dispatching_Domains; end System.Multiprocessors.Dispatching_Domains;
...@@ -1247,6 +1247,7 @@ package body System.Task_Primitives.Operations is ...@@ -1247,6 +1247,7 @@ package body System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id) is procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
-- Setting task affinity is not supported by the underlying system -- Setting task affinity is not supported by the underlying system
......
...@@ -1348,6 +1348,7 @@ package body System.Task_Primitives.Operations is ...@@ -1348,6 +1348,7 @@ package body System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id) is procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
-- Setting task affinity is not supported by the underlying system -- Setting task affinity is not supported by the underlying system
......
...@@ -885,6 +885,7 @@ package body System.Task_Primitives.Operations is ...@@ -885,6 +885,7 @@ package body System.Task_Primitives.Operations is
elsif T.Common.Domain /= null then elsif T.Common.Domain /= null then
declare declare
CPU_Set : aliased cpu_set_t := (bits => (others => False)); CPU_Set : aliased cpu_set_t := (bits => (others => False));
begin begin
-- Set the affinity to all the processors belonging to the -- Set the affinity to all the processors belonging to the
-- dispatching domain. -- dispatching domain.
...@@ -1365,7 +1366,6 @@ package body System.Task_Primitives.Operations is ...@@ -1365,7 +1366,6 @@ package body System.Task_Primitives.Operations is
if pthread_setaffinity_np'Address /= System.Null_Address then if pthread_setaffinity_np'Address /= System.Null_Address then
declare declare
CPU_Set : access cpu_set_t := null; CPU_Set : access cpu_set_t := null;
Result : Interfaces.C.int; Result : Interfaces.C.int;
begin begin
...@@ -1374,6 +1374,7 @@ package body System.Task_Primitives.Operations is ...@@ -1374,6 +1374,7 @@ package body System.Task_Primitives.Operations is
-- domain, if any. -- domain, if any.
if T.Common.Base_CPU /= Multiprocessors.Not_A_Specific_CPU then if T.Common.Base_CPU /= Multiprocessors.Not_A_Specific_CPU then
-- Set the affinity to an unique CPU -- Set the affinity to an unique CPU
CPU_Set := new cpu_set_t'(bits => (others => False)); CPU_Set := new cpu_set_t'(bits => (others => False));
...@@ -1389,8 +1390,9 @@ package body System.Task_Primitives.Operations is ...@@ -1389,8 +1390,9 @@ package body System.Task_Primitives.Operations is
-- Handle dispatching domains -- Handle dispatching domains
elsif T.Common.Domain /= null and then elsif T.Common.Domain /= null and then
(T.Common.Domain /= ST.System_Domain or else (T.Common.Domain /= ST.System_Domain
T.Common.Domain.all /= (Multiprocessors.CPU'First .. or else T.Common.Domain.all /=
(Multiprocessors.CPU'First ..
Multiprocessors.Number_Of_CPUs => True)) Multiprocessors.Number_Of_CPUs => True))
then then
-- Set the affinity to all the processors belonging to the -- Set the affinity to all the processors belonging to the
...@@ -1414,9 +1416,7 @@ package body System.Task_Primitives.Operations is ...@@ -1414,9 +1416,7 @@ package body System.Task_Primitives.Operations is
if CPU_Set /= null then if CPU_Set /= null then
Result := Result :=
pthread_setaffinity_np pthread_setaffinity_np
(T.Common.LL.Thread, (T.Common.LL.Thread, CPU_SETSIZE / 8, CPU_Set);
CPU_SETSIZE / 8,
CPU_Set);
pragma Assert (Result = 0); pragma Assert (Result = 0);
end if; end if;
end; end;
......
...@@ -1187,6 +1187,7 @@ package body System.Task_Primitives.Operations is ...@@ -1187,6 +1187,7 @@ package body System.Task_Primitives.Operations is
procedure Set_True (S : in out Suspension_Object) is procedure Set_True (S : in out Suspension_Object) is
Result : BOOL; Result : BOOL;
begin begin
SSL.Abort_Defer.all; SSL.Abort_Defer.all;
...@@ -1203,6 +1204,7 @@ package body System.Task_Primitives.Operations is ...@@ -1203,6 +1204,7 @@ package body System.Task_Primitives.Operations is
Result := SetEvent (S.CV); Result := SetEvent (S.CV);
pragma Assert (Result = Win32.TRUE); pragma Assert (Result = Win32.TRUE);
else else
S.State := True; S.State := True;
end if; end if;
...@@ -1226,6 +1228,7 @@ package body System.Task_Primitives.Operations is ...@@ -1226,6 +1228,7 @@ package body System.Task_Primitives.Operations is
EnterCriticalSection (S.L'Access); EnterCriticalSection (S.L'Access);
if S.Waiting then if S.Waiting then
-- Program_Error must be raised upon calling Suspend_Until_True -- Program_Error must be raised upon calling Suspend_Until_True
-- if another task is already waiting on that suspension object -- if another task is already waiting on that suspension object
-- (ARM D.10 par. 10). -- (ARM D.10 par. 10).
...@@ -1235,6 +1238,7 @@ package body System.Task_Primitives.Operations is ...@@ -1235,6 +1238,7 @@ package body System.Task_Primitives.Operations is
SSL.Abort_Undefer.all; SSL.Abort_Undefer.all;
raise Program_Error; raise Program_Error;
else else
-- Suspend the task if the state is False. Otherwise, the task -- Suspend the task if the state is False. Otherwise, the task
-- continues its execution, and the state of the suspension object -- continues its execution, and the state of the suspension object
...@@ -1246,6 +1250,7 @@ package body System.Task_Primitives.Operations is ...@@ -1246,6 +1250,7 @@ package body System.Task_Primitives.Operations is
LeaveCriticalSection (S.L'Access); LeaveCriticalSection (S.L'Access);
SSL.Abort_Undefer.all; SSL.Abort_Undefer.all;
else else
S.Waiting := True; S.Waiting := True;
...@@ -1268,8 +1273,7 @@ package body System.Task_Primitives.Operations is ...@@ -1268,8 +1273,7 @@ package body System.Task_Primitives.Operations is
-- Check_Exit -- -- Check_Exit --
---------------- ----------------
-- Dummy versions. The only currently working versions is for solaris -- Dummy versions, currently this only works for solaris (native)
-- (native).
function Check_Exit (Self_ID : ST.Task_Id) return Boolean is function Check_Exit (Self_ID : ST.Task_Id) return Boolean is
pragma Unreferenced (Self_ID); pragma Unreferenced (Self_ID);
...@@ -1365,7 +1369,8 @@ package body System.Task_Primitives.Operations is ...@@ -1365,7 +1369,8 @@ package body System.Task_Primitives.Operations is
-- The CPU numbering in pragma CPU starts at 1 while the subprogram -- The CPU numbering in pragma CPU starts at 1 while the subprogram
-- to set the affinity starts at 0, therefore we must substract 1. -- to set the affinity starts at 0, therefore we must substract 1.
Result := SetThreadIdealProcessor Result :=
SetThreadIdealProcessor
(T.Common.LL.Thread, ProcessorId (T.Common.Base_CPU) - 1); (T.Common.LL.Thread, ProcessorId (T.Common.Base_CPU) - 1);
pragma Assert (Result = 1); pragma Assert (Result = 1);
...@@ -1381,9 +1386,11 @@ package body System.Task_Primitives.Operations is ...@@ -1381,9 +1386,11 @@ package body System.Task_Primitives.Operations is
-- Dispatching domains -- Dispatching domains
elsif T.Common.Domain /= null and then elsif T.Common.Domain /= null
(T.Common.Domain /= ST.System_Domain or else and then (T.Common.Domain /= ST.System_Domain
T.Common.Domain.all /= (Multiprocessors.CPU'First .. or else
T.Common.Domain.all /=
(Multiprocessors.CPU'First ..
Multiprocessors.Number_Of_CPUs => True)) Multiprocessors.Number_Of_CPUs => True))
then then
declare declare
...@@ -1392,6 +1399,7 @@ package body System.Task_Primitives.Operations is ...@@ -1392,6 +1399,7 @@ package body System.Task_Primitives.Operations is
begin begin
for Proc in T.Common.Domain'Range loop for Proc in T.Common.Domain'Range loop
if T.Common.Domain (Proc) then if T.Common.Domain (Proc) then
-- The thread affinity mask is a bit vector in which each -- The thread affinity mask is a bit vector in which each
-- bit represents a logical processor. -- bit represents a logical processor.
......
...@@ -1455,6 +1455,7 @@ package body System.Task_Primitives.Operations is ...@@ -1455,6 +1455,7 @@ package body System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id) is procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
-- Setting task affinity is not supported by the underlying system -- Setting task affinity is not supported by the underlying system
......
...@@ -1968,6 +1968,7 @@ package body System.Task_Primitives.Operations is ...@@ -1968,6 +1968,7 @@ package body System.Task_Primitives.Operations is
if T.Common.Task_Info.CPU = ANY_CPU then if T.Common.Task_Info.CPU = ANY_CPU then
Result := 0; Result := 0;
Proc := 0; Proc := 0;
while Proc < Last_Proc loop while Proc < Last_Proc loop
Result := p_online (Proc, PR_STATUS); Result := p_online (Proc, PR_STATUS);
...@@ -1988,6 +1989,7 @@ package body System.Task_Primitives.Operations is ...@@ -1988,6 +1989,7 @@ package body System.Task_Primitives.Operations is
then then
raise Invalid_CPU_Number; raise Invalid_CPU_Number;
end if; end if;
Result := Result :=
processor_bind processor_bind
(P_LWPID, id_t (T.Common.LL.LWP), (P_LWPID, id_t (T.Common.LL.LWP),
...@@ -1998,14 +2000,14 @@ package body System.Task_Primitives.Operations is ...@@ -1998,14 +2000,14 @@ package body System.Task_Primitives.Operations is
-- Handle dispatching domains -- Handle dispatching domains
elsif T.Common.Domain /= null and then elsif T.Common.Domain /= null
(T.Common.Domain /= ST.System_Domain or else and then (T.Common.Domain /= ST.System_Domain
T.Common.Domain.all /= (Multiprocessors.CPU'First .. or else T.Common.Domain.all /=
(Multiprocessors.CPU'First ..
Multiprocessors.Number_Of_CPUs => True)) Multiprocessors.Number_Of_CPUs => True))
then then
declare declare
CPU_Set : aliased psetid_t; CPU_Set : aliased psetid_t;
Result : int; Result : int;
begin begin
...@@ -2016,9 +2018,9 @@ package body System.Task_Primitives.Operations is ...@@ -2016,9 +2018,9 @@ package body System.Task_Primitives.Operations is
-- dispatching domain. -- dispatching domain.
for Proc in T.Common.Domain'Range loop for Proc in T.Common.Domain'Range loop
-- The Ada CPU numbering starts at 1 while the subprogram to -- The Ada CPU numbering starts at 1 while the subprogram to
-- set the affinity starts at 0, therefore we must substract -- set the affinity starts at 0, therefore we must substract 1.
-- 1.
if T.Common.Domain (Proc) then if T.Common.Domain (Proc) then
Result := Result :=
......
...@@ -1361,6 +1361,7 @@ package body System.Task_Primitives.Operations is ...@@ -1361,6 +1361,7 @@ package body System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id) is procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
-- Setting task affinity is not supported by the underlying system -- Setting task affinity is not supported by the underlying system
......
...@@ -1260,6 +1260,7 @@ package body System.Task_Primitives.Operations is ...@@ -1260,6 +1260,7 @@ package body System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id) is procedure Set_Task_Affinity (T : ST.Task_Id) is
pragma Unreferenced (T); pragma Unreferenced (T);
begin begin
-- Setting task affinity is not supported by the underlying system -- Setting task affinity is not supported by the underlying system
......
...@@ -1411,9 +1411,9 @@ package body System.Task_Primitives.Operations is ...@@ -1411,9 +1411,9 @@ package body System.Task_Primitives.Operations is
-- pragma CPU -- pragma CPU
if T.Common.Base_CPU /= System.Multiprocessors.Not_A_Specific_CPU then if T.Common.Base_CPU /= System.Multiprocessors.Not_A_Specific_CPU then
-- Ada 2012 pragma CPU uses CPU numbers starting from 1, while
-- on VxWorks the first CPU is identified by a 0, so we need to -- Ada 2012 pragma CPU uses CPU numbers starting from 1, while on
-- adjust. -- VxWorks the first CPU is identified by a 0, so we need to adjust.
Result := Result :=
taskCpuAffinitySet taskCpuAffinitySet
...@@ -1422,24 +1422,26 @@ package body System.Task_Primitives.Operations is ...@@ -1422,24 +1422,26 @@ package body System.Task_Primitives.Operations is
-- Task_Info -- Task_Info
elsif T.Common.Task_Info /= Unspecified_Task_Info then elsif T.Common.Task_Info /= Unspecified_Task_Info then
Result := Result := taskCpuAffinitySet (T.Common.LL.Thread, T.Common.Task_Info);
taskCpuAffinitySet (T.Common.LL.Thread, T.Common.Task_Info);
-- Handle dispatching domains -- Handle dispatching domains
elsif T.Common.Domain /= null and then elsif T.Common.Domain /= null
(T.Common.Domain /= ST.System_Domain or else and then (T.Common.Domain /= ST.System_Domain
T.Common.Domain.all /= (Multiprocessors.CPU'First .. or else T.Common.Domain.all /=
(Multiprocessors.CPU'First ..
Multiprocessors.Number_Of_CPUs => True)) Multiprocessors.Number_Of_CPUs => True))
then then
declare declare
CPU_Set : unsigned := 0; CPU_Set : unsigned := 0;
begin begin
-- Set the affinity to all the processors belonging to the -- Set the affinity to all the processors belonging to the
-- dispatching domain. -- dispatching domain.
for Proc in T.Common.Domain'Range loop for Proc in T.Common.Domain'Range loop
if T.Common.Domain (Proc) then if T.Common.Domain (Proc) then
-- The thread affinity mask is a bit vector in which each -- The thread affinity mask is a bit vector in which each
-- bit represents a logical processor. -- bit represents a logical processor.
...@@ -1447,8 +1449,7 @@ package body System.Task_Primitives.Operations is ...@@ -1447,8 +1449,7 @@ package body System.Task_Primitives.Operations is
end if; end if;
end loop; end loop;
Result := Result := taskMaskAffinitySet (T.Common.LL.Thread, CPU_Set);
taskMaskAffinitySet (T.Common.LL.Thread, CPU_Set);
end; end;
end if; end if;
end Set_Task_Affinity; end Set_Task_Affinity;
......
...@@ -549,6 +549,7 @@ package System.Task_Primitives.Operations is ...@@ -549,6 +549,7 @@ package System.Task_Primitives.Operations is
procedure Set_Task_Affinity (T : ST.Task_Id); procedure Set_Task_Affinity (T : ST.Task_Id);
-- Enforce at the operating system level the task affinity defined in the -- Enforce at the operating system level the task affinity defined in the
-- Ada Task Control Block. -- Ada Task Control Block. Has no effect if the underlying operating system
-- does not support this capability.
end System.Task_Primitives.Operations; end System.Task_Primitives.Operations;
...@@ -224,8 +224,10 @@ package body System.Tasking is ...@@ -224,8 +224,10 @@ package body System.Tasking is
-- into account. Use Number_Of_CPUs to know the exact number of -- into account. Use Number_Of_CPUs to know the exact number of
-- processors in the system at execution time. -- processors in the system at execution time.
System_Domain := new Dispatching_Domain' System_Domain :=
(Multiprocessors.CPU'First .. Multiprocessors.Number_Of_CPUs => True); new Dispatching_Domain'
(Multiprocessors.CPU'First .. Multiprocessors.Number_Of_CPUs =>
True);
T.Common.Domain := System_Domain; T.Common.Domain := System_Domain;
......
...@@ -394,8 +394,7 @@ package System.Tasking is ...@@ -394,8 +394,7 @@ package System.Tasking is
type Dispatching_Domain_Access is access Dispatching_Domain; type Dispatching_Domain_Access is access Dispatching_Domain;
System_Domain : Dispatching_Domain_Access; System_Domain : Dispatching_Domain_Access;
-- All processors belong to the default system dispatching domain at start -- All processors belong to default system dispatching domain at start up
-- up.
------------------------------------ ------------------------------------
-- Task related other definitions -- -- Task related other definitions --
...@@ -419,9 +418,8 @@ package System.Tasking is ...@@ -419,9 +418,8 @@ package System.Tasking is
function Storage_Size (T : Task_Id) return System.Parameters.Size_Type; function Storage_Size (T : Task_Id) return System.Parameters.Size_Type;
-- Retrieve from the TCB of the task the allocated size of its stack, -- Retrieve from the TCB of the task the allocated size of its stack,
-- either the system default or the size specified by a pragma. This -- either the system default or the size specified by a pragma. This is in
-- is in general a non-static value that can depend on discriminants -- general a non-static value that can depend on discriminants of the task.
-- of the task.
type Bit_Array is array (Integer range <>) of Boolean; type Bit_Array is array (Integer range <>) of Boolean;
pragma Pack (Bit_Array); pragma Pack (Bit_Array);
...@@ -429,8 +427,8 @@ package System.Tasking is ...@@ -429,8 +427,8 @@ package System.Tasking is
subtype Debug_Event_Array is Bit_Array (1 .. 16); subtype Debug_Event_Array is Bit_Array (1 .. 16);
Global_Task_Debug_Event_Set : Boolean := False; Global_Task_Debug_Event_Set : Boolean := False;
-- Set True when running under debugger control and a task debug -- Set True when running under debugger control and a task debug event
-- event signal has been requested. -- signal has been requested.
---------------------------------------------- ----------------------------------------------
-- Ada_Task_Control_Block (ATCB) definition -- -- Ada_Task_Control_Block (ATCB) definition --
......
...@@ -2250,14 +2250,12 @@ package body Sem_Ch5 is ...@@ -2250,14 +2250,12 @@ package body Sem_Ch5 is
Analyze (Subt); Analyze (Subt);
end if; end if;
-- If the domain of iteration is an expression, create a declaration -- If domain of iteration is an expression, create a declaration for it,
-- for it, so that finalization actions are introduced outside of the -- so that finalization actions are introduced outside of the loop.
-- loop.
if not Is_Entity_Name (Iter_Name) then if not Is_Entity_Name (Iter_Name) then
declare declare
Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name); Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
Decl : Node_Id; Decl : Node_Id;
begin begin
......
...@@ -8101,8 +8101,8 @@ package body Sem_Res is ...@@ -8101,8 +8101,8 @@ package body Sem_Res is
Resolve (Condition (N), Typ); Resolve (Condition (N), Typ);
Expander_Mode_Restore; Expander_Mode_Restore;
-- In ALFA mode, we need expansion in order to introduce properly the -- In ALFA mode, we need normal expansion in order to properly introduce
-- necessary transient scopes. -- the necessary transient scopes.
else else
Resolve (Condition (N), Typ); Resolve (Condition (N), Typ);
......
...@@ -1804,8 +1804,8 @@ package body VMS_Conv is ...@@ -1804,8 +1804,8 @@ package body VMS_Conv is
-- because the corresponding switch --unchecked... is -- because the corresponding switch --unchecked... is
-- for gnatmake, not for the compiler. -- for gnatmake, not for the compiler.
if Cargs and then if Cargs
Sw.Name.all = "/UNCHECKED_SHARED_LIB_IMPORTS" and then Sw.Name.all = "/UNCHECKED_SHARED_LIB_IMPORTS"
then then
Cargs := False; Cargs := False;
end if; end if;
...@@ -1825,6 +1825,7 @@ package body VMS_Conv is ...@@ -1825,6 +1825,7 @@ package body VMS_Conv is
case Sw.Translation is case Sw.Translation is
when T_Direct => when T_Direct =>
Place_Unix_Switches (Sw.Unix_String); Place_Unix_Switches (Sw.Unix_String);
if SwP < Arg'Last if SwP < Arg'Last
and then Arg (SwP + 1) = '=' and then Arg (SwP + 1) = '='
then then
...@@ -1863,8 +1864,8 @@ package body VMS_Conv is ...@@ -1863,8 +1864,8 @@ package body VMS_Conv is
Arg_Idx := Argv'First; Arg_Idx := Argv'First;
Next_Arg_Idx := Next_Arg_Idx :=
Get_Arg_End (Argv.all, Arg_Idx); Get_Arg_End (Argv.all, Arg_Idx);
Arg := new String' Arg :=
(Argv (Arg_Idx .. Next_Arg_Idx)); new String'(Argv (Arg_Idx .. Next_Arg_Idx));
goto Tryagain_After_Coalesce; goto Tryagain_After_Coalesce;
end if; end if;
...@@ -1892,9 +1893,8 @@ package body VMS_Conv is ...@@ -1892,9 +1893,8 @@ package body VMS_Conv is
while P2 < Endp while P2 < Endp
and then Arg (P2 + 1) /= ',' and then Arg (P2 + 1) /= ','
loop loop
-- A wildcard directory spec on -- A wildcard directory spec on VMS will
-- VMS will contain either * or -- contain either * or % or ...
-- % or ...
if Arg (P2) = '*' then if Arg (P2) = '*' then
Dir_Is_Wild := True; Dir_Is_Wild := True;
...@@ -1928,15 +1928,12 @@ package body VMS_Conv is ...@@ -1928,15 +1928,12 @@ package body VMS_Conv is
(Arg (SwP .. P2), True); (Arg (SwP .. P2), True);
for J in Dir_List.all'Range loop for J in Dir_List.all'Range loop
Place_Unix_Switches Place_Unix_Switches (Sw.Unix_String);
(Sw.Unix_String); Place_Lower (Dir_List.all (J).all);
Place_Lower
(Dir_List.all (J).all);
end loop; end loop;
else else
Place_Unix_Switches Place_Unix_Switches (Sw.Unix_String);
(Sw.Unix_String);
Place_Lower Place_Lower
(To_Canonical_Dir_Spec (To_Canonical_Dir_Spec
(Arg (SwP .. P2), False).all); (Arg (SwP .. P2), False).all);
...@@ -1956,8 +1953,7 @@ package body VMS_Conv is ...@@ -1956,8 +1953,7 @@ package body VMS_Conv is
else else
Place_Unix_Switches (Sw.Unix_String); Place_Unix_Switches (Sw.Unix_String);
-- Some switches end in "=". No space -- Some switches end in "=", no space here
-- here
if Sw.Unix_String if Sw.Unix_String
(Sw.Unix_String'Last) /= '=' (Sw.Unix_String'Last) /= '='
...@@ -1967,22 +1963,19 @@ package body VMS_Conv is ...@@ -1967,22 +1963,19 @@ package body VMS_Conv is
Place_Lower Place_Lower
(To_Canonical_Dir_Spec (To_Canonical_Dir_Spec
(Arg (SwP + 2 .. Arg'Last), (Arg (SwP + 2 .. Arg'Last), False).all);
False).all);
end if; end if;
when T_File | T_No_Space_File => when T_File | T_No_Space_File =>
if SwP + 2 > Arg'Last then if SwP + 2 > Arg'Last then
Put (Standard_Error, Put (Standard_Error, "missing file for: ");
"missing file for: ");
Put_Line (Standard_Error, Arg.all); Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1; Errors := Errors + 1;
else else
Place_Unix_Switches (Sw.Unix_String); Place_Unix_Switches (Sw.Unix_String);
-- Some switches end in "=". No space -- Some switches end in "=", no space here.
-- here.
if Sw.Translation = T_File if Sw.Translation = T_File
and then Sw.Unix_String and then Sw.Unix_String
...@@ -2004,8 +1997,7 @@ package body VMS_Conv is ...@@ -2004,8 +1997,7 @@ package body VMS_Conv is
else else
Put (Standard_Error, "argument for "); Put (Standard_Error, "argument for ");
Put (Standard_Error, Sw.Name.all); Put (Standard_Error, Sw.Name.all);
Put_Line Put_Line (Standard_Error, " must be numeric");
(Standard_Error, " must be numeric");
Errors := Errors + 1; Errors := Errors + 1;
end if; end if;
...@@ -2026,28 +2018,28 @@ package body VMS_Conv is ...@@ -2026,28 +2018,28 @@ package body VMS_Conv is
when T_String => when T_String =>
-- A String value must be extended to the -- A String value must be extended to the end of
-- end of the Argv, otherwise strings like -- the Argv, otherwise strings like "foo/bar" get
-- "foo/bar" get split at the slash. -- split at the slash.
-- The beginning and ending of the string -- The beginning and ending of the string are
-- are flagged with embedded nulls which -- flagged with embedded nulls which are removed
-- are removed when building the Spawn -- when building the Spawn call. Nulls are use
-- call. Nulls are use because they won't -- because they won't show up in a /? output.
-- show up in a /? output. Quotes aren't -- Quotes aren't used because that would make it
-- used because that would make it
-- difficult to embed them. -- difficult to embed them.
Place_Unix_Switches (Sw.Unix_String); Place_Unix_Switches (Sw.Unix_String);
if Next_Arg_Idx /= Argv'Last then if Next_Arg_Idx /= Argv'Last then
Next_Arg_Idx := Argv'Last; Next_Arg_Idx := Argv'Last;
Arg := new String' Arg :=
(Argv (Arg_Idx .. Next_Arg_Idx)); new String'(Argv (Arg_Idx .. Next_Arg_Idx));
SwP := Arg'First; SwP := Arg'First;
while SwP < Arg'Last and then while SwP < Arg'Last
Arg (SwP + 1) /= '=' loop and then Arg (SwP + 1) /= '='
loop
SwP := SwP + 1; SwP := SwP + 1;
end loop; end loop;
end if; end if;
...@@ -2072,10 +2064,9 @@ package body VMS_Conv is ...@@ -2072,10 +2064,9 @@ package body VMS_Conv is
Make_Commands_Active := null; Make_Commands_Active := null;
else else
-- Set source of new commands, also -- Set source of new commands, also setting this
-- setting this non-null indicates that -- non-null indicates that we are in the special
-- we are in the special commands mode -- commands mode for processing the -xargs case.
-- for processing the -xargs case.
Make_Commands_Active := Make_Commands_Active :=
Matching_Name Matching_Name
...@@ -2087,8 +2078,7 @@ package body VMS_Conv is ...@@ -2087,8 +2078,7 @@ package body VMS_Conv is
when T_Options => when T_Options =>
if SwP + 1 > Arg'Last then if SwP + 1 > Arg'Last then
Place_Unix_Switches Place_Unix_Switches (Sw.Options.Unix_String);
(Sw.Options.Unix_String);
SwP := Endp + 1; SwP := Endp + 1;
elsif Arg (SwP + 2) /= '(' then elsif Arg (SwP + 2) /= '(' then
...@@ -2109,7 +2099,6 @@ package body VMS_Conv is ...@@ -2109,7 +2099,6 @@ package body VMS_Conv is
while SwP <= Endp loop while SwP <= Endp loop
P2 := SwP; P2 := SwP;
while P2 < Endp while P2 < Endp
and then Arg (P2 + 1) /= ',' and then Arg (P2 + 1) /= ','
loop loop
...@@ -2122,8 +2111,7 @@ package body VMS_Conv is ...@@ -2122,8 +2111,7 @@ package body VMS_Conv is
Sw.Options); Sw.Options);
if Opt /= null then if Opt /= null then
Place_Unix_Switches Place_Unix_Switches (Opt.Unix_String);
(Opt.Unix_String);
end if; end if;
SwP := P2 + 2; SwP := P2 + 2;
...@@ -2131,8 +2119,7 @@ package body VMS_Conv is ...@@ -2131,8 +2119,7 @@ package body VMS_Conv is
when T_Other => when T_Other =>
Place_Unix_Switches Place_Unix_Switches
(new String'(Sw.Unix_String.all & (new String'(Sw.Unix_String.all & Arg.all));
Arg.all));
end case; end case;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment