summaryrefslogtreecommitdiff
path: root/src/grt/grt-unithread.ads
diff options
context:
space:
mode:
authorTristan Gingold2015-09-04 21:52:38 +0200
committerTristan Gingold2015-09-04 21:52:38 +0200
commit8520993b4d1eadefa488dfc96dff25333f1b19db (patch)
tree818d4fe917d3e6b765932ed3d1ab1ee70dc3c508 /src/grt/grt-unithread.ads
parent2d8f611cb63b72aa0373efe0ffa0df47e25519c9 (diff)
downloadghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.tar.gz
ghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.tar.bz2
ghdl-8520993b4d1eadefa488dfc96dff25333f1b19db.zip
Suppress stack switching; save process state in secondary stack.
Diffstat (limited to 'src/grt/grt-unithread.ads')
-rw-r--r--src/grt/grt-unithread.ads22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/grt/grt-unithread.ads b/src/grt/grt-unithread.ads
index b35b7be..6bfacab 100644
--- a/src/grt/grt-unithread.ads
+++ b/src/grt/grt-unithread.ads
@@ -26,7 +26,6 @@ with System.Storage_Elements; -- Work around GNAT bug.
pragma Unreferenced (System.Storage_Elements);
with Grt.Signals; use Grt.Signals;
with Grt.Stack2; use Grt.Stack2;
-with Grt.Stacks; use Grt.Stacks;
package Grt.Unithread is
procedure Init;
@@ -46,28 +45,17 @@ package Grt.Unithread is
procedure Set_Current_Process (Proc : Process_Acc);
function Get_Current_Process return Process_Acc;
- -- The secondary stack for the thread. In this implementation, there is
- -- only one secondary stack, shared by all processes. This is allowed,
- -- because a wait statement cannot appear within a function. So at a wait
- -- statement, the secondary stack must be empty.
- function Get_Stack2 return Stack2_Ptr;
- procedure Set_Stack2 (St : Stack2_Ptr);
-
- -- The main stack. This is initialized by STACK_INIT.
- -- The return point.
- function Get_Main_Stack return Stack_Type;
- procedure Set_Main_Stack (St : Stack_Type);
+ -- The stack2 for all sensitized process. Since they cannot have
+ -- wait statements, the stack2 is always empty when the process is
+ -- suspended.
+ function Get_Common_Stack2 return Stack2_Ptr;
private
pragma Inline (Run_Parallel);
pragma Inline (Atomic_Insert);
pragma Inline (Atomic_Inc);
- pragma Inline (Get_Stack2);
- pragma Inline (Set_Stack2);
-
- pragma Inline (Get_Main_Stack);
- pragma Export (C, Set_Main_Stack, "grt_set_main_stack");
pragma Inline (Set_Current_Process);
pragma Inline (Get_Current_Process);
+ pragma Inline (Get_Common_Stack2);
end Grt.Unithread;