From 6e5f95d18f9e9ed9acce505df4dd6397978d360e Mon Sep 17 00:00:00 2001 From: yoogx Date: Sat, 29 Oct 2016 00:46:38 +0200 Subject: [PATCH] * Fixes for XtratuM 4.2.1 XML Schema --- ...ends-xtratum_conf-hardware_description.adb | 24 ++++++------- ...-backends-xtratum_conf-partition_table.adb | 7 ++-- ...na-backends-xtratum_conf-xm_hypervisor.adb | 35 ++++--------------- 3 files changed, 23 insertions(+), 43 deletions(-) diff --git a/src/backends/ocarina-backends-xtratum_conf-hardware_description.adb b/src/backends/ocarina-backends-xtratum_conf-hardware_description.adb index 96e556fb..be1df770 100644 --- a/src/backends/ocarina-backends-xtratum_conf-hardware_description.adb +++ b/src/backends/ocarina-backends-xtratum_conf-hardware_description.adb @@ -166,42 +166,42 @@ package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is Append_Node_To_List (Hw_Desc_Node, XTN.Subitems (Current_XML_Node)); - Processor_Node := Make_XML_Node ("ProcessorTable"); + -- First, create the section of the hardware + -- description of the system. - Append_Node_To_List (Processor_Node, XTN.Subitems (Hw_Desc_Node)); + Memory_Node := Make_XML_Node ("MemoryLayout"); - Current_XML_Node := Processor_Node; + Append_Node_To_List (Memory_Node, XTN.Subitems (Hw_Desc_Node)); - -- First, create the section of the hardware - -- description of the system. + Current_XML_Node := Memory_Node; if not AINU.Is_Empty (Subcomponents (E)) then S := First_Node (Subcomponents (E)); while Present (S) loop -- Visit the component instance corresponding to the -- subcomponent S. - if AINU.Is_Processor (Corresponding_Instance (S)) then + if AINU.Is_Memory (Corresponding_Instance (S)) then Visit (Corresponding_Instance (S)); end if; S := Next_Node (S); end loop; end if; - -- Then, create the section of the hardware + -- Then, create the section of the hardware -- description of the system. - Memory_Node := Make_XML_Node ("MemoryLayout"); + Processor_Node := Make_XML_Node ("ProcessorTable"); - Append_Node_To_List (Memory_Node, XTN.Subitems (Hw_Desc_Node)); + Append_Node_To_List (Processor_Node, XTN.Subitems (Hw_Desc_Node)); - Current_XML_Node := Memory_Node; + Current_XML_Node := Processor_Node; if not AINU.Is_Empty (Subcomponents (E)) then S := First_Node (Subcomponents (E)); while Present (S) loop -- Visit the component instance corresponding to the -- subcomponent S. - if AINU.Is_Memory (Corresponding_Instance (S)) then + if AINU.Is_Processor (Corresponding_Instance (S)) then Visit (Corresponding_Instance (S)); end if; S := Next_Node (S); @@ -291,7 +291,7 @@ package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is P := Make_Defining_Identifier (Name_Find); Set_Str_To_Name_Buffer - (Unsigned_Long_Long'Image (Frequency.S) & Frequency.F'Img); + (Unsigned_Long_Long'Image (Frequency.S) & "MHz"); Q := Make_Defining_Identifier (Remove_Char (Name_Find, ' ')); Append_Node_To_List diff --git a/src/backends/ocarina-backends-xtratum_conf-partition_table.adb b/src/backends/ocarina-backends-xtratum_conf-partition_table.adb index 475bcc5f..f0e2837a 100644 --- a/src/backends/ocarina-backends-xtratum_conf-partition_table.adb +++ b/src/backends/ocarina-backends-xtratum_conf-partition_table.adb @@ -210,7 +210,7 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is Set_Str_To_Name_Buffer ("flags"); P := Make_Defining_Identifier (Name_Find); - Set_Str_To_Name_Buffer ("system boot fp"); + Set_Str_To_Name_Buffer ("system fp"); Q := Make_Defining_Identifier (Name_Find); Append_Node_To_List (Make_Assignement (P, Q), @@ -309,11 +309,12 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is Append_Node_To_List (Make_Assignement (P, Q), XTN.Items (Temporal_Req_Node)); + + Append_Node_To_List + (Temporal_Req_Node, XTN.Subitems (Partition_Node)); end if; end; - Append_Node_To_List (Temporal_Req_Node, XTN.Subitems (Partition_Node)); - -- Now, handle the ports of the partition. if Has_Ports (E) then diff --git a/src/backends/ocarina-backends-xtratum_conf-xm_hypervisor.adb b/src/backends/ocarina-backends-xtratum_conf-xm_hypervisor.adb index b8846401..88013b6f 100644 --- a/src/backends/ocarina-backends-xtratum_conf-xm_hypervisor.adb +++ b/src/backends/ocarina-backends-xtratum_conf-xm_hypervisor.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2011-2015 ESA & ISAE. -- +-- Copyright (C) 2011-2016 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -174,8 +174,6 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is S : Node_Id; Xm_Hypervisor_Node : Node_Id; Memory_Area_Node : Node_Id; - Area_Node : Node_Id; --- Associated_Memory : Node_Id; P : Node_Id; Q : Node_Id; begin @@ -202,41 +200,22 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is (Make_Assignement (P, Q), XTN.Items (Xm_Hypervisor_Node)); - -- Create the PhysicalMemoryAreas node associated - -- to the HMHypervisor node. - Memory_Area_Node := Make_XML_Node ("PhysicalMemoryAreas"); + -- Create the PhysicalMemoryArea node associated + -- to the XMHypervisor node. + Memory_Area_Node := Make_XML_Node ("PhysicalMemoryArea"); Append_Node_To_List (Memory_Area_Node, XTN.Subitems (Xm_Hypervisor_Node)); - -- Create the PhysicalMemoryArea node associated - -- to the PhysicalMemoryAreas node. - Area_Node := Make_XML_Node ("Area"); - - Set_Str_To_Name_Buffer ("start"); - P := Make_Defining_Identifier (Name_Find); - Set_Str_To_Name_Buffer ("0x40000000"); - Q := Make_Defining_Identifier (Name_Find); --- Q := Make_Literal --- (XV.New_Numeric_Value ---- (Get_Integer_Property --- (Associated_Memory, "base_address"), 0, 10)); - - Append_Node_To_List (Make_Assignement (P, Q), XTN.Items (Area_Node)); - Set_Str_To_Name_Buffer ("size"); P := Make_Defining_Identifier (Name_Find); Set_Str_To_Name_Buffer ("512KB"); Q := Make_Defining_Identifier (Name_Find); --- Q := Make_Literal --- (XV.New_Numeric_Value --- (Get_Integer_Property --- (Associated_Memory, "byte_count"), 0, 10)); - - Append_Node_To_List (Make_Assignement (P, Q), XTN.Items (Area_Node)); - Append_Node_To_List (Area_Node, XTN.Subitems (Memory_Area_Node)); + Append_Node_To_List + (Make_Assignement (P, Q), + XTN.Items (Memory_Area_Node)); Append_Node_To_List (Xm_Hypervisor_Node, -- GitLab