Commit c5173b1a by Arnaud Charlet

s-osinte-lynxos-3.ads, [...] (Create_Task): Fix handling of Task_Info.

2007-04-06  Arnaud Charlet  <charlet@adacore.com>

	* s-osinte-lynxos-3.ads, s-osinte-hpux.ads, s-osinte-solaris-posix.ads,
	s-osinte-freebsd.ads, s-osinte-aix.ads, s-osinte-darwin.ads,
	s-taprop-posix.adb (Create_Task): Fix handling of Task_Info.
	(PTHREAD_SCOPE_PROCESS, PTHREAD_SCOPE_SYSTEM): New constants.

From-SVN: r123540
parent 0903be23
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
-- This is a AIX (Native THREADS) version of this package -- This is a AIX (Native THREADS) version of this package
-- This package encapsulates all direct interfaces to OS services -- This package encapsulates all direct interfaces to OS services that are
-- that are needed by children of System. -- needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- PLEASE DO NOT add any with-clauses to this package or remove the pragma
-- Preelaborate. This package is designed to be a bottom-level (leaf) package. -- Preelaborate. This package is designed to be a bottom-level (leaf) package.
...@@ -132,15 +132,15 @@ package System.OS_Interface is ...@@ -132,15 +132,15 @@ package System.OS_Interface is
SIGSAK : constant := 63; -- secure attention key SIGSAK : constant := 63; -- secure attention key
SIGADAABORT : constant := SIGTERM; SIGADAABORT : constant := SIGTERM;
-- Note: on other targets, we usually use SIGABRT, but on AiX, it -- Note: on other targets, we usually use SIGABRT, but on AIX, it appears
-- appears that SIGABRT can't be used in sigwait(), so we use SIGTERM. -- that SIGABRT can't be used in sigwait(), so we use SIGTERM.
type Signal_Set is array (Natural range <>) of Signal; type Signal_Set is array (Natural range <>) of Signal;
Unmasked : constant Signal_Set := Unmasked : constant Signal_Set :=
(SIGTRAP, SIGTTIN, SIGTTOU, SIGTSTP, SIGPROF); (SIGTRAP, SIGTTIN, SIGTTOU, SIGTSTP, SIGPROF);
Reserved : constant Signal_Set := Reserved : constant Signal_Set :=
(SIGABRT, SIGKILL, SIGSTOP, SIGALRM1, SIGWAITING, SIGCPUFAIL); (SIGABRT, SIGKILL, SIGSTOP, SIGALRM1, SIGWAITING, SIGCPUFAIL);
type sigset_t is private; type sigset_t is private;
...@@ -198,8 +198,7 @@ package System.OS_Interface is ...@@ -198,8 +198,7 @@ package System.OS_Interface is
function clock_gettime function clock_gettime
(clock_id : clockid_t; (clock_id : clockid_t;
tp : access timespec) return int; tp : access timespec) return int;
-- AiX threads don't have clock_gettime -- AIX threads don't have clock_gettime, so use gettimeofday() instead
-- We instead use gettimeofday()
function To_Duration (TS : timespec) return Duration; function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration); pragma Inline (To_Duration);
...@@ -215,8 +214,8 @@ package System.OS_Interface is ...@@ -215,8 +214,8 @@ package System.OS_Interface is
type struct_timezone_ptr is access all struct_timezone; type struct_timezone_ptr is access all struct_timezone;
type struct_timeval is private; type struct_timeval is private;
-- This is needed on systems that do not have clock_gettime() -- This is needed on systems that do not have clock_gettime() but do have
-- but do have gettimeofday(). -- gettimeofday().
function To_Duration (TV : struct_timeval) return Duration; function To_Duration (TV : struct_timeval) return Duration;
pragma Inline (To_Duration); pragma Inline (To_Duration);
...@@ -234,7 +233,7 @@ package System.OS_Interface is ...@@ -234,7 +233,7 @@ package System.OS_Interface is
function To_Target_Priority function To_Target_Priority
(Prio : System.Any_Priority) return Interfaces.C.int; (Prio : System.Any_Priority) return Interfaces.C.int;
-- Maps System.Any_Priority to a POSIX priority. -- Maps System.Any_Priority to a POSIX priority
------------- -------------
-- Process -- -- Process --
...@@ -277,23 +276,25 @@ package System.OS_Interface is ...@@ -277,23 +276,25 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 1; PTHREAD_CREATE_DETACHED : constant := 1;
PTHREAD_SCOPE_PROCESS : constant := 1;
PTHREAD_SCOPE_SYSTEM : constant := 0;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
Stack_Base_Available : constant Boolean := False; Stack_Base_Available : constant Boolean := False;
-- Indicates wether the stack base is available on this target. -- Indicates wether the stack base is available on this target
function Get_Stack_Base (thread : pthread_t) return Address; function Get_Stack_Base (thread : pthread_t) return Address;
pragma Inline (Get_Stack_Base); pragma Inline (Get_Stack_Base);
-- returns the stack base of the specified thread. -- Returns the stack base of the specified thread. Only call this function
-- Only call this function when Stack_Base_Available is True. -- when Stack_Base_Available is True.
function Get_Page_Size return size_t; function Get_Page_Size return size_t;
function Get_Page_Size return Address; function Get_Page_Size return Address;
pragma Import (C, Get_Page_Size, "getpagesize"); pragma Import (C, Get_Page_Size, "getpagesize");
-- returns the size of a page, or 0 if this is not relevant on this -- Returns the size of a page, or 0 if this is not relevant on this target
-- target
PROT_NONE : constant := 0; PROT_NONE : constant := 0;
PROT_READ : constant := 1; PROT_READ : constant := 1;
...@@ -312,7 +313,7 @@ package System.OS_Interface is ...@@ -312,7 +313,7 @@ package System.OS_Interface is
--------------------------------------- ---------------------------------------
-- Though not documented, pthread_init *must* be called before any other -- Though not documented, pthread_init *must* be called before any other
-- pthread call -- pthread call.
procedure pthread_init; procedure pthread_init;
pragma Import (C, pthread_init, "pthread_init"); pragma Import (C, pthread_init, "pthread_init");
...@@ -450,7 +451,7 @@ package System.OS_Interface is ...@@ -450,7 +451,7 @@ package System.OS_Interface is
pragma Import (C, pthread_attr_setschedparam); pragma Import (C, pthread_attr_setschedparam);
function sched_yield return int; function sched_yield return int;
-- AiX have a nonstandard sched_yield. -- AIX have a nonstandard sched_yield
-------------------------- --------------------------
-- P1003.1c Section 16 -- -- P1003.1c Section 16 --
...@@ -508,7 +509,6 @@ package System.OS_Interface is ...@@ -508,7 +509,6 @@ package System.OS_Interface is
pragma Import (C, pthread_key_create, "pthread_key_create"); pragma Import (C, pthread_key_create, "pthread_key_create");
private private
type sigset_t is record type sigset_t is record
losigs : unsigned_long; losigs : unsigned_long;
hisigs : unsigned_long; hisigs : unsigned_long;
......
...@@ -255,6 +255,9 @@ package System.OS_Interface is ...@@ -255,6 +255,9 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 2; PTHREAD_CREATE_DETACHED : constant := 2;
PTHREAD_SCOPE_PROCESS : constant := 2;
PTHREAD_SCOPE_SYSTEM : constant := 1;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
......
...@@ -298,6 +298,9 @@ package System.OS_Interface is ...@@ -298,6 +298,9 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 1; PTHREAD_CREATE_DETACHED : constant := 1;
PTHREAD_CREATE_JOINABLE : constant := 0; PTHREAD_CREATE_JOINABLE : constant := 0;
PTHREAD_SCOPE_PROCESS : constant := 0;
PTHREAD_SCOPE_SYSTEM : constant := 2;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
......
...@@ -272,6 +272,9 @@ package System.OS_Interface is ...@@ -272,6 +272,9 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 16#de#; PTHREAD_CREATE_DETACHED : constant := 16#de#;
PTHREAD_SCOPE_PROCESS : constant := 2;
PTHREAD_SCOPE_SYSTEM : constant := 1;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
......
...@@ -268,6 +268,9 @@ package System.OS_Interface is ...@@ -268,6 +268,9 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 0; PTHREAD_CREATE_DETACHED : constant := 0;
PTHREAD_SCOPE_PROCESS : constant := 0;
PTHREAD_SCOPE_SYSTEM : constant := 1;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
......
...@@ -263,6 +263,9 @@ package System.OS_Interface is ...@@ -263,6 +263,9 @@ package System.OS_Interface is
PTHREAD_CREATE_DETACHED : constant := 16#40#; PTHREAD_CREATE_DETACHED : constant := 16#40#;
PTHREAD_SCOPE_PROCESS : constant := 0;
PTHREAD_SCOPE_SYSTEM : constant := 1;
----------- -----------
-- Stack -- -- Stack --
----------- -----------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment