s-osinte-darwin.adb, [...] (sigset_t_ptr): Removed, replaced by anonymous access type.

* s-osinte-darwin.adb, s-osinte-darwin.ads, s-osinte-vxworks.ads, 
	s-osinte-solaris.ads, s-osinte-linux.ads, s-osinte-freebsd.ads, 
	s-osinte-solaris-posix.ads, s-osinte-lynxos-3.ads, s-osinte-lynxos.ads, 
	s-osinte-tru64.ads, s-osinte-aix.ads, s-osinte-irix.ads, 
	s-osinte-hpux-dce.ads, s-osinte-linux-hppa.ads, 
	s-osinte-linux-alpha.ads, s-inmaop-posix.adb (sigset_t_ptr): Removed,
	replaced by anonymous access type.
	(pthread_sigmask): Now take an access sigset_t

	* s-osinte-hpux.ads:  Ditto.
	(pthread_mutex_t, pthread_cond_t): Update definitions to support
	properly 32 and 64 bit ABIs.

From-SVN: r111025
This commit is contained in:
Arnaud Charlet 2006-02-15 10:29:34 +01:00
parent 3ede876b32
commit 1dd5ad55eb
17 changed files with 68 additions and 102 deletions

View 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- --
@ -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;

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -324,12 +324,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "sigthreadmask");
--------------------------

View file

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2005 Free Software Foundation, Inc. --
-- Copyright (C) 1999-2006 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- --
@ -37,8 +37,6 @@ pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during
-- tasking operations. It causes infinite loops and other problems.
with Interfaces.C;
package body System.OS_Interface is
use Interfaces.C;

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -302,12 +302,10 @@ package System.OS_Interface is
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -353,12 +353,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -287,12 +287,10 @@ package System.OS_Interface is
pragma Inline (pthread_kill);
-- DCE_THREADS doesn't have pthread_kill
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
-- DCE THREADS does not have pthread_sigmask. Instead, it uses
-- sigprocmask to do the signal handling when the thread library is
-- sucked in.

View file

@ -6,8 +6,8 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2006, 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- --
@ -320,12 +320,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------
@ -526,29 +524,36 @@ private
type int_array is array (Natural range <>) of int;
type pthread_mutex_t is record
m_short : short_array (0 .. 1);
m_int : int;
m_int1 : int_array (0 .. 3);
m_pad : int; -- needed for 32 bit ABI, but *not* for 64 bit
m_ptr : System.Address;
m_short : short_array (0 .. 1);
m_int : int;
m_int1 : int_array (0 .. 3);
m_pad : int;
m_ptr : int;
-- actually m_ptr is a void*, and on 32 bit ABI, m_pad is added so that
-- this field takes 64 bits. On 64 bit ABI, m_pad is gone, and m_ptr is
-- a 64 bit void*. Assume int'Size = 32.
m_int2 : int_array (0 .. 1);
m_int3 : int_array (0 .. 3);
m_short2 : short_array (0 .. 1);
m_int4 : int_array (0 .. 4);
m_int5 : int_array (0 .. 1);
end record;
for pthread_mutex_t'Alignment use System.Address'Alignment;
pragma Convention (C, pthread_mutex_t);
type pthread_cond_t is record
c_short : short_array (0 .. 1);
c_int : int;
c_int1 : int_array (0 .. 3);
m_pad : int; -- needed for 32 bit ABI, but *not* for 64 bit
m_ptr : System.Address;
m_pad : int;
m_ptr : int; -- see comment in pthread_mutex_t
c_int2 : int_array (0 .. 1);
c_int3 : int_array (0 .. 1);
c_int4 : int_array (0 .. 1);
end record;
for pthread_cond_t'Alignment use System.Address'Alignment;
pragma Convention (C, pthread_cond_t);
type pthread_key_t is new int;

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -127,7 +127,6 @@ package System.OS_Interface is
SIGRTMAX : constant := 64; -- Posix 1003.1b signals
type sigset_t is private;
type sigset_t_ptr is access all sigset_t;
function sigaddset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigaddset, "sigaddset");
@ -284,8 +283,8 @@ package System.OS_Interface is
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -309,12 +309,10 @@ package System.OS_Interface is
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -8,7 +8,7 @@
-- (GNU/Linux-HPPA Version) --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -316,12 +316,10 @@ package System.OS_Interface is
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -314,12 +314,10 @@ package System.OS_Interface is
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -308,12 +308,10 @@ package System.OS_Interface is
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "sigprocmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -332,12 +332,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
-- The behavior of pthread_sigmask on LynxOS requires
-- further investigation.

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -306,12 +306,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -400,18 +400,16 @@ package System.OS_Interface is
function thr_kill (thread : thread_t; sig : Signal) return int;
pragma Import (C, thr_kill, "thr_kill");
type sigset_t_ptr is access all sigset_t;
function thr_sigsetmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, thr_sigsetmask, "thr_sigsetmask");
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "thr_sigsetmask");
function thr_suspend (target_thread : thread_t) return int;

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -335,12 +335,10 @@ package System.OS_Interface is
sig : Signal) return int;
pragma Import (C, pthread_kill);
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask);
--------------------------

View file

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, Free Software Foundation, Inc. --
-- Copyright (C) 1995-2006, 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- --
@ -141,12 +141,10 @@ package System.OS_Interface is
function sigwait (set : access sigset_t; sig : access Signal) return int;
pragma Inline (sigwait);
type sigset_t_ptr is access all sigset_t;
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "sigprocmask");
type t_id is new long;