-- 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- --
-- 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, --
-- 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 --
---------------------
------------------------
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;
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;
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;
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);
end loop;
- -- Setup the masks to be exported.
+ -- Setup the masks to be exported
Result := sigemptyset (mask'Access);
pragma Assert (Result = 0);