OSDN Git Service

2012-02-22 Hristian Kirtchev <kirtchev@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-tpopsp-rtems.adb
index 6c83352..1d672b9 100644 (file)
@@ -10,6 +10,7 @@
 --                             $Revision: 1.2 $
 --                                                                          --
 --            Copyright (C) 1991-2003, Florida State University             --
+--            Copyright (C) 2008-2011, Free Software Foundation, Inc.       --
 --                                                                          --
 -- GNARL 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- --
@@ -19,8 +20,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNARL; see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- As a special exception,  if other files  instantiate  generics from this --
 -- unit, or you link  this unit with other files  to produce an executable, --
@@ -36,7 +37,7 @@
 ------------------------------------------------------------------------------
 
 --  This is a RTEMS version of this package which uses a special
---  variable for Ada self which is contexted switch implicitly by RTEMS.
+--  variable for Ada self which is context switched implicitly by RTEMS.
 --
 --  This is the same as the POSIX version except that an RTEMS variable
 --  is used instead of a POSIX key.
@@ -47,8 +48,8 @@ package body Specific is
    --  The following gives the Ada run-time direct access to a variable
    --  context switched by RTEMS at the lowest level.
 
-   RTEMS_Ada_Self : System.Address;
-   pragma Import (C, RTEMS_Ada_Self, "rtems_ada_self");
+   ATCB_Key : System.Address;
+   pragma Import (C, ATCB_Key, "rtems_ada_self");
 
    ----------------
    -- Initialize --
@@ -58,8 +59,7 @@ package body Specific is
       pragma Warnings (Off, Environment_Task);
 
    begin
-      ATCB_Key := No_Key;
-      RTEMS_Ada_Self := To_Address (Environment_Task);
+      ATCB_Key := To_Address (Environment_Task);
    end Initialize;
 
    -------------------
@@ -68,7 +68,7 @@ package body Specific is
 
    function Is_Valid_Task return Boolean is
    begin
-      return RTEMS_Ada_Self /= System.Null_Address;
+      return ATCB_Key /= System.Null_Address;
    end Is_Valid_Task;
 
    ---------
@@ -77,7 +77,7 @@ package body Specific is
 
    procedure Set (Self_Id : Task_Id) is
    begin
-      RTEMS_Ada_Self := To_Address (Self_Id);
+      ATCB_Key := To_Address (Self_Id);
    end Set;
 
    ----------
@@ -101,7 +101,7 @@ package body Specific is
       Result : System.Address;
 
    begin
-      Result := RTEMS_Ada_Self;
+      Result := ATCB_Key;
 
       --  If the key value is Null, then it is a non-Ada task.