diff options
author | Patrick Bernardi <bernardi@adacore.com> | 2021-10-07 11:21:24 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-11 13:38:12 +0000 |
commit | 0f076494f173aa47fa65434270bb91e8ea666b59 (patch) | |
tree | c9375e2a53a28427bdcfd43ee3e2dcabd09cd778 /gcc/ada/libgnat | |
parent | ddbcda718c3f7a3ce68906932d4e19478cfe3db6 (diff) | |
download | gcc-0f076494f173aa47fa65434270bb91e8ea666b59.zip gcc-0f076494f173aa47fa65434270bb91e8ea666b59.tar.gz gcc-0f076494f173aa47fa65434270bb91e8ea666b59.tar.bz2 |
[Ada] RTEMS: use regular RTEMS API for minimum stack size calculation
gcc/ada/
* libgnat/s-parame__rtems.adb: use
_POSIX_Threads_Minimum_stack_size instead of
ada_pthread_minimum_stack_size.
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r-- | gcc/ada/libgnat/s-parame__rtems.adb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ada/libgnat/s-parame__rtems.adb b/gcc/ada/libgnat/s-parame__rtems.adb index 1a6d577..ae88a2c 100644 --- a/gcc/ada/libgnat/s-parame__rtems.adb +++ b/gcc/ada/libgnat/s-parame__rtems.adb @@ -35,10 +35,6 @@ with Interfaces.C; package body System.Parameters is - function ada_pthread_minimum_stack_size return Interfaces.C.size_t; - pragma Import (C, ada_pthread_minimum_stack_size, - "_ada_pthread_minimum_stack_size"); - ------------------------- -- Adjust_Storage_Size -- ------------------------- @@ -61,8 +57,15 @@ package body System.Parameters is ------------------------ function Default_Stack_Size return Size_Type is + Default_Stack_Size : constant Integer + with Import, Convention => C, + External_Name => "__gl_default_stack_size"; begin - return Size_Type (ada_pthread_minimum_stack_size); + if Default_Stack_Size = -1 then + return 32 * 1024; + else + return Size_Type (Default_Stack_Size); + end if; end Default_Stack_Size; ------------------------ @@ -70,9 +73,11 @@ package body System.Parameters is ------------------------ function Minimum_Stack_Size return Size_Type is - + POSIX_Threads_Minimum_stack_size : constant Interfaces.C.size_t + with Import, Convention => C, + External_Name => "_POSIX_Threads_Minimum_stack_size"; begin - return Size_Type (ada_pthread_minimum_stack_size); + return Size_Type (POSIX_Threads_Minimum_stack_size); end Minimum_Stack_Size; end System.Parameters; |