OSDN Git Service

2007-04-20 Vincent Celier <celier@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-inmaop-posix.adb
index 987fb71..e9da380 100644 (file)
@@ -8,7 +8,7 @@
 --                                  B o d y                                 --
 --                                                                          --
 --             Copyright (C) 1991-1994, Florida State University            --
---                     Copyright (C) 1995-2005, AdaCore                     --
+--                     Copyright (C) 1995-2006, AdaCore                     --
 --                                                                          --
 -- 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- --
@@ -18,8 +18,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, --
@@ -48,18 +48,11 @@ with System.Storage_Elements;
 --  used for To_Address
 --           Integer_Address
 
-with Unchecked_Conversion;
-
 package body System.Interrupt_Management.Operations is
 
    use Interfaces.C;
    use System.OS_Interface;
 
-   type Interrupt_Mask_Ptr is access all Interrupt_Mask;
-
-   function "+" is new
-     Unchecked_Conversion (Interrupt_Mask_Ptr, sigset_t_ptr);
-
    ---------------------
    -- Local Variables --
    ---------------------
@@ -111,10 +104,9 @@ package body System.Interrupt_Management.Operations is
    ------------------------
 
    procedure Set_Interrupt_Mask (Mask : access Interrupt_Mask) is
-      Result   : Interfaces.C.int;
+      Result : Interfaces.C.int;
    begin
-      Result := pthread_sigmask
-        (SIG_SETMASK, +Interrupt_Mask_Ptr (Mask), null);
+      Result := pthread_sigmask (SIG_SETMASK, Mask, null);
       pragma Assert (Result = 0);
    end Set_Interrupt_Mask;
 
@@ -124,8 +116,7 @@ package body System.Interrupt_Management.Operations is
    is
       Result  : Interfaces.C.int;
    begin
-      Result := pthread_sigmask
-        (SIG_SETMASK, +Interrupt_Mask_Ptr (Mask), +Interrupt_Mask_Ptr (OMask));
+      Result := pthread_sigmask (SIG_SETMASK, Mask, OMask);
       pragma Assert (Result = 0);
    end Set_Interrupt_Mask;
 
@@ -136,8 +127,7 @@ package body System.Interrupt_Management.Operations is
    procedure Get_Interrupt_Mask (Mask : access Interrupt_Mask) is
       Result : Interfaces.C.int;
    begin
-      Result := pthread_sigmask
-        (SIG_SETMASK, null, +Interrupt_Mask_Ptr (Mask));
+      Result := pthread_sigmask (SIG_SETMASK, null, Mask);
       pragma Assert (Result = 0);
    end Get_Interrupt_Mask;
 
@@ -286,13 +276,14 @@ package body System.Interrupt_Management.Operations is
    end Setup_Interrupt_Mask;
 
 begin
-
    declare
       mask    : aliased sigset_t;
       allmask : aliased sigset_t;
       Result  : Interfaces.C.int;
 
    begin
+      Interrupt_Management.Initialize;
+
       for Sig in 1 .. Signal'Last loop
          Result := sigaction
            (Sig, null, Initial_Action (Sig)'Unchecked_Access);
@@ -304,7 +295,7 @@ begin
 
       end loop;
 
-      --  Setup the masks to be exported.
+      --  Setup the masks to be exported
 
       Result := sigemptyset (mask'Access);
       pragma Assert (Result = 0);