From patchwork Fri Jun 13 09:59:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 359477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 291CC140093 for ; Fri, 13 Jun 2014 20:00:01 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ENhR8SULqNKnROaErCuRf8LOGL8Y1p9wEocPa6cowRWD9OKI9O 8k7Dr7ieHmrhJE4PflR8nage95MQ9LID5WmYOoRqboZPBK7YB1zQ7RdyTxXJ+kPd Psf5vH7bHBZ2nJh0r10lrq6asshZYlVf9ZUTTzQuPNvMb60RN0OG2ywYU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=zfiXmpx7vo0K4i71AHuUyVSn7AY=; b=NBLYfy/4M0NiYWf9Zw9C Dnhqb9HmVgoOix+45lgkZ09xuIwLMcgyQshF0kyK6K9yG75I4Cr5PlSzBlY2mes5 g9JapU12ySe4xfEkkjpCWdC1dIlEQiM2MIaGbRzTcBQd5tkPeC/WEOqQjWo07VWk TQeIJyphNcEIihvoysPK0kg= Received: (qmail 29468 invoked by alias); 13 Jun 2014 09:59:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29459 invoked by uid 89); 13 Jun 2014 09:59:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 13 Jun 2014 09:59:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4B5531161E4 for ; Fri, 13 Jun 2014 05:59:51 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EriblRISm+6g for ; Fri, 13 Jun 2014 05:59:51 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 355C011610E for ; Fri, 13 Jun 2014 05:59:51 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 31B7791976; Fri, 13 Jun 2014 05:59:51 -0400 (EDT) Date: Fri, 13 Jun 2014 05:59:51 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Geert Bosch Subject: [Ada] Make Task_Info pragma and package obsolescent Message-ID: <20140613095951.GA13920@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) The functionality is now provided in a target-independent manner Tested on x86_64-pc-linux-gnu, committed on trunk 2014-06-13 Geert Bosch * 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. Index: gnat_rm.texi =================================================================== --- gnat_rm.texi (revision 211615) +++ gnat_rm.texi (working copy) @@ -630,7 +630,6 @@ * 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):: @@ -1082,7 +1081,6 @@ * Pragma Suppress_Debug_Info:: * Pragma Suppress_Exception_Locations:: * Pragma Suppress_Initialization:: -* Pragma Task_Info:: * Pragma Task_Name:: * Pragma Task_Storage:: * Pragma Test_Case:: @@ -6870,27 +6868,6 @@ 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 @@ -19872,15 +19849,6 @@ 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}) @@ -22431,6 +22399,7 @@ * pragma No_Run_Time:: * pragma Ravenscar:: * pragma Restricted_Run_Time:: +* pragma Task_Info:: @end menu @node pragma No_Run_Time @@ -22459,6 +22428,41 @@ 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 Index: s-tasinf-solaris.ads =================================================================== --- s-tasinf-solaris.ads (revision 211615) +++ s-tasinf-solaris.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -36,14 +36,15 @@ -- 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 Index: sem_prag.adb =================================================================== --- sem_prag.adb (revision 211615) +++ sem_prag.adb (working copy) @@ -20519,6 +20519,12 @@ 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; Index: gnat_ugn.texi =================================================================== --- gnat_ugn.texi (revision 211615) +++ gnat_ugn.texi (working copy) @@ -22873,15 +22873,8 @@ 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: +GNAT supplies the following task-related pragma: -@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}. - @item @code{TASK_STORAGE} GNAT implements pragma @code{TASK_STORAGE} in the same way as HP Ada. @@ -23075,8 +23068,6 @@ @item @code{SOURCE_REFERENCE} -@item @code{TASK_INFO} - @item @code{UNCHECKED_UNION} @item @code{UNIMPLEMENTED_UNIT} Index: s-tasinf-mingw.ads =================================================================== --- s-tasinf-mingw.ads (revision 211615) +++ s-tasinf-mingw.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -36,14 +36,15 @@ -- 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 Index: s-tasinf.ads =================================================================== --- s-tasinf.ads (revision 211615) +++ s-tasinf.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -36,10 +36,11 @@ -- 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 Index: s-tasinf-linux.ads =================================================================== --- s-tasinf-linux.ads (revision 211615) +++ s-tasinf-linux.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -36,14 +36,15 @@ -- 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 Index: s-tasinf-vxworks.ads =================================================================== --- s-tasinf-vxworks.ads (revision 211615) +++ s-tasinf-vxworks.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- 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- -- @@ -36,14 +36,15 @@ -- 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