aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2006-02-15 10:29:59 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-02-15 10:29:59 +0100
commit57d8e34e5353358671adf5ac00f2704664312823 (patch)
tree09d900d2aba5ebd3960c5ca1bbb5429059b559b4 /gcc
parent1dd5ad55ebf62c67008e1644fc03412c4aeff810 (diff)
downloadgcc-57d8e34e5353358671adf5ac00f2704664312823.zip
gcc-57d8e34e5353358671adf5ac00f2704664312823.tar.gz
gcc-57d8e34e5353358671adf5ac00f2704664312823.tar.bz2
s-taprop-posix.adb, [...] (Create_Task): Remove task adjustment code.
2006-02-13 Pascal Obry <obry@adacore.com> * s-taprop-posix.adb, s-taprop-vxworks.adb, s-taprop-tru64.adb, s-taprop-lynxos.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb, s-taprop-linux.adb, s-taprop-solaris.adb, s-taprop-vms.adb (Create_Task): Remove task adjustment code. This adjustement is already done when calling this routine. From-SVN: r111026
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/s-taprop-hpux-dce.adb17
-rw-r--r--gcc/ada/s-taprop-irix.adb36
-rw-r--r--gcc/ada/s-taprop-linux.adb19
-rw-r--r--gcc/ada/s-taprop-lynxos.adb15
-rw-r--r--gcc/ada/s-taprop-posix.adb15
-rw-r--r--gcc/ada/s-taprop-solaris.adb24
-rw-r--r--gcc/ada/s-taprop-tru64.adb18
-rw-r--r--gcc/ada/s-taprop-vms.adb22
-rw-r--r--gcc/ada/s-taprop-vxworks.adb25
9 files changed, 28 insertions, 163 deletions
diff --git a/gcc/ada/s-taprop-hpux-dce.adb b/gcc/ada/s-taprop-hpux-dce.adb
index 5989c19..b72a82c 100644
--- a/gcc/ada/s-taprop-hpux-dce.adb
+++ b/gcc/ada/s-taprop-hpux-dce.adb
@@ -779,24 +779,13 @@ package body System.Task_Primitives.Operations is
Priority : System.Any_Priority;
Succeeded : out Boolean)
is
- Attributes : aliased pthread_attr_t;
- Adjusted_Stack_Size : Interfaces.C.size_t;
- Result : Interfaces.C.int;
+ Attributes : aliased pthread_attr_t;
+ Result : Interfaces.C.int;
function Thread_Body_Access is new
Unchecked_Conversion (System.Address, Thread_Body);
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
-
Result := pthread_attr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -806,7 +795,7 @@ package body System.Task_Primitives.Operations is
end if;
Result := pthread_attr_setstacksize
- (Attributes'Access, Adjusted_Stack_Size);
+ (Attributes'Access, Interfaces.C.size_t (Stack_Size));
pragma Assert (Result = 0);
-- Since the initial signal mask of a thread is inherited from the
diff --git a/gcc/ada/s-taprop-irix.adb b/gcc/ada/s-taprop-irix.adb
index 5c610b0..8b048e4 100644
--- a/gcc/ada/s-taprop-irix.adb
+++ b/gcc/ada/s-taprop-irix.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -60,19 +60,6 @@ with System.OS_Primitives;
with System.IO;
-- used for Put_Line
-with System.Parameters;
--- used for Size_Type
-
-with System.Program_Info;
--- used for Default_Task_Stack
--- Default_Time_Slice
--- Stack_Guard_Pages
--- Pthread_Sched_Signal
--- Pthread_Arena_Size
-
-with System.OS_Interface;
--- used for various type, constant, and operations
-
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -763,10 +750,9 @@ package body System.Task_Primitives.Operations is
is
use System.Task_Info;
- Attributes : aliased pthread_attr_t;
- Sched_Param : aliased struct_sched_param;
- Adjusted_Stack_Size : Interfaces.C.size_t;
- Result : Interfaces.C.int;
+ Attributes : aliased pthread_attr_t;
+ Sched_Param : aliased struct_sched_param;
+ Result : Interfaces.C.int;
function Thread_Body_Access is new
Unchecked_Conversion (System.Address, Thread_Body);
@@ -779,18 +765,6 @@ package body System.Task_Primitives.Operations is
(System.Task_Info.Thread_Scheduling_Policy, Interfaces.C.int);
begin
- if Stack_Size = System.Parameters.Unspecified_Size then
- Adjusted_Stack_Size :=
- Interfaces.C.size_t (System.Program_Info.Default_Task_Stack);
-
- elsif Stack_Size < Size_Type (Minimum_Stack_Size) then
- Adjusted_Stack_Size :=
- Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
-
Result := pthread_attr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -804,7 +778,7 @@ package body System.Task_Primitives.Operations is
pragma Assert (Result = 0);
Result := pthread_attr_setstacksize
- (Attributes'Access, Adjusted_Stack_Size);
+ (Attributes'Access, Interfaces.C.size_t (Stack_Size));
pragma Assert (Result = 0);
if T.Common.Task_Info /= null then
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index 6cb7eb7..6a3596e 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -44,9 +44,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with System.Tasking.Debug;
-- used for Known_Tasks
@@ -745,22 +742,10 @@ package body System.Task_Primitives.Operations is
Priority : System.Any_Priority;
Succeeded : out Boolean)
is
- Adjusted_Stack_Size : Interfaces.C.size_t;
-
Attributes : aliased pthread_attr_t;
Result : Interfaces.C.int;
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
-
Result := pthread_attr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -771,7 +756,7 @@ package body System.Task_Primitives.Operations is
Result :=
pthread_attr_setstacksize
- (Attributes'Access, Adjusted_Stack_Size);
+ (Attributes'Access, Interfaces.C.size_t (Stack_Size));
pragma Assert (Result = 0);
Result :=
diff --git a/gcc/ada/s-taprop-lynxos.adb b/gcc/ada/s-taprop-lynxos.adb
index 06313ed..a9b4cbb 100644
--- a/gcc/ada/s-taprop-lynxos.adb
+++ b/gcc/ada/s-taprop-lynxos.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -59,9 +59,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with Unchecked_Deallocation;
package body System.Task_Primitives.Operations is
@@ -869,15 +866,7 @@ package body System.Task_Primitives.Operations is
use System.Task_Info;
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
+ Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
if Stack_Base_Available then
diff --git a/gcc/ada/s-taprop-posix.adb b/gcc/ada/s-taprop-posix.adb
index 492c070..6195f24 100644
--- a/gcc/ada/s-taprop-posix.adb
+++ b/gcc/ada/s-taprop-posix.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -64,9 +64,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -892,15 +889,7 @@ package body System.Task_Primitives.Operations is
use System.Task_Info;
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
+ Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
if Stack_Base_Available then
-- If Stack Checking is supported then allocate 2 additional pages:
diff --git a/gcc/ada/s-taprop-solaris.adb b/gcc/ada/s-taprop-solaris.adb
index c9e1504..aa816b6 100644
--- a/gcc/ada/s-taprop-solaris.adb
+++ b/gcc/ada/s-taprop-solaris.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -61,9 +61,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with System.Task_Info;
-- to initialize Task_Info for a C thread, in function Self
@@ -981,11 +978,11 @@ package body System.Task_Primitives.Operations is
is
pragma Unreferenced (Priority);
- Result : Interfaces.C.int;
+ Result : Interfaces.C.int;
Adjusted_Stack_Size : Interfaces.C.size_t;
- Opts : Interfaces.C.int := THR_DETACHED;
+ Opts : Interfaces.C.int := THR_DETACHED;
- Page_Size : constant System.Parameters.Size_Type := 4096;
+ Page_Size : constant System.Parameters.Size_Type := 4096;
-- This constant is for reserving extra space at the
-- end of the stack, which can be used by the stack
-- checking as guard page. The idea is that we need
@@ -995,18 +992,7 @@ package body System.Task_Primitives.Operations is
use System.Task_Info;
begin
- if Stack_Size = System.Parameters.Unspecified_Size then
- Adjusted_Stack_Size :=
- Interfaces.C.size_t (Default_Stack_Size + Page_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size :=
- Interfaces.C.size_t (Minimum_Stack_Size + Page_Size);
-
- else
- Adjusted_Stack_Size :=
- Interfaces.C.size_t (Stack_Size + Page_Size);
- end if;
+ Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size + Page_Size);
-- Since the initial signal mask of a thread is inherited from the
-- creator, and the Environment task has all its signals masked, we
diff --git a/gcc/ada/s-taprop-tru64.adb b/gcc/ada/s-taprop-tru64.adb
index d4846d5..d7e602a 100644
--- a/gcc/ada/s-taprop-tru64.adb
+++ b/gcc/ada/s-taprop-tru64.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -61,9 +61,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with Unchecked_Deallocation;
package body System.Task_Primitives.Operations is
@@ -780,20 +777,11 @@ package body System.Task_Primitives.Operations is
use System.Task_Info;
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
-
-- Account for the Yellow Zone (2 pages) and the guard page
-- right above. See Hide_Yellow_Zone for the rationale.
- Adjusted_Stack_Size := Adjusted_Stack_Size + 3 * Get_Page_Size;
+ Adjusted_Stack_Size :=
+ Interfaces.C.size_t (Stack_Size) + 3 * Get_Page_Size;
Result := pthread_attr_init (Attributes'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
diff --git a/gcc/ada/s-taprop-vms.adb b/gcc/ada/s-taprop-vms.adb
index 896dbe1..95a93b4 100644
--- a/gcc/ada/s-taprop-vms.adb
+++ b/gcc/ada/s-taprop-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -50,9 +50,6 @@ with Interfaces.C;
-- used for int
-- size_t
-with System.Parameters;
--- used for Size_Type
-
with System.Soft_Links;
-- used for Get_Exc_Stack_Addr
@@ -766,24 +763,13 @@ package body System.Task_Primitives.Operations is
Priority : System.Any_Priority;
Succeeded : out Boolean)
is
- Attributes : aliased pthread_attr_t;
- Adjusted_Stack_Size : Interfaces.C.size_t;
- Result : Interfaces.C.int;
+ Attributes : aliased pthread_attr_t;
+ Result : Interfaces.C.int;
function Thread_Body_Access is new
Unchecked_Conversion (System.Address, Thread_Body);
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
- end if;
-
-- Since the initial signal mask of a thread is inherited from the
-- creator, we need to set our local signal mask mask all signals
-- during the creation operation, to make sure the new thread is
@@ -802,7 +788,7 @@ package body System.Task_Primitives.Operations is
pragma Assert (Result = 0);
Result := pthread_attr_setstacksize
- (Attributes'Access, Adjusted_Stack_Size);
+ (Attributes'Access, Interfaces.C.size_t (Stack_Size));
pragma Assert (Result = 0);
-- This call may be unnecessary, not sure. ???
diff --git a/gcc/ada/s-taprop-vxworks.adb b/gcc/ada/s-taprop-vxworks.adb
index 2165ea7..56a02dd 100644
--- a/gcc/ada/s-taprop-vxworks.adb
+++ b/gcc/ada/s-taprop-vxworks.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -40,11 +40,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 System.Tasking;
--- used for Ada_Task_Control_Block
--- Task_Id
--- ATCB components and types
-
with System.Tasking.Debug;
-- used for Known_Tasks
@@ -54,12 +49,6 @@ with System.Interrupt_Management;
-- Signal_ID
-- Initialize_Interrupts
-with System.OS_Interface;
--- used for various type, constant, and operations
-
-with System.Parameters;
--- used for Size_Type
-
with Interfaces.C;
with Unchecked_Conversion;
@@ -866,16 +855,6 @@ package body System.Task_Primitives.Operations is
is
Adjusted_Stack_Size : size_t;
begin
- if Stack_Size = Unspecified_Size then
- Adjusted_Stack_Size := size_t (Default_Stack_Size);
-
- elsif Stack_Size < Minimum_Stack_Size then
- Adjusted_Stack_Size := size_t (Minimum_Stack_Size);
-
- else
- Adjusted_Stack_Size := size_t (Stack_Size);
- end if;
-
-- Ask for four extra bytes of stack space so that the ATCB pointer can
-- be stored below the stack limit, plus extra space for the frame of
-- Task_Wrapper. This is so the user gets the amount of stack requested
@@ -890,7 +869,7 @@ package body System.Task_Primitives.Operations is
-- ??? - we should come back and visit this so we can set the task name
-- to something appropriate.
- Adjusted_Stack_Size := Adjusted_Stack_Size + 2048;
+ Adjusted_Stack_Size := size_t (Stack_Size) + 2048;
-- Since the initial signal mask of a thread is inherited from the
-- creator, and the Environment task has all its signals masked, we do