-- $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- --
-- 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, --
------------------------------------------------------------------------------
-- 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.
-- 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 --
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;
-------------------
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;
---------
procedure Set (Self_Id : Task_Id) is
begin
- RTEMS_Ada_Self := To_Address (Self_Id);
+ ATCB_Key := To_Address (Self_Id);
end Set;
----------
Result : System.Address;
begin
- Result := RTEMS_Ada_Self;
+ Result := ATCB_Key;
-- If the key value is Null, then it is a non-Ada task.