From 2f97d24cad349a09ee1beb3e20b636925aa9baa9 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 27 Oct 2015 12:56:12 +0100 Subject: [multiple changes] 2015-10-27 Tristan Gingold * bindgen.adb (System_BB_CPU_Primitives_Multiprocessors_Used): New variable. (Gen_Adainit): Call Start_All_CPUs if the above variable is set to true. 2015-10-27 Emmanuel Briot * adaint.c, s-os_lib.adb, s-os_lib.ads (Copy_File_Attributes): New subprogram. From-SVN: r229429 --- gcc/ada/bindgen.adb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'gcc/ada/bindgen.adb') diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index e284a0e..098a1ae 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -88,6 +88,12 @@ package body Bindgen is -- attach interrupt handlers at the end of the elaboration when partition -- elaboration policy is sequential. + System_BB_CPU_Primitives_Multiprocessors_Used : Boolean := False; + -- Flag indicating wether the unit System.BB.CPU_Primitives.Multiprocessors + -- is in the closure of the partiation. This is set by procedure + -- Resolve_Binder_Options, and it is used to call a procedure that starts + -- slave processors. + Lib_Final_Built : Boolean := False; -- Flag indicating whether the finalize_library rountine has been built @@ -536,6 +542,13 @@ package body Bindgen is WBI (" procedure Activate_All_Tasks_Sequential;"); WBI (" pragma Import (C, Activate_All_Tasks_Sequential," & " ""__gnat_activate_all_tasks"");"); + WBI (""); + end if; + + if System_BB_CPU_Primitives_Multiprocessors_Used then + WBI (" procedure Start_Slave_CPUs;"); + WBI (" pragma Import (C, Start_Slave_CPUs," & + " ""__gnat_start_slave_cpus"");"); end if; WBI (" begin"); @@ -944,6 +957,10 @@ package body Bindgen is end if; end if; + if System_BB_CPU_Primitives_Multiprocessors_Used then + WBI (" Start_Slave_CPUs;"); + end if; + WBI (" end " & Ada_Init_Name.all & ";"); WBI (""); end Gen_Adainit; @@ -2872,6 +2889,12 @@ package body Bindgen is -- Ditto for the use of restrictions Check_Package (System_Restrictions_Used, "system.restrictions%s"); + + -- Ditto for use of an SMP bareboard runtime + + Check_Package (System_BB_CPU_Primitives_Multiprocessors_Used, + "system.bb.cpu_primitives.multiprocessors%s"); + end loop; end Resolve_Binder_Options; -- cgit v1.1