X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fglobal%2FSurfaceAreaQuery.java;h=78bea2a43492777e2a827c77d171e51348c21dd0;hp=b6cb329672bf0949d7e311cf42f880f13c5fdb49;hb=700279a971c1f603a72a45455be4b4f842ce39d9;hpb=e425f0733437eb9297b84611e91e97ae41bbf270 diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java index b6cb329672..78bea2a434 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java @@ -38,6 +38,7 @@ import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.id.PlatformIdentification; import org.tianocore.build.toolchain.ToolChainInfo; import org.tianocore.common.exception.EdkException; +import org.tianocore.common.definitions.EdkDefinitions; import org.w3c.dom.Node; /** @@ -593,7 +594,7 @@ public class SurfaceAreaQuery { * xpath * @returns null if nothing is there */ - public String[] getLibraryClasses(String usage, String arch) { + public String[] getLibraryClasses(String usage, String arch, String moduleType) { String[] xPath; if (usage == null || usage.equals("")) { xPath = new String[] { "/LibraryClass" }; @@ -610,8 +611,10 @@ public class SurfaceAreaQuery { List libraryClassName = new ArrayList(); for (int i = 0; i < libraryClassList.length; i++) { List archList = libraryClassList[i].getSupArchList(); - - if (arch == null || contains(archList, arch)) { + List moduleTypeList = libraryClassList[i].getSupModuleList(); + if ((arch == null || contains(archList, arch)) + && (moduleType == null || contains(moduleTypeList, moduleType) + || contains(moduleTypeList, EdkDefinitions.MODULE_TYPE_BASE))) { libraryClassName.add(libraryClassList[i].getKeyword()); } } @@ -1947,30 +1950,56 @@ public class SurfaceAreaQuery { return new ModuleSADocument.ModuleSA[0]; } + /** - Get name array of PCD in a module. In one module, token space - is same, and token name should not be conflicted. - - @return String[] + Get name array who contains all PCDs in a module according to specified arch. + + @param arch The specified architecture type. + + @return String[] return all PCDs name into array, if no any PCD used by + this module, a String[0] array is returned. **/ - public String[] getModulePcdEntryNameArray() { + public String[] getModulePcdEntryNameArray(String arch) { PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null; - String[] results; - int index; - String[] xPath = new String[] {"/PcdEntry"}; - Object[] returns = get ("PcdCoded", xPath); + java.util.List archList = null; + java.util.List results = new java.util.ArrayList (); + int index; + String[] xPath = new String[] {"/PcdEntry"}; + Object[] returns = get ("PcdCoded", xPath); if (returns == null) { return new String[0]; } - pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns; - results = new String[pcdEntries.length]; + pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns; for (index = 0; index < pcdEntries.length; index ++) { - results[index] = pcdEntries[index].getCName(); + archList = pcdEntries[index].getSupArchList(); + // + // If the ArchList is specified in MSA for this PCD, need check + // current arch whether can support by this PCD. + // + if (archList != null) { + if (archList.contains(arch)) { + results.add(new String(pcdEntries[index].getCName())); + } + } else { + // + // If no ArchList is specificied in MSA for this PCD, that means + // this PCD support all architectures. + // + results.add(new String(pcdEntries[index].getCName())); + } } - return results; + + if (results.size() == 0) { + return new String[0]; + } + + String[] retArray = new String[results.size()]; + results.toArray(retArray); + + return retArray; } /** @@ -1982,15 +2011,8 @@ public class SurfaceAreaQuery { if (list == null || list.size()== 0) { return true; } - Iterator it = list.iterator(); - while (it.hasNext()) { - String s = (String)it.next(); - if (s.equalsIgnoreCase(str)) { - return true; - } - } - return false; + return list.contains(str); } public boolean isHaveTianoR8FlashMap(){