diff options
author | Doug Rupp <rupp@adacore.com> | 2015-11-18 10:39:37 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-11-18 11:39:37 +0100 |
commit | 86e066aa7a971af4b8e9deeb853bc3b3a2b479bd (patch) | |
tree | d6e82489bb9c9bcfd7fad7687e7fb7defdb67a98 /gcc | |
parent | 72d5c70bbf0d61dc16a0750c245a67db83c0f078 (diff) | |
download | gcc-86e066aa7a971af4b8e9deeb853bc3b3a2b479bd.zip gcc-86e066aa7a971af4b8e9deeb853bc3b3a2b479bd.tar.gz gcc-86e066aa7a971af4b8e9deeb853bc3b3a2b479bd.tar.bz2 |
s-parame-vxworks.adb: Reduce default stack size for stack limit check to a reasonable value
2015-11-18 Doug Rupp <rupp@adacore.com>
* s-parame-vxworks.adb: Reduce default stack size for stack
limit check to a reasonable value
* s-tpopsp-vxworks.adb: Make Stack_Limit a task variable for vx5 and
vxmils.
From-SVN: r230534
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/s-parame-vxworks.adb | 2 | ||||
-rw-r--r-- | gcc/ada/s-tpopsp-vxworks.adb | 37 |
3 files changed, 41 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 275d157..4f3dde0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,10 @@ +2015-11-18 Doug Rupp <rupp@adacore.com> + + * s-parame-vxworks.adb: Reduce default stack size for stack + limit check to a reasonable value + * s-tpopsp-vxworks.adb: Make Stack_Limit a task variable for vx5 and + vxmils. + 2015-11-18 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment): Diagnose assignment where diff --git a/gcc/ada/s-parame-vxworks.adb b/gcc/ada/s-parame-vxworks.adb index d023c8c..c27b092 100644 --- a/gcc/ada/s-parame-vxworks.adb +++ b/gcc/ada/s-parame-vxworks.adb @@ -58,7 +58,7 @@ package body System.Parameters is begin if Default_Stack_Size = -1 then if Stack_Check_Limits then - return 60 * 1024; + return 32 * 1024; -- Extra stack to allow for 12K exception area. else return 20 * 1024; diff --git a/gcc/ada/s-tpopsp-vxworks.adb b/gcc/ada/s-tpopsp-vxworks.adb index fb75510..c3a23c2 100644 --- a/gcc/ada/s-tpopsp-vxworks.adb +++ b/gcc/ada/s-tpopsp-vxworks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, 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,6 +44,18 @@ package body Specific is -- implementation. This mechanism is used to minimize impact on other -- targets. + Stack_Limit : aliased System.Address; + + pragma Import (C, Stack_Limit, "__gnat_stack_limit"); + + type Set_Stack_Limit_Proc_Acc is access procedure; + pragma Convention (C, Set_Stack_Limit_Proc_Acc); + + Set_Stack_Limit_Hook : Set_Stack_Limit_Proc_Acc; + pragma Import (C, Set_Stack_Limit_Hook, "__gnat_set_stack_limit_hook"); + -- Procedure to be called when a task is created to set stack limit if + -- limit checking is used. + ---------------- -- Initialize -- ---------------- @@ -80,12 +92,29 @@ package body Specific is return; end if; - if taskVarGet (0, ATCB_Key'Access) = ERROR then - Result := taskVarAdd (0, ATCB_Key'Access); + if not Is_Valid_Task then + Result := taskVarAdd (Self_Id.Common.LL.Thread, ATCB_Key'Access); pragma Assert (Result = OK); + + if Stack_Check_Limits + and then Result /= ERROR + and then Set_Stack_Limit_Hook /= null + then + -- This will be initialized from taskInfoGet() once the task is + -- is running. + + Result := + taskVarAdd (Self_Id.Common.LL.Thread, Stack_Limit'Access); + pragma Assert (Result /= ERROR); + end if; end if; - ATCB_Key := To_Address (Self_Id); + Result := + taskVarSet + (Self_Id.Common.LL.Thread, + ATCB_Key'Access, + To_Address (Self_Id)); + pragma Assert (Result /= ERROR); end Set; ---------- |