If "SupArchList" is defined for a PCD in MSA, should check current arch is in the...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Dec 2006 09:21:54 +0000 (09:21 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 25 Dec 2006 09:21:54 +0000 (09:21 +0000)
If not exist in the range, do not autogen for that PCD. If exist, autogen it.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2136 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java

index 68254e2..f1f0fc0 100644 (file)
@@ -668,7 +668,7 @@ public class AutoGen {
         this.myPcdAutogen = new PCDAutoGenAction(moduleId,\r
                                                  arch,\r
                                                  true,\r
-                                                 saq.getModulePcdEntryNameArray(),\r
+                                                 saq.getModulePcdEntryNameArray(this.arch),\r
                                                  pcdDriverType, \r
                                                  parentId);\r
         this.myPcdAutogen.execute();\r
index b6cb329..17f7541 100644 (file)
@@ -1947,30 +1947,56 @@ public class SurfaceAreaQuery {
         return new ModuleSADocument.ModuleSA[0];\r
 \r
     }\r
\r
     /**\r
-    Get name array of PCD in a module. In one module, token space\r
-    is same, and token name should not be conflicted.\r
-\r
-    @return String[]\r
+       Get name array who contains all PCDs in a module according to specified arch.\r
+       \r
+       @param arch          The specified architecture type.\r
+       \r
+       @return String[]     return all PCDs name into array, if no any PCD used by\r
+                            this module, a String[0] array is returned.\r
     **/\r
-    public String[] getModulePcdEntryNameArray() {\r
+    public String[] getModulePcdEntryNameArray(String arch) {\r
         PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries  = null;\r
-        String[]            results;\r
-        int                 index;\r
-        String[]            xPath       = new String[] {"/PcdEntry"};\r
-        Object[]         returns     = get ("PcdCoded", xPath);\r
+        java.util.List                       archList    = null;\r
+        java.util.List<String>               results     = new java.util.ArrayList<String> ();\r
+        int                                  index;\r
+        String[]                             xPath       = new String[] {"/PcdEntry"};\r
+        Object[]                             returns     = get ("PcdCoded", xPath);\r
 \r
         if (returns == null) {\r
             return new String[0];\r
         }\r
 \r
-        pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;\r
-        results    = new String[pcdEntries.length];\r
+        pcdEntries  = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;\r
 \r
         for (index = 0; index < pcdEntries.length; index ++) {\r
-            results[index] = pcdEntries[index].getCName();\r
+            archList        = pcdEntries[index].getSupArchList();\r
+            //\r
+            // If the ArchList is specified in MSA for this PCD, need check\r
+            // current arch whether can support by this PCD.\r
+            // \r
+            if (archList != null) {\r
+                if (archList.contains(arch)) {\r
+                    results.add(new String(pcdEntries[index].getCName()));\r
+                }\r
+            } else {\r
+                //\r
+                // If no ArchList is specificied in MSA for this PCD, that means\r
+                // this PCD support all architectures.\r
+                // \r
+                results.add(new String(pcdEntries[index].getCName()));\r
+            }\r
         }\r
-        return results;\r
+\r
+        if (results.size() == 0) {\r
+            return new String[0];\r
+        }\r
+\r
+        String[]    retArray = new String[results.size()];\r
+        results.toArray(retArray);\r
+\r
+        return retArray;        \r
     }\r
 \r
     /**\r