aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/bindgen.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-11-06 10:44:51 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-11-06 10:44:51 +0100
commit6bc057a79e2cef15d7dfd1170c1043cb0f271b04 (patch)
treea6504859fca4e60b28f22d72a2d374e0cfd7e0a9 /gcc/ada/bindgen.adb
parent3c55062f3030f6dcd365f89ba9ecfea2131889b4 (diff)
downloadgcc-6bc057a79e2cef15d7dfd1170c1043cb0f271b04.zip
gcc-6bc057a79e2cef15d7dfd1170c1043cb0f271b04.tar.gz
gcc-6bc057a79e2cef15d7dfd1170c1043cb0f271b04.tar.bz2
[multiple changes]
2012-11-06 Thomas Quinot <quinot@adacore.com> * s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even on platforms that do not support sockets (for the benefit of subtype IOCTL_Req_T). 2012-11-06 Ed Schonberg <schonberg@adacore.com> * par-ch4.adb (P_Primary): if-expressions, case-expressions, and quantified expressions are legal if surrounded by parentheses from an enclosing context, such as a call or an instantiation. 2012-11-06 Yannick Moy <moy@adacore.com> * impunit.adb (Get_Kind_Of_Unit): Return appropriate kind for predefined implementation files, instead of returning Not_Predefined_Unit on all .adb files. 2012-11-06 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Build_Activation_Chain_Entity): Return immediately if partition elaboration policy is sequential. (Build_Task_Activation_Call): Likewise. Use Activate_Restricted_Tasks on restricted profile. (Make_Task_Create_Call): Do not use the _Chain parameter if elaboration policy is sequential. Call Create_Restricted_Task_Sequential in that case. * exp_ch3.adb (Build_Initialization_Call): Change condition to support concurrent elaboration policy. (Build_Record_Init_Proc): Likewise. (Init_Formals): Likewise. * bindgen.adb (Gen_Adainit): Declare Partition_Elaboration_Policy and set it in generated code if the elaboration policy is sequential. The procedure called to activate all tasks is now named __gnat_activate_all_tasks. * rtsfind.adb (RE_Activate_Restricted_Task, RE_Create_Restricted_Task_Sequential): New RE_Id literals. * s-tarest.adb (Create_Restricted_Task): Added to create a task without adding it on an activation chain. (Activate_Tasks): Has now a Chain parameter. (Activate_All_Tasks_Sequential): Added. Called by the binder to activate all tasks. (Activate_Restricted_Tasks): Added. Called during elaboration to activate tasks of the units. * s-tarest.ads: Remove pragma Partition_Elaboration_Policy. (Partition_Elaboration_Policy): New variable (set by the binder). (Create_Restricted_Task): Revert removal of the chain parameter. (Create_Restricted_Task_Sequential): New procedure. (Activate_Restricted_Tasks): Revert removal. (Activate_All_Tasks_Sequential): New procedure. From-SVN: r193214
Diffstat (limited to 'gcc/ada/bindgen.adb')
-rw-r--r--gcc/ada/bindgen.adb53
1 files changed, 43 insertions, 10 deletions
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index e178a57..f4260a3 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -488,10 +488,16 @@ package body Bindgen is
WBI ("");
end if;
- if System_Tasking_Restricted_Stages_Used then
- WBI (" procedure Activate_Tasks;");
- WBI (" pragma Import (C, Activate_Tasks," &
- " ""__gnat_activate_tasks"");");
+ if System_Tasking_Restricted_Stages_Used
+ and then Partition_Elaboration_Policy_Specified = 'S'
+ then
+ WBI (" Partition_Elaboration_Policy : Character;");
+ WBI (" pragma Import (C, Partition_Elaboration_Policy," &
+ " ""__gnat_partition_elaboration_policy"");");
+ WBI ("");
+ WBI (" procedure Activate_All_Tasks_Sequential;");
+ WBI (" pragma Import (C, Activate_All_Tasks_Sequential," &
+ " ""__gnat_activate_all_tasks"");");
end if;
WBI (" begin");
@@ -510,8 +516,18 @@ package body Bindgen is
Write_Statement_Buffer;
end if;
+ if System_Tasking_Restricted_Stages_Used
+ and then Partition_Elaboration_Policy_Specified = 'S'
+ then
+ Set_String (" Partition_Elaboration_Policy := '");
+ Set_Char (Partition_Elaboration_Policy_Specified);
+ Set_String ("';");
+ Write_Statement_Buffer;
+ end if;
+
if Main_Priority = No_Main_Priority
and then Main_CPU = No_Main_CPU
+ and then not System_Tasking_Restricted_Stages_Used
then
WBI (" null;");
end if;
@@ -587,10 +603,16 @@ package body Bindgen is
-- Import task activation procedure for ravenscar
- if System_Tasking_Restricted_Stages_Used then
- WBI (" procedure Activate_Tasks;");
- WBI (" pragma Import (C, Activate_Tasks," &
- " ""__gnat_activate_tasks"");");
+ if System_Tasking_Restricted_Stages_Used
+ and then Partition_Elaboration_Policy_Specified = 'S'
+ then
+ WBI (" Partition_Elaboration_Policy : Character;");
+ WBI (" pragma Import (C, Partition_Elaboration_Policy," &
+ " ""__gnat_partition_elaboration_policy"");");
+ WBI ("");
+ WBI (" procedure Activate_All_Tasks_Sequential;");
+ WBI (" pragma Import (C, Activate_All_Tasks_Sequential," &
+ " ""__gnat_activate_all_tasks"");");
end if;
-- The import of the soft link which performs library-level object
@@ -727,6 +749,15 @@ package body Bindgen is
Set_String ("';");
Write_Statement_Buffer;
+ if System_Tasking_Restricted_Stages_Used
+ and then Partition_Elaboration_Policy_Specified = 'S'
+ then
+ Set_String (" Partition_Elaboration_Policy := '");
+ Set_Char (Partition_Elaboration_Policy_Specified);
+ Set_String ("';");
+ Write_Statement_Buffer;
+ end if;
+
Gen_Restrictions;
WBI (" Priority_Specific_Dispatching :=");
@@ -913,8 +944,10 @@ package body Bindgen is
WBI (" Freeze_Dispatching_Domains;");
end if;
- if System_Tasking_Restricted_Stages_Used then
- WBI (" Activate_Tasks;");
+ if System_Tasking_Restricted_Stages_Used
+ and then Partition_Elaboration_Policy_Specified = 'S'
+ then
+ WBI (" Activate_All_Tasks_Sequential;");
end if;
-- Case of main program is CIL function or procedure