]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
Fixed EDKT163. Added code to assign "arch" to null when no "SupArchList" is specified...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / SurfaceAreaQuery.java
index c2918b7b3b87a956251c305aac2dacbd6e4df372..dbcc12772ceb16e566076a44bcd214bacb6a3c1c 100644 (file)
@@ -1304,24 +1304,24 @@ public class SurfaceAreaQuery {
                 ObjectMap.put("Libraries", moduleSA.getLibraries());\r
             }\r
             if (((ModuleSADocument.ModuleSA) result[i]).getPcdBuildDefinition() != null) {\r
-                ObjectMap.put("PcdBuildDefinition", moduleSA\r
-                        .getPcdBuildDefinition());\r
+                ObjectMap.put("PcdBuildDefinition", moduleSA.getPcdBuildDefinition());\r
             }\r
-            if (((ModuleSADocument.ModuleSA) result[i])\r
-                    .getModuleSaBuildOptions() != null) {\r
-                ObjectMap.put("ModuleSaBuildOptions", moduleSA\r
-                        .getModuleSaBuildOptions());\r
+            if (((ModuleSADocument.ModuleSA) result[i]).getModuleSaBuildOptions() != null) {\r
+                ObjectMap.put("ModuleSaBuildOptions", moduleSA.getModuleSaBuildOptions());\r
             }\r
 \r
             //\r
             // Get Fpd SA Module attribute and create FpdMoudleIdentification.\r
             //\r
-            arch = moduleSA.getSupArchList().toString();\r
+            if (moduleSA.isSetSupArchList()) {\r
+                arch = moduleSA.getSupArchList().toString();\r
+            } else {\r
+                arch = null;\r
+            }\r
 \r
             // TBD\r
             fvBinding = null;\r
-            saVersion = ((ModuleSADocument.ModuleSA) result[i])\r
-                    .getModuleVersion();\r
+            saVersion = ((ModuleSADocument.ModuleSA) result[i]).getModuleVersion();\r
 \r
             saGuid = moduleSA.getModuleGuid();\r
             pkgGuid = moduleSA.getPackageGuid();\r
@@ -1331,10 +1331,8 @@ public class SurfaceAreaQuery {
             // Create Module Identification which have class member of package\r
             // identification.\r
             //\r
-            PackageIdentification pkgId = new PackageIdentification(null,\r
-                    pkgGuid, pkgVersion);\r
-            ModuleIdentification saId = new ModuleIdentification(null, saGuid,\r
-                    saVersion);\r
+            PackageIdentification pkgId = new PackageIdentification(null, pkgGuid, pkgVersion);\r
+            ModuleIdentification saId = new ModuleIdentification(null, saGuid, saVersion);\r
 \r
             saId.setPackage(pkgId);\r
 \r
@@ -1342,21 +1340,24 @@ public class SurfaceAreaQuery {
             // Create FpdModule Identification which have class member of module\r
             // identification\r
             //\r
-            if (arch != null) {\r
-                String[] archList = arch.split(" ");\r
-                for (int j = 0; j < archList.length; j++) {\r
-                    FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId,    archList[j]);\r
-        \r
-                    if (fvBinding != null) {\r
-                        fpdSaId.setFvBinding(fvBinding);\r
-                    }\r
-        \r
-                    //\r
-                    // Put element to Map<FpdModuleIdentification, Map<String,\r
-                    // Object>>.\r
-                    //\r
-                    fpdModuleMap.put(fpdSaId, ObjectMap);\r
+            String[] archList = new String[0];\r
+            if (arch == null || arch.trim().length() == 0) {\r
+                archList = GlobalData.getToolChainInfo().getArchs();\r
+            } else {\r
+                archList = arch.split(" ");\r
+            }\r
+            for (int j = 0; j < archList.length; j++) {\r
+                FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);\r
+    \r
+                if (fvBinding != null) {\r
+                    fpdSaId.setFvBinding(fvBinding);\r
                 }\r
+    \r
+                //\r
+                // Put element to Map<FpdModuleIdentification, Map<String,\r
+                // Object>>.\r
+                //\r
+                fpdModuleMap.put(fpdSaId, ObjectMap);\r
             }\r
         }\r
         return fpdModuleMap;\r
@@ -1419,7 +1420,7 @@ public class SurfaceAreaQuery {
      */\r
     public static String[][] getFpdOptions(String fvName) {\r
            String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Options' and ./FvImageNames='"\r
-                      + fvName.toUpperCase() + "']/FvImageOptions" };\r
+                      + fvName + "']/FvImageOptions" };\r
            Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
            if (queryResult == null) {\r
                  return new String[0][];\r
@@ -1487,7 +1488,7 @@ public class SurfaceAreaQuery {
      */\r
     public static String[][] getFpdAttributes(String fvName) {\r
         String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Attributes' and ./FvImageNames='"\r
-                         + fvName.toUpperCase() + "']/FvImageOptions" };\r
+                         + fvName + "']/FvImageOptions" };\r
         Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
         if (queryResult == null) {\r
              return new String[0][];\r
@@ -1557,7 +1558,7 @@ public class SurfaceAreaQuery {
      * @returns empty list if nothing is there\r
      */\r
     public static String[][] getFpdComponents(String fvName) {\r
-        String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Components' and ./FvImageNames='"+ fvName.toUpperCase() + "']/FvImageOptions" };\r
+        String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Components' and ./FvImageNames='"+ fvName + "']/FvImageOptions" };\r
         Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
         if (queryResult == null) {\r
             return new String[0][];\r
@@ -1918,9 +1919,6 @@ public class SurfaceAreaQuery {
     }\r
 \r
        public static boolean isHaveTianoR8FlashMap(){\r
-        PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries  = null;\r
-        String[]            results;\r
-        int                 index;\r
         String[]            xPath       = new String[] {"/"};\r
         Object[]         returns     = get ("Externs", xPath);\r
 \r