]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] RTEMS: use regular RTEMS API for minimum stack size calculation
authorPatrick Bernardi <bernardi@adacore.com>
Thu, 7 Oct 2021 15:21:24 +0000 (11:21 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 11 Oct 2021 13:38:12 +0000 (13:38 +0000)
gcc/ada/

* libgnat/s-parame__rtems.adb: use
_POSIX_Threads_Minimum_stack_size instead of
ada_pthread_minimum_stack_size.

gcc/ada/libgnat/s-parame__rtems.adb

index 1a6d577446c8c092af80358f2d1637aa0baa65c1..ae88a2c48c93c47ccf9328440878900cd870a508 100644 (file)
@@ -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;