///\r
public static final String[][] sectionExt = EdkDefinitions.SectionTypeExtensions;\r
\r
+ private SurfaceAreaQuery saq = null;\r
+ \r
+ public FfsProcess(SurfaceAreaQuery saq) {\r
+ this.saq = saq;\r
+ }\r
+ \r
/**\r
search in the type, if componentType is listed in type, return true; \r
otherwise return false.\r
//\r
// Try to find Ffs layout from FPD file\r
//\r
- SurfaceAreaQuery.push(GlobalData.getFpdBuildOptions());\r
- BuildOptionsDocument.BuildOptions.Ffs[] ffsArray = SurfaceAreaQuery.getFpdFfs();\r
- SurfaceAreaQuery.pop();\r
+ saq.push(GlobalData.getFpdBuildOptions());\r
+ BuildOptionsDocument.BuildOptions.Ffs[] ffsArray = saq.getFpdFfs();\r
+ saq.pop();\r
for (int i = 0; i < ffsArray.length; i++) {\r
if (isMatch(ffsArray[i].getFfsKey(), buildType)) {\r
ffsXmlObject = ffsArray[i];\r
private Vector<Property> properties = new Vector<Property>();\r
\r
private boolean isSingleModuleBuild = false;\r
+ \r
+ private SurfaceAreaQuery saq = null;\r
\r
/**\r
Public construct method. It is necessary for ANT task.\r
moduleId = new ModuleIdentification(moduleGuid, moduleVersion);\r
moduleId.setPackage(packageId);\r
Map<String, XmlObject> doc = GlobalData.getNativeMsa(moduleId);\r
- SurfaceAreaQuery.setDoc(doc);\r
- moduleId = SurfaceAreaQuery.getMsaHeader();\r
+ saq = new SurfaceAreaQuery(doc);\r
+ moduleId = saq.getMsaHeader();\r
} else {\r
Map<String, XmlObject> doc = GlobalData.getNativeMsa(msaFile);\r
- SurfaceAreaQuery.setDoc(doc);\r
- moduleId = SurfaceAreaQuery.getMsaHeader();\r
+ saq = new SurfaceAreaQuery(doc);\r
+ moduleId = saq.getMsaHeader();\r
}\r
- String[] producedLibraryClasses = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED",null);\r
+ String[] producedLibraryClasses = saq.getLibraryClasses("ALWAYS_PRODUCED",null);\r
if (producedLibraryClasses.length == 0) {\r
moduleId.setLibrary(false);\r
} else {\r
//\r
// Judge if arch is all supported by current module. If not, throw Exception.\r
//\r
- List moduleSupportedArchs = SurfaceAreaQuery.getModuleSupportedArchs();\r
+ List moduleSupportedArchs = saq.getModuleSupportedArchs();\r
if (moduleSupportedArchs != null) {\r
for (int k = 0; k < archList.length; k++) {\r
if ( ! moduleSupportedArchs.contains(archList[k])) {\r
\r
System.out.println("Build " + moduleId + " start >>>");\r
System.out.println("Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);\r
- SurfaceAreaQuery.setDoc(GlobalData.getDoc(fpdModuleId));\r
+ saq.push(GlobalData.getDoc(fpdModuleId));\r
\r
//\r
// Prepare for all other common properties\r
// MODULE_DIR, MODULE_RELATIVE_DIR\r
//\r
PropertyManager.setProperty("MODULE", moduleId.getName());\r
- String baseName = SurfaceAreaQuery.getModuleOutputFileBasename();\r
+ String baseName = saq.getModuleOutputFileBasename();\r
if (baseName == null) {\r
PropertyManager.setProperty("BASE_NAME", moduleId.getName());\r
} else {\r
\r
private void applyBuild(String buildTarget, String buildTagname, FpdModuleIdentification fpdModuleId) throws BuildException{\r
//\r
- // AutoGen\r
+ // Call AutoGen to generate AutoGen.c and AutoGen.h\r
//\r
-\r
- AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch());\r
+ AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch(), saq);\r
autogen.genAutogen();\r
\r
-\r
//\r
// Get compiler flags\r
//\r
//\r
// Prepare LIBS\r
//\r
- ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
+ ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());\r
String propertyLibs = "";\r
for (int i = 0; i < libinstances.length; i++) {\r
propertyLibs += " " + getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib";\r
// Generate ${BASE_NAME}_build.xml\r
// TBD\r
//\r
- String ffsKeyword = SurfaceAreaQuery.getModuleFfsKeyword();\r
- ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId, includes);\r
+ String ffsKeyword = saq.getModuleFfsKeyword();\r
+ ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId, includes, saq);\r
String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
fileGenerator.genBuildFile(buildFilename);\r
\r
//\r
// Packages in PackageDenpendencies\r
//\r
- PackageIdentification[] packageDependencies = SurfaceAreaQuery.getDependencePkg(fpdModuleId.getArch());\r
+ PackageIdentification[] packageDependencies = saq.getDependencePkg(fpdModuleId.getArch());\r
for (int i = 0; i < packageDependencies.length; i++) {\r
GlobalData.refreshPackageIdentification(packageDependencies[i]);\r
File packageFile = packageDependencies[i].getSpdFile();\r
//\r
// All Dependency Library Instance's PackageDependencies\r
//\r
- ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
+ ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());\r
for (int i = 0; i < libinstances.length; i++) {\r
- SurfaceAreaQuery.push(GlobalData.getDoc(libinstances[i], fpdModuleId.getArch()));\r
- PackageIdentification[] libraryPackageDependencies = SurfaceAreaQuery.getDependencePkg(fpdModuleId.getArch());\r
+ saq.push(GlobalData.getDoc(libinstances[i], fpdModuleId.getArch()));\r
+ PackageIdentification[] libraryPackageDependencies = saq.getDependencePkg(fpdModuleId.getArch());\r
for (int j = 0; j < libraryPackageDependencies.length; j++) {\r
GlobalData.refreshPackageIdentification(libraryPackageDependencies[j]);\r
File packageFile = libraryPackageDependencies[j].getSpdFile();\r
includes.add(packageFile.getParent() + File.separatorChar + "Include");\r
includes.add(packageFile.getParent() + File.separatorChar + "Include" + File.separatorChar + archDir(arch));\r
}\r
- SurfaceAreaQuery.pop();\r
+ saq.pop();\r
}\r
\r
\r
\r
private String[] includes;\r
\r
- public ModuleBuildFileGenerator(Project project, String ffsKeyword, FpdModuleIdentification fpdModuleId, String[] includes) {\r
+ private SurfaceAreaQuery saq = null;\r
+ \r
+ public ModuleBuildFileGenerator(Project project, String ffsKeyword, FpdModuleIdentification fpdModuleId, String[] includes, SurfaceAreaQuery saq) {\r
this.project = project;\r
this.fpdModuleId = fpdModuleId;\r
this.ffsKeyword = ffsKeyword;\r
this.includes = includes;\r
+ this.saq = saq;\r
}\r
\r
/**\r
Error throws during BaseName_build.xml generating. \r
**/\r
public void genBuildFile(String buildFilename) throws BuildException {\r
- FfsProcess fp = new FfsProcess();\r
+ FfsProcess fp = new FfsProcess(saq);\r
DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();\r
try {\r
DocumentBuilder dombuilder = domfac.newDocumentBuilder();\r
@param root Root element for current\r
**/\r
private void applyLibraryInstance(Document document, Node root) {\r
- ModuleIdentification[] libinstances = SurfaceAreaQuery.getLibraryInstance(fpdModuleId.getArch());\r
+ ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());\r
for (int i = 0; i < libinstances.length; i++) {\r
//\r
// Put package file path to module identification\r
//\r
// sourceFiles[][0] is FileType, [][1] is File name relative to Module_Dir\r
//\r
- String[][] sourceFiles = SurfaceAreaQuery.getSourceFiles(fpdModuleId.getArch());\r
+ String[][] sourceFiles = saq.getSourceFiles(fpdModuleId.getArch());\r
\r
FileProcess fileProcess = new FileProcess();\r
fileProcess.init(project, includes, document);\r
private List<String> setVirtalAddList = new ArrayList<String>();\r
private List<String> exitBootServiceList = new ArrayList<String>();\r
\r
+ private SurfaceAreaQuery saq = null;\r
\r
/**\r
Construct function\r
@param arch\r
Target architecture.\r
**/\r
- public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch) {\r
+ public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch, SurfaceAreaQuery saq) {\r
this.outputPath = outputPath;\r
this.moduleId = moduleId;\r
this.arch = arch;\r
this.fvDir = fvDir;\r
-\r
+ this.saq = saq;\r
}\r
\r
/**\r
// be got from module surface area instead of hard code by it's\r
// moduleType.\r
//\r
- moduleType = SurfaceAreaQuery.getModuleType();\r
+ moduleType = saq.getModuleType();\r
\r
//\r
// Add "extern int __make_me_compile_correctly;" at begin of\r
//\r
// Put EFI_SPECIFICATION_VERSION, and EDK_RELEASE_VERSION.\r
//\r
- String[] specList = SurfaceAreaQuery.getExternSpecificaiton();\r
+ String[] specList = saq.getExternSpecificaiton();\r
for (int i = 0; i < specList.length; i++) {\r
fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
+ "\r\n");\r
//\r
// PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery\r
// .getDependencePkg(this.arch);\r
- PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery\r
- .getDependencePkg(this.arch);\r
+ PackageIdentification[] consumedPkgIdList = saq.getDependencePkg(this.arch);\r
if (consumedPkgIdList != null) {\r
headerFileList = depPkgToAutogenH(consumedPkgIdList, moduleType);\r
item = headerFileList.iterator();\r
//\r
// Write library class's related *.h file to autogen.h.\r
//\r
- String[] libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.ALWAYSCONSUMED,this.arch);\r
+ String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED,this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
}\r
}\r
\r
- libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
+ libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
//\r
- if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
+ if (saq.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.INCLUDE);\r
fileBuffer.append(" <");\r
fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
// process <Externs> it should be set the DOC as the Native MSA info.\r
//\r
Map<String, XmlObject> doc = GlobalData.getNativeMsa(this.moduleId);\r
- SurfaceAreaQuery.push(doc);\r
+ saq.push(doc);\r
//\r
// Write <Extern>\r
// DriverBinding/ComponentName/DriverConfiguration/DriverDialog\r
//\r
// Write EntryPoint to autgoGen.c\r
//\r
- String[] entryPointList = SurfaceAreaQuery.getModuleEntryPointArray();\r
- String[] unloadImageList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
+ String[] entryPointList = saq.getModuleEntryPointArray();\r
+ String[] unloadImageList = saq.getModuleUnloadImageArray();\r
EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList), \r
CommonDefinition.remDupString(unloadImageList),\r
fileBuffer);\r
\r
- pcdDriverType = SurfaceAreaQuery.getPcdDriverType();\r
+ pcdDriverType = saq.getPcdDriverType();\r
\r
//\r
// Restore the DOC which include the FPD module info.\r
//\r
- SurfaceAreaQuery.pop();\r
+ saq.pop();\r
\r
//\r
// Write Guid to autogen.c\r
//\r
- String guid = CommonDefinition.formatGuidName(SurfaceAreaQuery\r
- .getModuleGuid());\r
+ String guid = CommonDefinition.formatGuidName(saq.getModuleGuid());\r
\r
fileBuffer\r
.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");\r
//\r
// Get module dependent Package identification.\r
//\r
- PackageIdentification[] packages = SurfaceAreaQuery.getDependencePkg(this.arch);\r
+ PackageIdentification[] packages = saq.getDependencePkg(this.arch);\r
for (int i = 0; i < packages.length; i++) {\r
if (!this.mDepPkgList.contains(packages[i])) {\r
this.mDepPkgList.add(packages[i]);\r
// be get from module surface area instead of hard code.\r
//\r
fileBuffer.append(CommonDefinition.AUTOGENHBEGIN);\r
- String[] specList = SurfaceAreaQuery.getExternSpecificaiton();\r
+ String[] specList = saq.getExternSpecificaiton();\r
for (int i = 0; i < specList.length; i++) {\r
fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
+ "\r\n");\r
//\r
// Write consumed package's mdouleInfo related *.h file to autogen.h.\r
//\r
- moduleType = SurfaceAreaQuery.getModuleType();\r
- PackageIdentification[] cosumedPkglist = SurfaceAreaQuery\r
+ moduleType = saq.getModuleType();\r
+ PackageIdentification[] cosumedPkglist = saq\r
.getDependencePkg(this.arch);\r
headerFileList = depPkgToAutogenH(cosumedPkglist, moduleType);\r
item = headerFileList.iterator();\r
//\r
// Write library class's related *.h file to autogen.h\r
//\r
- String[] libClassList = SurfaceAreaQuery\r
+ String[] libClassList = saq\r
.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
}\r
}\r
\r
- libClassList = SurfaceAreaQuery\r
+ libClassList = saq\r
.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
//\r
- if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
+ if (saq.isHaveTianoR8FlashMap()) {\r
fileBuffer.append(CommonDefinition.INCLUDE);\r
fileBuffer.append(" <");\r
fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
this.myPcdAutogen = new PCDAutoGenAction(moduleId,\r
arch,\r
true,\r
- SurfaceAreaQuery.getModulePcdEntryNameArray(),\r
+ saq.getModulePcdEntryNameArray(),\r
pcdDriverType);\r
try {\r
this.myPcdAutogen.execute();\r
//\r
for (int i = 0; i < libClassList.length; i++) {\r
includeName = GlobalData.getLibraryClassHeaderFiles(\r
- SurfaceAreaQuery.getDependencePkg(this.arch),\r
+ saq.getDependencePkg(this.arch),\r
libClassList[i]);\r
if (includeName == null) {\r
throw new AutoGenException("Can not find library class ["\r
void EntryPointToAutoGen(String[] entryPointList, String[] unloadImageList, StringBuffer fileBuffer)\r
throws BuildException {\r
\r
- String typeStr = SurfaceAreaQuery.getModuleType();\r
+ String typeStr = saq.getModuleType();\r
int unloadImageCount = 0;\r
int entryPointCount = 0;\r
\r
// then add those PPI ,and PPI Notify name to list.\r
//\r
\r
- String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
+ String[] ppiList = saq.getPpiArray(this.arch);\r
for (int i = 0; i < ppiList.length; i++) {\r
this.mPpiList.add(ppiList[i]);\r
}\r
\r
- String[] ppiNotifyList = SurfaceAreaQuery.getPpiNotifyArray(this.arch);\r
+ String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch);\r
for (int i = 0; i < ppiNotifyList.length; i++) {\r
this.mPpiList.add(ppiNotifyList[i]);\r
}\r
void ProtocolGuidToAutogenC(StringBuffer fileBuffer) throws BuildException {\r
String[] cNameGuid = null;\r
\r
- String[] protocolList = SurfaceAreaQuery.getProtocolArray(this.arch);\r
+ String[] protocolList = saq.getProtocolArray(this.arch);\r
\r
//\r
// Add result to Autogen global list.\r
this.mProtocolList.add(protocolList[i]);\r
}\r
\r
- String[] protocolNotifyList = SurfaceAreaQuery\r
+ String[] protocolNotifyList = saq\r
.getProtocolNotifyArray(this.arch);\r
\r
for (int i = 0; i < protocolNotifyList.length; i++) {\r
String[] cNameGuid = null;\r
String guidKeyWord = null;\r
\r
- String[] guidList = SurfaceAreaQuery.getGuidEntryArray(this.arch);\r
+ String[] guidList = saq.getGuidEntryArray(this.arch);\r
\r
for (int i = 0; i < guidList.length; i++) {\r
this.mGuidList.add(guidList[i]);\r
// 3.DRIVER_CONFIGURATION 4. DRIVER_DIAGNOSTIC\r
//\r
\r
- String[] drvBindList = SurfaceAreaQuery.getDriverBindingArray();\r
+ String[] drvBindList = saq.getDriverBindingArray();\r
\r
//\r
// If component name protocol,component configuration protocol,\r
return;\r
}\r
\r
- String[] compNamList = SurfaceAreaQuery.getComponentNameArray();\r
- String[] compConfList = SurfaceAreaQuery.getDriverConfigArray();\r
- String[] compDiagList = SurfaceAreaQuery.getDriverDiagArray();\r
+ String[] compNamList = saq.getComponentNameArray();\r
+ String[] compConfList = saq.getDriverConfigArray();\r
+ String[] compDiagList = saq.getDriverDiagArray();\r
\r
int BitMask = 0;\r
\r
// <ExitBootServiceCallBack> and add to setVirtualAddList\r
// exitBootServiceList.\r
//\r
- String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
- String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
+ String[] setVirtuals = saq.getSetVirtualAddressMapCallBackArray();\r
+ String[] exitBoots = saq.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
for (int j = 0; j < setVirtuals.length; j++) {\r
this.setVirtalAddList.add(setVirtuals[j]);\r
String[] setVirtuals = null;\r
String[] exitBoots = null;\r
\r
- ModuleIdentification[] libraryIdList = SurfaceAreaQuery\r
- .getLibraryInstance(this.arch);\r
+ ModuleIdentification[] libraryIdList = saq.getLibraryInstance(this.arch);\r
try {\r
if (libraryIdList != null) {\r
//\r
//\r
\r
Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstanceId, this.arch);\r
- SurfaceAreaQuery.push(libDoc);\r
+ saq.push(libDoc);\r
//\r
// Get <PPis>, <Protocols>, <Guids> list of this library\r
// instance.\r
//\r
- String[] ppiList = SurfaceAreaQuery.getPpiArray(this.arch);\r
- String[] ppiNotifyList = SurfaceAreaQuery\r
- .getPpiNotifyArray(this.arch);\r
- String[] protocolList = SurfaceAreaQuery\r
- .getProtocolArray(this.arch);\r
- String[] protocolNotifyList = SurfaceAreaQuery\r
- .getProtocolNotifyArray(this.arch);\r
- String[] guidList = SurfaceAreaQuery\r
- .getGuidEntryArray(this.arch);\r
- PackageIdentification[] pkgList = SurfaceAreaQuery.getDependencePkg(this.arch);\r
+ String[] ppiList = saq.getPpiArray(this.arch);\r
+ String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch);\r
+ String[] protocolList = saq.getProtocolArray(this.arch);\r
+ String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch);\r
+ String[] guidList = saq.getGuidEntryArray(this.arch);\r
+ PackageIdentification[] pkgList = saq.getDependencePkg(this.arch);\r
\r
//\r
// Add those ppi, protocol, guid in global ppi,\r
// If not yet parse this library instance's constructor\r
// element,parse it.\r
//\r
- libConstructName = SurfaceAreaQuery\r
- .getLibConstructorName();\r
- libDestructName = SurfaceAreaQuery\r
- .getLibDestructorName();\r
+ libConstructName = saq.getLibConstructorName();\r
+ libDestructName = saq.getLibDestructorName();\r
\r
//\r
// Collect SetVirtualAddressMapCallBack and\r
// ExitBootServiceCallBack.\r
//\r
- setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
- exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
+ setVirtuals = saq.getSetVirtualAddressMapCallBackArray();\r
+ exitBoots = saq.getExitBootServicesCallBackArray();\r
if (setVirtuals != null) {\r
for (int j = 0; j < setVirtuals.length; j++) {\r
this.setVirtalAddList.add(setVirtuals[j]);\r
this.exitBootServiceList.add(exitBoots[k]);\r
}\r
}\r
- SurfaceAreaQuery.pop();\r
+ saq.pop();\r
//\r
// Add dependent library instance constructor function.\r
//\r
// Add libraryInstance in to libInstanceList.\r
// \r
Map<String, XmlObject> libDoc = GlobalData.getDoc(libraryList[i], arch);\r
- SurfaceAreaQuery.push(libDoc);\r
- libInstanceNode = new LibraryInstanceNode (libraryList[i],SurfaceAreaQuery.getLibConstructorName(), SurfaceAreaQuery.getLibDestructorName());\r
+ SurfaceAreaQuery saq = new SurfaceAreaQuery(libDoc);\r
+ libInstanceNode = new LibraryInstanceNode (libraryList[i],saq.getLibConstructorName(), saq.getLibDestructorName());\r
libInstanceList.add(libInstanceNode);\r
\r
//\r
// Add library instance and consumed library class list to\r
// libInstanceMap.\r
//\r
- libClassConsmList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, arch);\r
+ libClassConsmList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, arch);\r
if (libClassConsmList != null) {\r
String[] classStr = new String[libClassConsmList.length];\r
for (int k = 0; k < libClassConsmList.length; k++) {\r
//\r
// Add library class and library instance map.\r
//\r
- libClassDeclList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, arch);\r
+ libClassDeclList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, arch);\r
if (libClassDeclList != null) {\r
for (int j = 0; j < libClassDeclList.length; j++) {\r
if (this.libClassMap.containsKey(libClassDeclList[j])) {\r
}\r
}\r
}\r
- SurfaceAreaQuery.pop();\r
}\r
\r
//\r
///\r
private Vector<Property> properties = new Vector<Property>();\r
\r
+ SurfaceAreaQuery saq = null;\r
+ \r
private boolean isUnified = true;\r
\r
/**\r
//\r
// Gen build.xml\r
//\r
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified);\r
+ PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq);\r
fileGenerator.genBuildFile();\r
\r
//\r
File write FV.inf files error.\r
**/\r
private void genFvInfFiles(String ffsCommonDir) throws BuildException {\r
- String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
+ String[] validFv = saq.getFpdValidImageNames();\r
for (int i = 0; i < validFv.length; i++) {\r
//\r
// Get all global variables from FPD and set them to properties\r
//\r
- String[][] globalVariables = SurfaceAreaQuery.getFpdGlobalVariable();\r
+ String[][] globalVariables = saq.getFpdGlobalVariable();\r
for (int j = 0; j < globalVariables.length; j++) {\r
getProject().setProperty(globalVariables[j][0], globalVariables[j][1]);\r
}\r
//\r
// Options\r
//\r
- String[][] options = SurfaceAreaQuery.getFpdOptions(validFv[i]);\r
+ String[][] options = saq.getFpdOptions(validFv[i]);\r
if (options.length > 0) {\r
bw.write("[options]");\r
bw.newLine();\r
//\r
// Attributes;\r
//\r
- String[][] attributes = SurfaceAreaQuery.getFpdAttributes(validFv[i]);\r
+ String[][] attributes = saq.getFpdAttributes(validFv[i]);\r
if (attributes.length > 0) {\r
bw.write("[attributes]");\r
bw.newLine();\r
//\r
// Components\r
//\r
- String[][] components = SurfaceAreaQuery.getFpdComponents(validFv[i]);\r
+ String[][] components = saq.getFpdComponents(validFv[i]);\r
if (components.length > 0) {\r
bw.write("[components]");\r
bw.newLine();\r
\r
Map<String, XmlObject> map = new HashMap<String, XmlObject>();\r
map.put("PlatformSurfaceArea", doc);\r
- SurfaceAreaQuery.setDoc(map);\r
+ saq = new SurfaceAreaQuery(map);\r
\r
//\r
// Initialize\r
//\r
- platformId = SurfaceAreaQuery.getFpdHeader();\r
+ platformId = saq.getFpdHeader();\r
platformId.setFpdFile(fpdFile);\r
getProject().setProperty("PLATFORM", platformId.getName());\r
getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));\r
//\r
// Build mode. User-defined output dir.\r
//\r
- String buildMode = SurfaceAreaQuery.getFpdIntermediateDirectories();\r
- String userDefinedOutputDir = SurfaceAreaQuery.getFpdOutputDirectory();\r
+ String buildMode = saq.getFpdIntermediateDirectories();\r
+ String userDefinedOutputDir = saq.getFpdOutputDirectory();\r
\r
OutputManager.getInstance().setup(userDefinedOutputDir, buildMode);\r
\r
//\r
// TBD. Deal PCD and BuildOption related Info\r
//\r
- GlobalData.setFpdBuildOptions(SurfaceAreaQuery.getFpdBuildOptions());\r
+ GlobalData.setFpdBuildOptions(saq.getFpdBuildOptions());\r
\r
- GlobalData.setToolChainPlatformInfo(SurfaceAreaQuery.getFpdToolChainInfo());\r
+ GlobalData.setToolChainPlatformInfo(saq.getFpdToolChainInfo());\r
\r
//\r
// Parse all list modules SA\r
parseToolChainFamilyOptions();\r
parseToolChainOptions();\r
\r
- SurfaceAreaQuery.setDoc(map);\r
+ saq.push(map);\r
\r
//\r
// Pcd Collection. Call CollectPCDAction to collect pcd info.\r
Parse all modules listed in FPD file.\r
**/\r
private void parseModuleSAFiles() throws EdkException{\r
- Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = SurfaceAreaQuery.getFpdModules();\r
+ Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = saq.getFpdModules();\r
\r
//\r
// For every Module lists in FPD file.\r
//\r
// Put fpdModuleId to the corresponding FV\r
//\r
- SurfaceAreaQuery.push(GlobalData.getDoc(fpdModuleId));\r
- String fvBinding = SurfaceAreaQuery.getModuleFvBindingKeyword();\r
+ saq.push(GlobalData.getDoc(fpdModuleId));\r
+ String fvBinding = saq.getModuleFvBindingKeyword();\r
\r
fpdModuleId.setFvBinding(fvBinding);\r
updateFvs(fvBinding, fpdModuleId);\r
//\r
ModuleIdentification moduleId = fpdModuleId.getModule();\r
\r
- String baseName = SurfaceAreaQuery.getModuleOutputFileBasename();\r
+ String baseName = saq.getModuleOutputFileBasename();\r
\r
if (baseName == null) {\r
baseName = moduleId.getName();\r
//\r
GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));\r
GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));\r
- SurfaceAreaQuery.pop();\r
+ saq.pop();\r
}\r
}\r
\r
private ToolChainMap parseModuleBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
- String[][] options = SurfaceAreaQuery.getModuleBuildOptions(toolChainFamilyFlag);\r
+ String[][] options = saq.getModuleBuildOptions(toolChainFamilyFlag);\r
if (options == null || options.length == 0) {\r
return new ToolChainMap();\r
}\r
}\r
\r
private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {\r
- String[][] options = SurfaceAreaQuery.getPlatformBuildOptions(toolChainFamilyFlag);\r
+ String[][] options = saq.getPlatformBuildOptions(toolChainFamilyFlag);\r
if (options == null || options.length == 0) {\r
return new ToolChainMap();\r
}\r
\r
private boolean isUnified = true;\r
\r
+ private SurfaceAreaQuery saq = null;\r
+ \r
private Project project;\r
\r
private String info = "DO NOT EDIT \n" \r
+ "Abstract:\n"\r
+ "Auto-generated ANT build file for building EFI Modules and Platforms\n";\r
\r
- public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified){\r
+ public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq){\r
this.project = project;\r
this.outfiles = outfiles;\r
this.isUnified = isUnified;\r
this.fvs = fvs;\r
+ this.saq = saq;\r
this.platformName = project.getProperty("PLATFORM");\r
}\r
\r
//\r
// Get all valid FV name\r
//\r
- String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
+ String[] validFv = saq.getFpdValidImageNames();\r
\r
//\r
// For each valid FV, get all modules in sequence\r
String fvOutputDir = project.getProperty("BUILD_DIR") + File.separatorChar \r
+ targetList[i] + "_" \r
+ toolchainList[j] + File.separatorChar + "FV";\r
- String[] validFv = SurfaceAreaQuery.getFpdValidImageNames();\r
+ String[] validFv = saq.getFpdValidImageNames();\r
for (int k = 0; k < validFv.length; k++) {\r
String inputFile = fvOutputDir + "" + File.separatorChar + validFv[k].toUpperCase() + ".inf";\r
Element fvEle = document.createElement("genfvimage");\r
Element ele = document.createElement("target");\r
ele.setAttribute("name", "prebuild");\r
\r
- Node node = SurfaceAreaQuery.getFpdUserExtensionPreBuild();\r
+ Node node = saq.getFpdUserExtensionPreBuild();\r
if (node != null) {\r
//\r
// For every Target and ToolChain\r
Element ele = document.createElement("target");\r
ele.setAttribute("name", "postbuild");\r
\r
- Node node = SurfaceAreaQuery.getFpdUserExtensionPostBuild();\r
+ Node node = saq.getFpdUserExtensionPostBuild();\r
if (node != null) {\r
//\r
// For every Target and ToolChain\r
List<DbPathAndFilename> packages = db.getFrameworkDatabase().getPackageList().getFilenameList();\r
Iterator<DbPathAndFilename> iter = packages.iterator();\r
while (iter.hasNext()) {\r
- String fileName = iter.next().getStringValue();\r
+ String fileName = iter.next().getStringValue().trim();\r
Spd spd = new Spd(new File(workspaceDir + File.separatorChar + fileName));\r
packageList.add(spd.getPackageId());\r
spdTable.put(spd.getPackageId(), spd);\r
List<DbPathAndFilename> platforms = db.getFrameworkDatabase().getPlatformList().getFilenameList();\r
Iterator<DbPathAndFilename> iter = platforms.iterator();\r
while (iter.hasNext()) {\r
- String fileName = iter.next().getStringValue();\r
+ String fileName = iter.next().getStringValue().trim();\r
File fpdFile = new File(workspaceDir + File.separatorChar + fileName);\r
if ( !fpdFile.exists() ) {\r
throw new BuildException("Platform file [" + fpdFile.getPath() + "] not exists. ");\r
//\r
Map<String, XmlObject> fpdDocMap = new HashMap<String, XmlObject>();\r
fpdDocMap.put("PlatformSurfaceArea", fpdDoc);\r
- SurfaceAreaQuery.setDoc(fpdDocMap);\r
- PlatformIdentification platformId = SurfaceAreaQuery.getFpdHeader();\r
+ SurfaceAreaQuery saq = new SurfaceAreaQuery(fpdDocMap);\r
+ PlatformIdentification platformId = saq.getFpdHeader();\r
platformId.setFpdFile(fpdFile);\r
platformList.add(platformId);\r
}\r
// We can change Map to XmlObject\r
Map<String, XmlObject> spdDocMap = new HashMap<String, XmlObject>();\r
spdDocMap.put("PackageSurfaceArea", spdDoc);\r
- SurfaceAreaQuery.setDoc(spdDocMap);\r
+ SurfaceAreaQuery saq = new SurfaceAreaQuery(spdDocMap);\r
//\r
//\r
//\r
- packageId = SurfaceAreaQuery.getSpdHeader();\r
+ packageId = saq.getSpdHeader();\r
packageId.setSpdFile(packageFile);\r
\r
//\r
// initialize Msa Files\r
// MSA file is absolute file path\r
//\r
- String[] msaFilenames = SurfaceAreaQuery.getSpdMsaFile();\r
+ String[] msaFilenames = saq.getSpdMsaFile();\r
for (int i = 0; i < msaFilenames.length; i++){\r
File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);\r
Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );\r
- SurfaceAreaQuery.push(msaDoc);\r
- ModuleIdentification moduleId = SurfaceAreaQuery.getMsaHeader();\r
- SurfaceAreaQuery.pop();\r
+ saq.push(msaDoc);\r
+ ModuleIdentification moduleId = saq.getMsaHeader();\r
+ saq.pop();\r
moduleId.setPackage(packageId);\r
moduleId.setMsaFile(msaFile);\r
if (msaInfo.containsKey(moduleId)) {\r
//\r
// initialize Package header files\r
//\r
- Map<String, String> packageHeaders = SurfaceAreaQuery.getSpdPackageHeaderFiles();\r
+ Map<String, String> packageHeaders = saq.getSpdPackageHeaderFiles();\r
Set keys = packageHeaders.keySet();\r
Iterator iter = keys.iterator();\r
while (iter.hasNext()){\r
//\r
// initialize Guid Info\r
//\r
- guidInfo.putAll(SurfaceAreaQuery.getSpdGuid());\r
+ guidInfo.putAll(saq.getSpdGuid());\r
\r
//\r
// For Pcd get TokenSpaceGuid\r
//\r
// initialize PPI info\r
//\r
- ppiInfo.putAll(SurfaceAreaQuery.getSpdPpi());\r
+ ppiInfo.putAll(saq.getSpdPpi());\r
\r
//\r
// initialize Protocol info\r
//\r
- protocolInfo.putAll(SurfaceAreaQuery.getSpdProtocol());\r
+ protocolInfo.putAll(saq.getSpdProtocol());\r
\r
//\r
// initialize library class declaration\r
//\r
- Map<String, String[]> libraryClassHeaders = SurfaceAreaQuery.getSpdLibraryClasses();\r
+ Map<String, String[]> libraryClassHeaders = saq.getSpdLibraryClasses();\r
keys = libraryClassHeaders.keySet();\r
iter = keys.iterator();\r
while (iter.hasNext()){\r
*/\r
public class SurfaceAreaQuery {\r
\r
- public static String prefix = "http://www.TianoCore.org/2006/Edk2.0";\r
+ public String prefix = "http://www.TianoCore.org/2006/Edk2.0";\r
\r
//\r
// Contains name/value pairs of Surface Area document object. The name is\r
// always the top level element name.\r
//\r
- private static Map<String, XmlObject> map = null;\r
+ private Map<String, XmlObject> map = null;\r
\r
//\r
// mapStack is used to do nested query\r
//\r
- private static Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();\r
+ private Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();\r
\r
//\r
// prefix of name space\r
//\r
- private static String nsPrefix = "sans";\r
+ private String nsPrefix = "sans";\r
\r
//\r
// xmlbeans needs a name space for each Xpath element\r
//\r
- private static String ns = null;\r
+ private String ns = null;\r
\r
//\r
// keep the namep declaration for xmlbeans Xpath query\r
//\r
- private static String queryDeclaration = null;\r
+ private String queryDeclaration = null;\r
\r
- private static StringBuffer normQueryString = new StringBuffer(4096);\r
- private static Pattern xPathPattern = Pattern.compile("([^/]*)(/|//)([^/]+)");\r
+ private StringBuffer normQueryString = new StringBuffer(4096);\r
+ private Pattern xPathPattern = Pattern.compile("([^/]*)(/|//)([^/]+)");\r
\r
/**\r
* Set a Surface Area document for query later\r
* A Surface Area document in TopLevelElementName/XmlObject\r
* format.\r
*/\r
- public static void setDoc(Map<String, XmlObject> map) {\r
+ public SurfaceAreaQuery(Map<String, XmlObject> map) {\r
ns = prefix;\r
queryDeclaration = "declare namespace " + nsPrefix + "='" + ns + "'; ";\r
- SurfaceAreaQuery.map = map;\r
+ this.map = map;\r
}\r
\r
/**\r
* The TopLevelElementName/XmlObject format of a Surface Area\r
* document.\r
*/\r
- public static void push(Map<String, XmlObject> newMap) {\r
- mapStack.push(SurfaceAreaQuery.map);\r
- SurfaceAreaQuery.map = newMap;\r
+ public void push(Map<String, XmlObject> newMap) {\r
+ mapStack.push(this.map);\r
+ this.map = newMap;\r
}\r
\r
/**\r
* Discard current used Surface Area document and use the top document in\r
* stack instead.\r
*/\r
- public static void pop() {\r
- SurfaceAreaQuery.map = mapStack.pop();\r
+ public void pop() {\r
+ this.map = mapStack.pop();\r
}\r
\r
// /\r
// / selectPath(). For example, converting /MsaHeader/ModuleType to\r
// / /ns:MsaHeader/ns:ModuleType\r
// /\r
- private static String normalizeQueryString(String[] exp, String from) {\r
+ private String normalizeQueryString(String[] exp, String from) {\r
normQueryString.setLength(0);\r
\r
int i = 0;\r
* xpath\r
* @returns NULL if nothing is at the specified xpath\r
*/\r
- public static Object[] get(String[] xPath) {\r
+ public Object[] get(String[] xPath) {\r
if (map == null) {\r
return null;\r
}\r
* @returns An array of XmlObject if elements are found at the given xpath\r
* @returns NULL if nothing is found at the given xpath\r
*/\r
- public static Object[] get(String rootName, String[] xPath) {\r
+ public Object[] get(String rootName, String[] xPath) {\r
if (map == null) {\r
return null;\r
}\r
* xpath\r
* @returns NULL if nothing is found at the known xpath\r
*/\r
- public static String[][] getSourceFiles(String arch) {\r
+ public String[][] getSourceFiles(String arch) {\r
String[] xPath;\r
Object[] returns;\r
\r
* @returns Directory names array if elements are found at the known xpath\r
* @returns Empty if nothing is found at the known xpath\r
*/\r
- public static String getFpdOutputDirectory() {\r
+ public String getFpdOutputDirectory() {\r
String[] xPath = new String[] { "/PlatformDefinitions" };\r
\r
Object[] returns = get("PlatformSurfaceArea", xPath);\r
return item.getOutputDirectory();\r
}\r
\r
- public static String getFpdIntermediateDirectories() {\r
+ public String getFpdIntermediateDirectories() {\r
String[] xPath = new String[] { "/PlatformDefinitions" };\r
\r
Object[] returns = get("PlatformSurfaceArea", xPath);\r
}\r
}\r
\r
- public static String getModuleFfsKeyword() {\r
+ public String getModuleFfsKeyword() {\r
String[] xPath = new String[] { "/" };\r
\r
Object[] returns = get("ModuleSaBuildOptions", xPath);\r
return item.getFfsFormatKey();\r
}\r
\r
- public static String getModuleFvBindingKeyword() {\r
+ public String getModuleFvBindingKeyword() {\r
String[] xPath = new String[] { "/" };\r
\r
Object[] returns = get("ModuleSaBuildOptions", xPath);\r
return item.getFvBinding();\r
}\r
\r
- public static List getModuleSupportedArchs() {\r
+ public List getModuleSupportedArchs() {\r
String[] xPath = new String[] { "/" };\r
\r
Object[] returns = get("ModuleDefinitions", xPath);\r
return item.getSupportedArchitectures();\r
}\r
\r
- public static BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {\r
+ public BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {\r
String[] xPath = new String[] {"/Ffs"};\r
\r
Object[] returns = get("BuildOptions", xPath);\r
return (BuildOptionsDocument.BuildOptions.Ffs[])returns;\r
}\r
\r
- public static String getModuleOutputFileBasename() {\r
+ public String getModuleOutputFileBasename() {\r
String[] xPath = new String[] { "/" };\r
\r
Object[] returns = get("ModuleDefinitions", xPath);\r
*\r
* @returns Empty array if nothing is there\r
*/\r
- public static String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {\r
+ public String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {\r
String target = null;\r
String toolchain = null;\r
String toolchainFamily = null;\r
return result;\r
}\r
\r
- public static String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {\r
+ public String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
\r
if (toolChainFamilyFlag == true) {\r
return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);\r
}\r
\r
- public static String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {\r
+ public String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {\r
String[] xPath;\r
\r
if (toolChainFamilyFlag == true) {\r
return getOptions("PlatformSurfaceArea", xPath, toolChainFamilyFlag);\r
}\r
\r
- public static ToolChainInfo getFpdToolChainInfo() {\r
+ public ToolChainInfo getFpdToolChainInfo() {\r
String[] xPath = new String[] { "/PlatformDefinitions" };\r
\r
Object[] returns = get("PlatformSurfaceArea", xPath);\r
* @returns The module type name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String getModuleType() {\r
+ public String getModuleType() {\r
String[] xPath = new String[] { "/ModuleType" };\r
\r
Object[] returns = get(xPath);\r
* @returns package name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static PackageIdentification[] getDependencePkg(String arch) {\r
+ public PackageIdentification[] getDependencePkg(String arch) {\r
String[] xPath;\r
String packageGuid = null;\r
String packageVersion = null;\r
* xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getLibraryClasses(String usage, String arch) {\r
+ public String[] getLibraryClasses(String usage, String arch) {\r
String[] xPath;\r
if (usage == null || usage.equals("")) {\r
xPath = new String[] { "/LibraryClass" };\r
* xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getModuleEntryPointArray() {\r
+ public String[] getModuleEntryPointArray() {\r
String[] xPath = new String[] { "/Extern/ModuleEntryPoint" };\r
\r
Object[] returns = get("Externs", xPath);\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getProtocolArray(String arch, String usage) {\r
+ public String[] getProtocolArray(String arch, String usage) {\r
String[] xPath;\r
String usageXpath = "";\r
String archXpath = "";\r
* @returns Protocol String list if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getProtocolArray(String arch) {\r
+ public String[] getProtocolArray(String arch) {\r
String[] xPath;\r
\r
if (arch == null || arch.equals("")) {\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getProtocolNotifyArray(String arch) {\r
+ public String[] getProtocolNotifyArray(String arch) {\r
String[] xPath;\r
\r
if (arch == null || arch.equals("")) {\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getProtocolNotifyArray(String arch, String usage) {\r
+ public String[] getProtocolNotifyArray(String arch, String usage) {\r
\r
String[] xPath;\r
String usageXpath;\r
* xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getModuleUnloadImageArray() {\r
+ public String[] getModuleUnloadImageArray() {\r
String[] xPath = new String[] { "/Extern/ModuleUnloadImage" };\r
\r
Object[] returns = get("Externs", xPath);\r
* @returns Extern objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static ExternsDocument.Externs.Extern[] getExternArray() {\r
+ public ExternsDocument.Externs.Extern[] getExternArray() {\r
String[] xPath = new String[] { "/Extern" };\r
\r
Object[] returns = get("Externs", xPath);\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getPpiNotifyArray(String arch) {\r
+ public String[] getPpiNotifyArray(String arch) {\r
String[] xPath;\r
\r
if (arch == null || arch.equals("")) {\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getPpiNotifyArray(String arch, String usage) {\r
+ public String[] getPpiNotifyArray(String arch, String usage) {\r
\r
String[] xPath;\r
String usageXpath;\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getPpiArray(String arch) {\r
+ public String[] getPpiArray(String arch) {\r
String[] xPath;\r
\r
if (arch == null || arch.equals("")) {\r
* @returns String[] if elements are found at the known xpath\r
* @returns String[0] if nothing is there\r
*/\r
- public static String[] getPpiArray(String arch, String usage) {\r
+ public String[] getPpiArray(String arch, String usage) {\r
\r
String[] xPath;\r
String usageXpath;\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getGuidEntryArray(String arch) {\r
+ public String[] getGuidEntryArray(String arch) {\r
String[] xPath;\r
\r
if (arch == null || arch.equals("")) {\r
* @returns GuidEntry objects list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getGuidEntryArray(String arch, String usage) {\r
+ public String[] getGuidEntryArray(String arch, String usage) {\r
String[] xPath;\r
String archXpath;\r
String usageXpath;\r
* xpath\r
* @returns null if nothing is there\r
*/\r
- public static ModuleIdentification[] getLibraryInstance(String arch) {\r
+ public ModuleIdentification[] getLibraryInstance(String arch) {\r
String[] xPath;\r
String saGuid = null;\r
String saVersion = null;\r
// / This method is used for retrieving the elements information which has\r
// / CName sub-element\r
// /\r
- private static String[] getCNames(String from, String xPath[]) {\r
+ private String[] getCNames(String from, String xPath[]) {\r
Object[] returns = get(from, xPath);\r
if (returns == null || returns.length == 0) {\r
return null;\r
* @returns constructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String getLibConstructorName() {\r
+ public String getLibConstructorName() {\r
String[] xPath = new String[] { "/Extern/Constructor" };\r
\r
Object[] returns = get("Externs", xPath);\r
* @returns destructor name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String getLibDestructorName() {\r
+ public String getLibDestructorName() {\r
String[] xPath = new String[] { "/Extern/Destructor" };\r
\r
Object[] returns = get("Externs", xPath);\r
* @returns DriverBinding name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getDriverBindingArray() {\r
+ public String[] getDriverBindingArray() {\r
String[] xPath = new String[] { "/Extern/DriverBinding" };\r
return getCNames("Externs", xPath);\r
}\r
* @returns ComponentName name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getComponentNameArray() {\r
+ public String[] getComponentNameArray() {\r
String[] xPath = new String[] { "/Extern/ComponentName" };\r
return getCNames("Externs", xPath);\r
}\r
* @returns DriverConfig name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getDriverConfigArray() {\r
+ public String[] getDriverConfigArray() {\r
String[] xPath = new String[] { "/Extern/DriverConfig" };\r
return getCNames("Externs", xPath);\r
}\r
* @returns DriverDiag name list if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getDriverDiagArray() {\r
+ public String[] getDriverDiagArray() {\r
String[] xPath = new String[] { "/Extern/DriverDiag" };\r
return getCNames("Externs", xPath);\r
}\r
* the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getSetVirtualAddressMapCallBackArray() {\r
+ public String[] getSetVirtualAddressMapCallBackArray() {\r
String[] xPath = new String[] { "/Extern/SetVirtualAddressMapCallBack" };\r
return getCNames("Externs", xPath);\r
}\r
* known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[] getExitBootServicesCallBackArray() {\r
+ public String[] getExitBootServicesCallBackArray() {\r
String[] xPath = new String[] { "/Extern/ExitBootServicesCallBack" };\r
return getCNames("Externs", xPath);\r
}\r
\r
@return CommonDefinition.PCD_DRIVER_TYPE the type of current driver\r
**/\r
- public static CommonDefinition.PCD_DRIVER_TYPE getPcdDriverType() {\r
+ public CommonDefinition.PCD_DRIVER_TYPE getPcdDriverType() {\r
String[] xPath = new String[] {"/PcdIsDriver"};\r
Object[] results = get ("Externs", xPath);\r
\r
* @returns ModuleSA objects list if elements are found at the known xpath\r
* @returns Empty ModuleSA list if nothing is there\r
*/\r
- public static Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() {\r
+ public Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() {\r
String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
Object[] result = get("PlatformSurfaceArea", xPath);\r
String arch = null;\r
* @returns valid iamges name list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
- public static String[] getFpdValidImageNames() {\r
+ public String[] getFpdValidImageNames() {\r
String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='ImageName']/FvImageNames" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
return result;\r
}\r
\r
- public static Node getFpdUserExtensionPreBuild() {\r
+ public Node getFpdUserExtensionPreBuild() {\r
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
return a.getDomNode();\r
}\r
\r
- public static Node getFpdUserExtensionPostBuild() {\r
+ public Node getFpdUserExtensionPostBuild() {\r
String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
* @returns option name/value list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
- public static String[][] getFpdOptions(String fvName) {\r
+ public String[][] getFpdOptions(String fvName) {\r
String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Options' and ./FvImageNames='"\r
+ fvName + "']/FvImageOptions" };\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
\r
}\r
\r
- public static XmlObject getFpdBuildOptions() {\r
+ public XmlObject getFpdBuildOptions() {\r
String[] xPath = new String[] { "/BuildOptions" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
return (XmlObject)queryResult[0];\r
}\r
\r
- public static PlatformIdentification getFpdHeader() {\r
+ public PlatformIdentification getFpdHeader() {\r
String[] xPath = new String[] { "/PlatformHeader" };\r
\r
Object[] returns = get("PlatformSurfaceArea", xPath);\r
* xpath\r
* @returns empty list if nothing is there\r
*/\r
- public static String[][] getFpdAttributes(String fvName) {\r
+ public String[][] getFpdAttributes(String fvName) {\r
String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Attributes' and ./FvImageNames='"\r
+ fvName + "']/FvImageOptions" };\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
* @returns file name if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String getFlashDefinitionFile() {\r
+ public String getFlashDefinitionFile() {\r
String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/FlashDefinitionFile" };\r
\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
return filename.getStringValue();\r
}\r
\r
- public static String[][] getFpdGlobalVariable() {\r
+ public String[][] getFpdGlobalVariable() {\r
String[] xPath = new String[] { "/Flash/FvImages/NameValue" };\r
Object[] queryResult = get("PlatformSurfaceArea", xPath);\r
if (queryResult == null) {\r
* @returns name/value pairs list if elements are found at the known xpath\r
* @returns empty list if nothing is there\r
*/\r
- public static String[][] getFpdComponents(String fvName) {\r
+ public String[][] getFpdComponents(String fvName) {\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
* xpath\r
* @returns null if nothing is there\r
*/\r
- public static String[][] getPcdTokenArray() {\r
+ public String[][] getPcdTokenArray() {\r
String[] xPath = new String[] { "/PcdData" };\r
\r
Object[] returns = get("PCDs", xPath);\r
* @return\r
* @return\r
*/\r
- public static ModuleIdentification getMsaHeader() {\r
+ public ModuleIdentification getMsaHeader() {\r
String[] xPath = new String[] { "/" };\r
Object[] returns = get("MsaHeader", xPath);\r
\r
*\r
*/\r
\r
- public static String[] getExternSpecificaiton() {\r
+ public String[] getExternSpecificaiton() {\r
String[] xPath = new String[] { "/Specification" };\r
\r
Object[] queryResult = get("Externs", xPath);\r
* @return String[][3] The string sequence is ModuleName, ModuleGuid,\r
* ModuleVersion, MsaFile String[0][] If no msafile in SPD\r
*/\r
- public static String[] getSpdMsaFile() {\r
+ public String[] getSpdMsaFile() {\r
String[] xPath = new String[] { "/MsaFiles" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
/**\r
* Reteive\r
*/\r
- public static Map<String, String[]> getSpdLibraryClasses() {\r
+ public Map<String, String[]> getSpdLibraryClasses() {\r
String[] xPath = new String[] { "/LibraryClassDeclarations/LibraryClass" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
/**\r
* Reteive\r
*/\r
- public static Map<String, String> getSpdPackageHeaderFiles() {\r
+ public Map<String, String> getSpdPackageHeaderFiles() {\r
String[] xPath = new String[] { "/PackageHeaders/IncludePkgHeader" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
return packageIncludeMap;\r
}\r
\r
- public static PackageIdentification getSpdHeader() {\r
+ public PackageIdentification getSpdHeader() {\r
String[] xPath = new String[] { "/SpdHeader" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
/**\r
* Reteive\r
*/\r
- public static Map<String, String[]> getSpdGuid() {\r
+ public Map<String, String[]> getSpdGuid() {\r
String[] xPath = new String[] { "/GuidDeclarations/Entry" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
/**\r
* Reteive\r
*/\r
- public static Map<String, String[]> getSpdProtocol() {\r
+ public Map<String, String[]> getSpdProtocol() {\r
String[] xPath = new String[] { "/ProtocolDeclarations/Entry" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
* Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI\r
* entry in SPD.\r
*/\r
- public static Map<String, String[]> getSpdPpi() {\r
+ public Map<String, String[]> getSpdPpi() {\r
String[] xPath = new String[] { "/PpiDeclarations/Entry" };\r
\r
Object[] returns = get("PackageSurfaceArea", xPath);\r
* @returns GUILD string if elements are found at the known xpath\r
* @returns null if nothing is there\r
*/\r
- public static String getModuleGuid() {\r
+ public String getModuleGuid() {\r
String[] xPath = new String[] { "" };\r
\r
Object[] returns = get("MsaHeader", xPath);\r
//\r
// For new Pcd\r
//\r
- public static ModuleSADocument.ModuleSA[] getFpdModuleSAs() {\r
+ public ModuleSADocument.ModuleSA[] getFpdModuleSAs() {\r
String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
Object[] result = get("PlatformSurfaceArea", xPath);\r
if (result != null) {\r
\r
@return String[]\r
**/\r
- public static String[] getModulePcdEntryNameArray() {\r
+ public String[] getModulePcdEntryNameArray() {\r
PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null;\r
String[] results;\r
int index;\r
\r
@return boolean\r
**/\r
- public static boolean contains(List list, String str) {\r
+ public boolean contains(List list, String str) {\r
if (list == null || list.size()== 0) {\r
return true;\r
}\r
return false;\r
}\r
\r
- public static boolean isHaveTianoR8FlashMap(){\r
+ public boolean isHaveTianoR8FlashMap(){\r
String[] xPath = new String[] {"/"};\r
Object[] returns = get ("Externs", xPath);\r
\r