summaryrefslogtreecommitdiff
path: root/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
diff options
context:
space:
mode:
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-13 10:33:47 +0000
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-13 10:33:47 +0000
commitd10a1b958f1f07035d7392745eb5921f52fe26d1 (patch)
tree9e7a255dce1e4de7aef3ad036f3ae0dff43d912b /gcc/ada/libgnarl/s-tpopsp__vxworks.adb
parentdb7cce9b8feed6f6f796256340e9a97aa5d4916c (diff)
downloadgcc-d10a1b958f1f07035d7392745eb5921f52fe26d1.tar.gz
2017-09-13 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (Register_Address_Clause_Check): New procedure to save the suppression status of Alignment_Check on the current scope. (Alignment_Checks_Suppressed): New function to use the saved instead of the current suppression status of Alignment_Check. (Address_Clause_Check_Record): Add Alignment_Checks_Suppressed field. (Analyze_Attribute_Definition_Clause): Instead of manually appending to the table, call Register_Address_Clause_Check. (Validate_Address_Clauses): Call Alignment_Checks_Suppressed on the recorded address clause instead of its entity. 2017-09-13 Jerome Guitton <guitton@adacore.com> * libgnarl/s-tpopsp__vxworks-tls.adb, libgnarl/s-tpopsp__vxworks-rtp.adb, libgnarl/s-tpopsp__vxworks.adb (Self): Register thread if task id is null. 2017-09-13 Arnaud Charlet <charlet@adacore.com> * libgnat/s-htable.adb, libgnat/s-htable.ads: Minor style tuning. 2017-09-13 Arnaud Charlet <charlet@adacore.com> * lib-xref-spark_specific.adb (Scopes): simplify hash map; now it maps from an entity to only scope index, as a mapping from an entity to the same entity was useless. (Get_Scope_Num): refactor as a simple renaming; rename parameter from N to E. (Set_Scope_Num): refactor as a simple renaming; rename parameter from N to E. (Is_Constant_Object_Without_Variable_Input): remove local "Result" variable, just use return statements. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252076 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/libgnarl/s-tpopsp__vxworks.adb')
-rw-r--r--gcc/ada/libgnarl/s-tpopsp__vxworks.adb22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
index bc343b1e16c..bd8f92d57be 100644
--- a/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
+++ b/gcc/ada/libgnarl/s-tpopsp__vxworks.adb
@@ -121,9 +121,29 @@ package body Specific is
-- Self --
----------
+ -- To make Ada tasks and C threads interoperate better, we have added some
+ -- functionality to Self. Suppose a C main program (with threads) calls an
+ -- Ada procedure and the Ada procedure calls the tasking runtime system.
+ -- Eventually, a call will be made to self. Since the call is not coming
+ -- from an Ada task, there will be no corresponding ATCB.
+
+ -- What we do in Self is to catch references that do not come from
+ -- recognized Ada tasks, and create an ATCB for the calling thread.
+
+ -- The new ATCB will be "detached" from the normal Ada task master
+ -- hierarchy, much like the existing implicitly created signal-server
+ -- tasks.
+
function Self return Task_Id is
+ Result : constant Task_Id := To_Task_Id (ATCB_Key);
begin
- return To_Task_Id (ATCB_Key);
+ if Result /= null then
+ return Result;
+ else
+ -- If the value is Null then it is a non-Ada task
+
+ return Register_Foreign_Thread;
+ end if;
end Self;
end Specific;