+2014-06-13 Geert Bosch <bosch@adacore.com>
+
+ * gnat_rm.texi, s-tasinf-solaris.ads, sem_prag.adb, gnat_ugn.texi,
+ s-tasinf-mingw.ads, s-tasinf.ads, s-tasinf-linux.ads,
+ s-tasinf-vxworks.ads: Make Task_Info pragma and package obsolescent.
+
+2014-06-13 Robert Dewar <dewar@adacore.com>
+
+ * s-tasini.adb, s-tarest.adb, s-taprob.adb: Minor reformatting.
+
2014-06-13 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Entity): Remove the check concerning volatile
* System.Restrictions (s-restri.ads)::
* System.Rident (s-rident.ads)::
* System.Strings.Stream_Ops (s-ststop.ads)::
-* System.Task_Info (s-tasinf.ads)::
* System.Unsigned_Types (s-unstyp.ads)::
* System.Wch_Cnv (s-wchcnv.ads)::
* System.Wch_Con (s-wchcon.ads)::
* Pragma Suppress_Debug_Info::
* Pragma Suppress_Exception_Locations::
* Pragma Suppress_Initialization::
-* Pragma Task_Info::
* Pragma Task_Name::
* Pragma Task_Storage::
* Pragma Test_Case::
for other than a first subtype, then it applies only to the given subtype.
The pragma may not be given after the type is frozen.
-@node Pragma Task_Info
-@unnumberedsec Pragma Task_Info
-@findex Task_Info
-@noindent
-Syntax
-
-@smallexample @c ada
-pragma Task_Info (EXPRESSION);
-@end smallexample
-
-@noindent
-This pragma appears within a task definition (like pragma
-@code{Priority}) and applies to the task in which it appears. The
-argument must be of type @code{System.Task_Info.Task_Info_Type}.
-The @code{Task_Info} pragma provides system dependent control over
-aspects of tasking implementation, for example, the ability to map
-tasks to specific processors. For details on the facilities available
-for the version of GNAT that you are using, see the documentation
-in the spec of package System.Task_Info in the runtime
-library.
-
@node Pragma Task_Name
@unnumberedsec Pragma Task_Name
@findex Task_Name
stream attributes are applied to string types, but the subprograms in this
package can be used directly by application programs.
-@node System.Task_Info (s-tasinf.ads)
-@section @code{System.Task_Info} (@file{s-tasinf.ads})
-@cindex @code{System.Task_Info} (@file{s-tasinf.ads})
-@cindex Task_Info pragma
-
-@noindent
-This package provides target dependent functionality that is used
-to support the @code{Task_Info} pragma
-
@node System.Unsigned_Types (s-unstyp.ads)
@section @code{System.Unsigned_Types} (@file{s-unstyp.ads})
@cindex @code{System.Unsigned_Types} (@file{s-unstyp.ads})
* pragma No_Run_Time::
* pragma Ravenscar::
* pragma Restricted_Run_Time::
+* pragma Task_Info::
@end menu
@node pragma No_Run_Time
preferred since the Ada 2005 pragma @code{Profile} is intended for
this kind of implementation dependent addition.
+@node pragma Task_Info
+@section pragma Task_Info
+
+The functionality provided by pragma @code{Task_Info} is now part of the
+Ada language. The @code{CPU} aspect and the package
+@code{System.Multiprocessors} offer a less system-dependent way to specify
+task affinity or to query the number of processsors.
+
+@noindent
+Syntax
+
+@smallexample @c ada
+pragma Task_Info (EXPRESSION);
+@end smallexample
+
+@noindent
+This pragma appears within a task definition (like pragma
+@code{Priority}) and applies to the task in which it appears. The
+argument must be of type @code{System.Task_Info.Task_Info_Type}.
+The @code{Task_Info} pragma provides system dependent control over
+aspects of tasking implementation, for example, the ability to map
+tasks to specific processors. For details on the facilities available
+for the version of GNAT that you are using, see the documentation
+in the spec of package System.Task_Info in the runtime
+library.
+
+@node package System.Task_Info (s-tasinf.ads)
+@section package System.Task_Info (@file{s-tasinf.ads})
+
+@noindent
+This package provides target dependent functionality that is used
+to support the @code{Task_Info} pragma. The predefined Ada package
+ @code{System.Multiprocessors} and the @code{CPU} aspect now provide a
+standard replacement for GNAT's @code{Task_Info} functionality.
+
@include fdl.texi
@c GNU Free Documentation License
area is created. In the absence of a pragma @code{TASK_STORAGE},
a default guard area is created.
-GNAT supplies the following task-related pragmas:
-
-@itemize @bullet
-@item @code{TASK_INFO}
-
-This pragma appears within a task definition and
-applies to the task in which it appears. The argument
-must be of type @code{SYSTEM.TASK_INFO.TASK_INFO_TYPE}.
+GNAT supplies the following task-related pragma:
@item @code{TASK_STORAGE}
@item @code{SOURCE_REFERENCE}
-@item @code{TASK_INFO}
-
@item @code{UNCHECKED_UNION}
@item @code{UNIMPLEMENTED_UNIT}
------------------------------------------------------------------------------
pragma Polling (Off);
--- Turn off polling, we do not want ATC polling to take place during
--- tasking operations. It causes infinite loops and other problems.
+-- Turn off polling, we do not want ATC polling to take place during tasking
+-- operations. It causes infinite loops and other problems.
with System.Task_Primitives.Operations;
with System.Parameters;
with System.Traces;
with System.Soft_Links.Tasking;
-with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+
+with System.Secondary_Stack;
+pragma Elaborate_All (System.Secondary_Stack);
pragma Unreferenced (System.Secondary_Stack);
-- Make sure the body of Secondary_Stack is elaborated before calling
--- Init_Tasking_Soft_Links.
+-- Init_Tasking_Soft_Links. See comments for this routine for explanation.
package body System.Tasking.Protected_Objects is
with System.Soft_Links.Tasking;
with System.Storage_Elements;
-with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+with System.Secondary_Stack;
+pragma Elaborate_All (System.Secondary_Stack);
-- Make sure the body of Secondary_Stack is elaborated before calling
--- Init_Tasking_Soft_Links.
+-- Init_Tasking_Soft_Links. See comments for this routine for explanation.
with System.Soft_Links;
-- Used for the non-tasking routines (*_NT) that refer to global data. They
-- --
-- S p e c --
-- --
--- Copyright (C) 2007-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 2007-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
--- This unit may be used directly from an application program by providing
--- an appropriate WITH, and the interface can be expected to remain stable.
+-- The functionality in this unit is now provided by the predefined package
+-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
-- This is the GNU/Linux version of this module
with System.OS_Interface;
package System.Task_Info is
+ pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
-- --
-- S p e c --
-- --
--- Copyright (C) 2007-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2007-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
--- This unit may be used directly from an application program by providing
--- an appropriate WITH, and the interface can be expected to remain stable.
+-- The functionality in this unit is now provided by the predefined package
+-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
-- This is the Windows (native) version of this module
with System.Win32;
package System.Task_Info is
+ pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
--- This unit may be used directly from an application program by providing
--- an appropriate WITH, and the interface can be expected to remain stable.
+-- The functionality in this unit is now provided by the predefined package
+-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
-- This is the Solaris (native) version of this module
with System.OS_Interface;
package System.Task_Info is
+ pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
--- This unit may be used directly from an application program by providing
--- an appropriate WITH, and the interface can be expected to remain stable.
+-- The functionality in this unit is now provided by the predefined package
+-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
-- This is the VxWorks version of this package
with Interfaces.C;
package System.Task_Info is
+ pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
--- This unit may be used directly from an application program by providing
--- an appropriate WITH, and the interface can be expected to remain stable.
+-- The functionality in this unit is now provided by the predefined package
+-- System.Multiprocessors and the CPU aspect. This package is obsolescent.
package System.Task_Info is
+ pragma Obsolescent (Task_Info, "use System.Multiprocessors and CPU aspect");
pragma Preelaborate;
pragma Elaborate_Body;
-- To ensure that a body is allowed
with System.Tasking.Debug;
with System.Parameters;
-with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+with System.Secondary_Stack;
+pragma Elaborate_All (System.Secondary_Stack);
pragma Unreferenced (System.Secondary_Stack);
-- Make sure the body of Secondary_Stack is elaborated before calling
--- Init_Tasking_Soft_Links.
+-- Init_Tasking_Soft_Links. See comments for this routine for explanation.
package body System.Tasking.Initialization is
begin
GNAT_Pragma;
+ if Warn_On_Obsolescent_Feature then
+ Error_Msg_N
+ ("'G'N'A'T pragma Task_Info is now obsolete, use 'C'P'U "
+ & "instead?j?", N);
+ end if;
+
if Nkind (P) /= N_Task_Definition then
Error_Pragma ("pragma% must appear in task definition");
end if;