-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
--- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T . --
--- O P E R A T I O N S --
+-- SYSTEM.INTERRUPT_MANAGEMENT.OPERATIONS --
-- --
-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2007, AdaCore --
+-- Copyright (C) 1995-2008, 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- --
-- --
------------------------------------------------------------------------------
--- This is a POSIX-like version of this package.
--- Note: this file can only be used for POSIX compliant systems.
+-- This is a POSIX-like version of this package
+
+-- Note: this file can only be used for POSIX compliant systems
with Interfaces.C;
--- used for int
--- size_t
--- unsigned
with System.OS_Interface;
--- used for various type, constant, and operations
-
with System.Storage_Elements;
--- used for To_Address
--- Integer_Address
package body System.Interrupt_Management.Operations is
Initial_Action : array (Signal) of aliased struct_sigaction;
Default_Action : aliased struct_sigaction;
+ pragma Warnings (Off, Default_Action);
- Ignore_Action : aliased struct_sigaction;
+ Ignore_Action : aliased struct_sigaction;
----------------------------
-- Thread_Block_Interrupt --
pragma Assert (Result = 0);
Result := sigaddset (Mask'Access, Signal (Interrupt));
pragma Assert (Result = 0);
- Result := pthread_sigmask (SIG_BLOCK, Mask'Unchecked_Access, null);
+ Result := pthread_sigmask (SIG_BLOCK, Mask'Access, null);
pragma Assert (Result = 0);
end Thread_Block_Interrupt;
pragma Assert (Result = 0);
Result := sigaddset (Mask'Access, Signal (Interrupt));
pragma Assert (Result = 0);
- Result := pthread_sigmask (SIG_UNBLOCK, Mask'Unchecked_Access, null);
+ Result := pthread_sigmask (SIG_UNBLOCK, Mask'Access, null);
pragma Assert (Result = 0);
end Thread_Unblock_Interrupt;
--------------------
function Interrupt_Wait
- (Mask : access Interrupt_Mask)
- return Interrupt_ID
+ (Mask : access Interrupt_Mask) return Interrupt_ID
is
Result : Interfaces.C.int;
Sig : aliased Signal;
+
begin
Result := sigwait (Mask, Sig'Access);
for Sig in 1 .. Signal'Last loop
Result := sigaction
- (Sig, null, Initial_Action (Sig)'Unchecked_Access);
+ (Sig, null, Initial_Action (Sig)'Access);
-- ??? [assert 1]
-- we can't check Result here since sigaction will fail on
-- The Keep_Unmasked signals should be unmasked for Environment task
- Result := pthread_sigmask (SIG_UNBLOCK, mask'Unchecked_Access, null);
+ Result := pthread_sigmask (SIG_UNBLOCK, mask'Access, null);
pragma Assert (Result = 0);
-- Get the signal mask of the Environment Task
- Result := pthread_sigmask (SIG_SETMASK, null, mask'Unchecked_Access);
+ Result := pthread_sigmask (SIG_SETMASK, null, mask'Access);
pragma Assert (Result = 0);
-- Setup the constants exported