import java.io.FileOutputStream;\r
import java.io.FileReader;\r
import java.io.FileWriter;\r
+import java.io.IOException;\r
import java.util.ArrayList;\r
import java.util.HashSet;\r
import java.util.Iterator;\r
import org.tianocore.build.id.ModuleIdentification;\r
import org.tianocore.build.id.PackageIdentification;\r
import org.tianocore.build.pcd.action.PCDAutoGenAction;\r
-\r
import org.tianocore.common.logger.EdkLog;\r
+import org.tianocore.common.definitions.ToolDefinitions;\r
\r
/**\r
- * This class is to generate Autogen.h and Autogen.c according to module surface\r
- * area or library surface area.\r
- */\r
+ This class is to generate Autogen.h and Autogen.c according to module surface\r
+ area or library surface area.\r
+**/\r
public class AutoGen {\r
///\r
/// The output path of Autogen.h and Autogen.c\r
///\r
private Set<String> mGuidList = new HashSet<String>();\r
\r
- //\r
- // The dependence package list which recoreded in module or library surface\r
- // area and it's dependence on library instance surface are.\r
- //\r
+ ///\r
+ /// The dependence package list which recoreded in module or library surface\r
+ /// area and it's dependence on library instance surface area.\r
+ ///\r
private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();\r
\r
- //\r
- // For non library module, add its library instance's construct and destructor to\r
- // list.\r
- //\r
+ ///\r
+ /// For non library module, add its library instance's construct and destructor to\r
+ /// list.\r
+ ///\r
private List<String> libConstructList = new ArrayList<String>();\r
private List<String> libDestructList = new ArrayList<String>();\r
\r
- //\r
- // List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack\r
- //\r
+ ///\r
+ /// List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack\r
+ ///\r
private List<String> setVirtalAddList = new ArrayList<String>();\r
private List<String> exitBootServiceList = new ArrayList<String>();\r
\r
\r
/**\r
- * Construct function\r
- *\r
- * This function mainly initialize some member variable.\r
- *\r
- * @param outputPath\r
- * Output path of AutoGen file.\r
- * @param baseName\r
- * Module base name.\r
- * @param arch\r
- * Target architecture.\r
- */\r
+ Construct function\r
+ \r
+ This function mainly initialize some member variable.\r
+ \r
+ @param fvDir\r
+ Absolute path of FV directory.\r
+ @param outputPath\r
+ Output path of AutoGen file.\r
+ @param moduleId\r
+ Module identification.\r
+ @param arch\r
+ Target architecture.\r
+ **/\r
public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch) {\r
this.outputPath = outputPath;\r
this.moduleId = moduleId;\r
}\r
\r
/**\r
- * saveFile function\r
- *\r
- * This function save the content in stringBuffer to file.\r
- *\r
- * @param fileName\r
- * The name of file.\r
- * @param fileBuffer\r
- * The content of AutoGen file in buffer.\r
- * @return "true" successful, "false" failed.\r
- */\r
+ saveFile function\r
+ \r
+ This function save the content in stringBuffer to file.\r
+ \r
+ @param fileName\r
+ The name of file.\r
+ @param fileBuffer\r
+ The content of AutoGen file in buffer.\r
+ @return boolean \r
+ "true" successful\r
+ "false" failed\r
+ **/\r
private boolean saveFile(String fileName, StringBuffer fileBuffer) {\r
- try {\r
- File autoGenH = new File(fileName);\r
+ \r
+ File autoGenH = new File(fileName);\r
\r
//\r
// if the file exists, compare their content\r
//\r
- if (autoGenH.exists()) {\r
- FileReader fIn = new FileReader(autoGenH);\r
- char[] oldFileBuffer = new char[(int) autoGenH.length()];\r
- fIn.read(oldFileBuffer, 0, (int) autoGenH.length());\r
+ if (autoGenH.exists()) {\r
+ char[] oldFileBuffer = new char[(int) autoGenH.length()];\r
+ try {\r
+ FileReader fIn = new FileReader(autoGenH);\r
+ fIn.read(oldFileBuffer, 0, (int) autoGenH.length());\r
fIn.close();\r
+ } catch (IOException e) {\r
+ EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName() \r
+ + "'s " \r
+ + fileName \r
+ + " is exist, but can't be open!!");\r
+ return false;\r
+ }\r
\r
- //\r
- // if we got the same file, don't re-generate it to prevent\r
- // sources depending on it from re-building\r
- //\r
- if (fileBuffer.toString().compareTo(new String(oldFileBuffer)) == 0) {\r
- return true;\r
- }\r
+ //\r
+ // if we got the same file, don't re-generate it to prevent\r
+ // sources depending on it from re-building\r
+ //\r
+ if (fileBuffer.toString().compareTo(new String(oldFileBuffer)) == 0) {\r
+ return true;\r
}\r
- FileWriter fOut = new FileWriter(autoGenH);\r
+ }\r
+ \r
+ try {\r
+ FileWriter fOut = new FileWriter(autoGenH);\r
fOut.write(fileBuffer.toString());\r
+ fOut.flush();\r
fOut.close();\r
- } catch (Exception e) {\r
- return false;\r
- }\r
+ } catch (IOException e) {\r
+ EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName() \r
+ + "'s " \r
+ + fileName \r
+ + " can't be create!!");\r
+ return false;\r
+ } \r
return true;\r
}\r
\r
/**\r
- * genAutogen function\r
- *\r
- * This function call libGenAutoGen or moduleGenAutogen function, which\r
- * dependence on generate library autogen or module autogen.\r
- *\r
- * @throws BuildException\r
- * Failed to creat AutoGen.c & AutoGen.h.\r
- */\r
+ genAutogen function\r
+ \r
+ This function call libGenAutoGen or moduleGenAutogen function, which\r
+ dependence on generate library autogen or module autogen.\r
+ \r
+ @throws BuildException\r
+ Failed to creat AutoGen.c & AutoGen.h.\r
+ **/\r
public void genAutogen() throws BuildException {\r
try {\r
//\r
}\r
\r
/**\r
- * moduleGenAutogen function\r
- *\r
- * This function generates AutoGen.c & AutoGen.h for module.\r
- *\r
- * @throws BuildException\r
- * Faile to create module AutoGen.c & AutoGen.h.\r
- */\r
+ moduleGenAutogen function\r
+ \r
+ This function generates AutoGen.c & AutoGen.h for module.\r
+ \r
+ @throws BuildException\r
+ Faile to create module AutoGen.c & AutoGen.h.\r
+ **/\r
void moduleGenAutogen() throws BuildException {\r
\r
try {\r
}\r
\r
/**\r
- * libGenAutogen function\r
- *\r
- * This function generates AutoGen.c & AutoGen.h for library.\r
- *\r
- * @throws BuildException\r
- * Faile to create library AutoGen.c & AutoGen.h\r
- */\r
+ libGenAutogen function\r
+ \r
+ This function generates AutoGen.c & AutoGen.h for library.\r
+ \r
+ @throws BuildException\r
+ Faile to create library AutoGen.c & AutoGen.h\r
+ **/\r
void libGenAutogen() throws BuildException {\r
try {\r
libGenAutogenC();\r
}\r
\r
/**\r
- * moduleGenAutogenH\r
- *\r
- * This function generates AutoGen.h for module.\r
- *\r
- * @throws BuildException\r
- * Failed to generate AutoGen.h.\r
- */\r
+ moduleGenAutogenH\r
+ \r
+ This function generates AutoGen.h for module.\r
+ \r
+ @throws BuildException\r
+ Failed to generate AutoGen.h.\r
+ **/\r
void moduleGenAutogenH() throws AutoGenException {\r
\r
Set<String> libClassIncludeH;\r
//\r
// Write Autogen.h header notation\r
//\r
- fileBuffer.append(CommonDefinition.autogenHNotation);\r
+ fileBuffer.append(CommonDefinition.AUTOGENHNOTATION);\r
\r
//\r
// Add #ifndef ${BaseName}_AUTOGENH\r
// #def ${BseeName}_AUTOGENH\r
//\r
- fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n");\r
- fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") +"\r\n\r\n");\r
+ fileBuffer.append(CommonDefinition.IFNDEF \r
+ + CommonDefinition.AUTOGENH\r
+ + this.moduleId.getGuid().replaceAll("-", "_") \r
+ + ToolDefinitions.LINE_SEPARATOR);\r
+ fileBuffer.append(CommonDefinition.DEFINE \r
+ + CommonDefinition.AUTOGENH\r
+ + this.moduleId.getGuid().replaceAll("-", "_") \r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + ToolDefinitions.LINE_SEPARATOR);\r
\r
//\r
// Write the specification version and release version at the begine\r
// Add "extern int __make_me_compile_correctly;" at begin of\r
// AutoGen.h.\r
//\r
- fileBuffer.append(CommonDefinition.autoGenHbegin);\r
+ fileBuffer.append(CommonDefinition.AUTOGENHBEGIN);\r
\r
//\r
// Put EFI_SPECIFICATION_VERSION, and EDK_RELEASE_VERSION.\r
//\r
String[] specList = SurfaceAreaQuery.getExternSpecificaiton();\r
for (int i = 0; i < specList.length; i++) {\r
- fileBuffer.append(CommonDefinition.marcDefineStr + specList[i]\r
+ fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
+ "\r\n");\r
}\r
//\r
// Write library class's related *.h file to autogen.h.\r
//\r
String[] libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.AlwaysConsumed,this.arch);\r
+ .getLibraryClasses(CommonDefinition.ALWAYSCONSUMED,this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
}\r
\r
libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);\r
+ .getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
//\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
- fileBuffer.append(CommonDefinition.include);\r
+ fileBuffer.append(CommonDefinition.INCLUDE);\r
fileBuffer.append(" <");\r
- fileBuffer.append(CommonDefinition.tianoR8FlashMapH + ">\r\n");\r
+ fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
copyFlashMapHToDebugDir();\r
}\r
\r
}\r
\r
/**\r
- * moduleGenAutogenC\r
- *\r
- * This function generates AutoGen.c for module.\r
- *\r
- * @throws BuildException\r
- * Failed to generate AutoGen.c.\r
- */\r
+ moduleGenAutogenC\r
+ \r
+ This function generates AutoGen.c for module.\r
+ \r
+ @throws BuildException\r
+ Failed to generate AutoGen.c.\r
+ **/\r
void moduleGenAutogenC() throws AutoGenException {\r
\r
StringBuffer fileBuffer = new StringBuffer(8192);\r
//\r
// Write Autogen.c header notation\r
//\r
- fileBuffer.append(CommonDefinition.autogenCNotation);\r
+ fileBuffer.append(CommonDefinition.AUTOGENCNOTATION);\r
\r
//\r
// Write #include <AutoGen.h> at beginning of AutoGen.c\r
//\r
- fileBuffer.append(CommonDefinition.includeAutogenH);\r
+ fileBuffer.append(CommonDefinition.INCLUDEAUTOGENH);\r
\r
//\r
// Get the native MSA file infomation. Since before call autogen,\r
// Write EntryPoint to autgoGen.c\r
//\r
String[] entryPointList = SurfaceAreaQuery.getModuleEntryPointArray();\r
- EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList), fileBuffer);\r
+ String[] unloadImageList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
+ EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList), \r
+ CommonDefinition.remDupString(unloadImageList),\r
+ fileBuffer);\r
\r
pcdDriverType = SurfaceAreaQuery.getPcdDriverType();\r
\r
}\r
\r
/**\r
- * libGenAutogenH\r
- *\r
- * This function generates AutoGen.h for library.\r
- *\r
- * @throws BuildException\r
- * Failed to generate AutoGen.c.\r
- */\r
+ libGenAutogenH\r
+ \r
+ This function generates AutoGen.h for library.\r
+ \r
+ @throws BuildException\r
+ Failed to generate AutoGen.c.\r
+ **/\r
void libGenAutogenH() throws AutoGenException {\r
\r
Set<String> libClassIncludeH;\r
//\r
// Write Autogen.h header notation\r
//\r
- fileBuffer.append(CommonDefinition.autogenHNotation);\r
+ fileBuffer.append(CommonDefinition.AUTOGENHNOTATION);\r
\r
//\r
// Add #ifndef ${BaseName}_AUTOGENH\r
// #def ${BseeName}_AUTOGENH\r
//\r
- fileBuffer.append("#ifndef " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n");\r
- fileBuffer.append("#define " + "_AUTOGENH_" + this.moduleId.getGuid().replaceAll("-", "_") + "\r\n\r\n");\r
+ fileBuffer.append(CommonDefinition.IFNDEF \r
+ + CommonDefinition.AUTOGENH\r
+ + this.moduleId.getGuid().replaceAll("-", "_") \r
+ + ToolDefinitions.LINE_SEPARATOR);\r
+ fileBuffer.append(CommonDefinition.DEFINE \r
+ + CommonDefinition.AUTOGENH\r
+ + this.moduleId.getGuid().replaceAll("-", "_") \r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + ToolDefinitions.LINE_SEPARATOR);\r
\r
//\r
// Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION\r
// Note: the specification version and release version should\r
// be get from module surface area instead of hard code.\r
//\r
- fileBuffer.append(CommonDefinition.autoGenHbegin);\r
+ fileBuffer.append(CommonDefinition.AUTOGENHBEGIN);\r
String[] specList = SurfaceAreaQuery.getExternSpecificaiton();\r
for (int i = 0; i < specList.length; i++) {\r
- fileBuffer.append(CommonDefinition.marcDefineStr + specList[i]\r
+ fileBuffer.append(CommonDefinition.DEFINE + specList[i]\r
+ "\r\n");\r
}\r
// fileBuffer.append(CommonDefinition.autoGenHLine1);\r
// Write library class's related *.h file to autogen.h\r
//\r
String[] libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.AlwaysConsumed, this.arch);\r
+ .getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
}\r
\r
libClassList = SurfaceAreaQuery\r
- .getLibraryClasses(CommonDefinition.AlwaysProduced, this.arch);\r
+ .getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch);\r
if (libClassList != null) {\r
libClassIncludeH = LibraryClassToAutogenH(libClassList);\r
item = libClassIncludeH.iterator();\r
fileBuffer.append(item.next().toString());\r
}\r
}\r
- fileBuffer.append("\r\n");\r
+ fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);\r
\r
//\r
// If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to\r
// {DEST_DIR_DRBUG}/FlashMap.h\r
//\r
if (SurfaceAreaQuery.isHaveTianoR8FlashMap()) {\r
- fileBuffer.append(CommonDefinition.include);\r
+ fileBuffer.append(CommonDefinition.INCLUDE);\r
fileBuffer.append(" <");\r
- fileBuffer.append(CommonDefinition.tianoR8FlashMapH + ">\r\n");\r
+ fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");\r
copyFlashMapHToDebugDir();\r
}\r
\r
}\r
\r
/**\r
- * libGenAutogenC\r
- *\r
- * This function generates AutoGen.h for library.\r
- *\r
- * @throws BuildException\r
- * Failed to generate AutoGen.c.\r
- */\r
+ libGenAutogenC\r
+ \r
+ This function generates AutoGen.h for library.\r
+ \r
+ @throws BuildException\r
+ Failed to generate AutoGen.c.\r
+ **/\r
void libGenAutogenC() throws BuildException, PcdAutogenException {\r
StringBuffer fileBuffer = new StringBuffer(10240);\r
\r
//\r
// Write Autogen.c header notation\r
//\r
- fileBuffer.append(CommonDefinition.autogenCNotation);\r
+ fileBuffer.append(CommonDefinition.AUTOGENCNOTATION);\r
\r
- fileBuffer.append(CommonDefinition.autoGenCLine1);\r
- fileBuffer.append("\r\n");\r
+ fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);\r
+ fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);\r
\r
//\r
// Call pcd autogen.\r
}\r
\r
if (this.myPcdAutogen != null) {\r
- fileBuffer.append("\r\n");\r
+ fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);\r
fileBuffer.append(this.myPcdAutogen.getCAutoGenString());\r
}\r
\r
}\r
\r
/**\r
- * LibraryClassToAutogenH\r
- *\r
- * This function returns *.h files declared by library classes which are\r
- * consumed or produced by current build module or library.\r
- *\r
- * @param libClassList\r
- * List of library class which consumed or produce by current\r
- * build module or library.\r
- * @return includeStrList List of *.h file.\r
- */\r
+ LibraryClassToAutogenH\r
+ \r
+ This function returns *.h files declared by library classes which are\r
+ consumed or produced by current build module or library.\r
+ \r
+ @param libClassList\r
+ List of library class which consumed or produce by current\r
+ build module or library.\r
+ @return includeStrList List of *.h file.\r
+ **/\r
Set<String> LibraryClassToAutogenH(String[] libClassList)\r
throws AutoGenException {\r
- Set<String> includStrList = new LinkedHashSet<String>();\r
- String includerName[];\r
+ Set<String> includeStrList = new LinkedHashSet<String>();\r
+ String includeName[];\r
String str = "";\r
\r
//\r
// library class name.\r
//\r
for (int i = 0; i < libClassList.length; i++) {\r
- includerName = GlobalData.getLibraryClassHeaderFiles(\r
+ includeName = GlobalData.getLibraryClassHeaderFiles(\r
SurfaceAreaQuery.getDependencePkg(this.arch),\r
libClassList[i]);\r
- if (includerName == null) {\r
+ if (includeName == null) {\r
throw new AutoGenException("Can not find library class ["\r
+ libClassList[i] + "] declaration in any SPD package. ");\r
}\r
- for (int j = 0; j < includerName.length; j++) {\r
- String includeNameStr = includerName[j];\r
+ for (int j = 0; j < includeName.length; j++) {\r
+ String includeNameStr = includeName[j];\r
if (includeNameStr != null) {\r
- str = CommonDefinition.include + " " + "<";\r
+ str = CommonDefinition.INCLUDE + " " + "<";\r
str = str + includeNameStr + ">\r\n";\r
- includStrList.add(str);\r
+ includeStrList.add(str);\r
includeNameStr = null;\r
}\r
}\r
}\r
- return includStrList;\r
+ return includeStrList;\r
}\r
\r
/**\r
- * IncludesToAutogenH\r
- *\r
- * This function add include file in AutoGen.h file.\r
- *\r
- * @param packageNameList\r
- * List of module depended package.\r
- * @param moduleType\r
- * Module type.\r
- * @return\r
- */\r
+ IncludesToAutogenH\r
+ \r
+ This function add include file in AutoGen.h file.\r
+ \r
+ @param packageNameList\r
+ List of module depended package.\r
+ @param moduleType\r
+ Module type.\r
+ @return\r
+ **/\r
List<String> depPkgToAutogenH(PackageIdentification[] packageNameList,\r
String moduleType) throws AutoGenException {\r
\r
+ packageNameList[i]\r
+ "] declaration in any SPD package. ");\r
} else if (!pkgHeader.equalsIgnoreCase("")) {\r
- includeStr = CommonDefinition.include + " <" + pkgHeader\r
+ includeStr = CommonDefinition.INCLUDE + " <" + pkgHeader\r
+ ">\r\n";\r
includeStrList.add(includeStr);\r
}\r
}\r
\r
/**\r
- * EntryPointToAutoGen\r
- *\r
- * This function convert <ModuleEntryPoint> & <ModuleUnloadImage>\r
- * information in mas to AutoGen.c\r
- *\r
- * @param entryPointList\r
- * List of entry point.\r
- * @param fileBuffer\r
- * String buffer fo AutoGen.c.\r
- * @throws Exception\r
- */\r
- void EntryPointToAutoGen(String[] entryPointList, StringBuffer fileBuffer)\r
+ EntryPointToAutoGen\r
+ \r
+ This function convert <ModuleEntryPoint> & <ModuleUnloadImage>\r
+ information in mas to AutoGen.c\r
+ \r
+ @param entryPointList\r
+ List of entry point.\r
+ @param fileBuffer\r
+ String buffer fo AutoGen.c.\r
+ @throws Exception\r
+ **/\r
+ void EntryPointToAutoGen(String[] entryPointList, String[] unloadImageList, StringBuffer fileBuffer)\r
throws BuildException {\r
\r
String typeStr = SurfaceAreaQuery.getModuleType();\r
+ int unloadImageCount = 0;\r
+ int entryPointCount = 0;\r
\r
//\r
// The parameters and return value of entryPoint is difference\r
break;\r
\r
case CommonDefinition.ModuleTypePeim:\r
- int entryPointCount = 0;\r
+ entryPointCount = 0;\r
fileBuffer\r
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");\r
if (entryPointList == null || entryPointList.length == 0) {\r
//\r
// Add "ModuleUnloadImage" for DxeSmmDriver module type;\r
//\r
- entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
- entryPointList = CommonDefinition.remDupString(entryPointList);\r
- entryPointCount = 0;\r
+ //entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
+ //entryPointList = CommonDefinition.remDupString(entryPointList);\r
+ //entryPointCount = 0;\r
\r
- if (entryPointList != null) {\r
- for (int i = 0; i < entryPointList.length; i++) {\r
+ unloadImageCount = 0;\r
+ if (unloadImageList != null) {\r
+ for (int i = 0; i < unloadImageList.length; i++) {\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append("EFIAPI\r\n");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append(" (\r\n");\r
fileBuffer\r
.append(" IN EFI_HANDLE ImageHandle\r\n");\r
fileBuffer.append(" );\r\n");\r
- entryPointCount++;\r
+ unloadImageCount++;\r
}\r
}\r
\r
fileBuffer\r
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");\r
- fileBuffer.append(Integer.toString(entryPointCount));\r
+ fileBuffer.append(Integer.toString(unloadImageCount));\r
fileBuffer.append(";\r\n\r\n");\r
\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append(" )\r\n");\r
fileBuffer.append("{\r\n");\r
\r
- if (entryPointCount == 0) {\r
+ if (unloadImageCount == 0) {\r
fileBuffer.append(" return EFI_SUCCESS;\r\n");\r
- } else if (entryPointCount == 1) {\r
+ } else if (unloadImageCount == 1) {\r
fileBuffer.append(" return ");\r
- fileBuffer.append(entryPointList[0]);\r
+ fileBuffer.append(unloadImageList[0]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
} else {\r
fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");\r
fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");\r
- for (int i = 0; i < entryPointList.length; i++) {\r
+ for (int i = 0; i < unloadImageList.length; i++) {\r
if (i == 0) {\r
fileBuffer.append(" Status = ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
} else {\r
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");\r
fileBuffer.append(" ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
fileBuffer.append(" } else {\r\n");\r
fileBuffer.append(" Status = ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
fileBuffer.append(" }\r\n");\r
}\r
//\r
// Add ModuleUnloadImage for DxeDriver and UefiDriver module type.\r
//\r
- entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
+ //entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();\r
//\r
// Remover duplicate unload entry point.\r
//\r
- entryPointList = CommonDefinition.remDupString(entryPointList);\r
- entryPointCount = 0;\r
- if (entryPointList != null) {\r
- for (int i = 0; i < entryPointList.length; i++) {\r
+ //entryPointList = CommonDefinition.remDupString(entryPointList);\r
+ //entryPointCount = 0;\r
+ unloadImageCount = 0;\r
+ if (unloadImageList != null) {\r
+ for (int i = 0; i < unloadImageList.length; i++) {\r
fileBuffer.append("EFI_STATUS\r\n");\r
fileBuffer.append("EFIAPI\r\n");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append(" (\r\n");\r
fileBuffer\r
.append(" IN EFI_HANDLE ImageHandle\r\n");\r
fileBuffer.append(" );\r\n");\r
- entryPointCount++;\r
+ unloadImageCount++;\r
}\r
}\r
\r
fileBuffer\r
.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");\r
- fileBuffer.append(Integer.toString(entryPointCount));\r
+ fileBuffer.append(Integer.toString(unloadImageCount));\r
fileBuffer.append(";\r\n\r\n");\r
\r
fileBuffer.append("EFI_STATUS\n");\r
fileBuffer.append(" )\r\n");\r
fileBuffer.append("{\r\n");\r
\r
- if (entryPointCount == 0) {\r
+ if (unloadImageCount == 0) {\r
fileBuffer.append(" return EFI_SUCCESS;\r\n");\r
- } else if (entryPointCount == 1) {\r
+ } else if (unloadImageCount == 1) {\r
fileBuffer.append(" return ");\r
- fileBuffer.append(entryPointList[0]);\r
+ fileBuffer.append(unloadImageList[0]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
} else {\r
fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");\r
fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");\r
- for (int i = 0; i < entryPointList.length; i++) {\r
+ for (int i = 0; i < unloadImageList.length; i++) {\r
if (i == 0) {\r
fileBuffer.append(" Status = ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
} else {\r
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");\r
fileBuffer.append(" ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
fileBuffer.append(" } else {\r\n");\r
fileBuffer.append(" Status = ");\r
- fileBuffer.append(entryPointList[i]);\r
+ fileBuffer.append(unloadImageList[i]);\r
fileBuffer.append("(ImageHandle);\r\n");\r
fileBuffer.append(" }\r\n");\r
}\r
}\r
\r
/**\r
- * PpiGuidToAutogenc\r
- *\r
- * This function gets GUIDs from SPD file accrodeing to <PPIs> information\r
- * and write those GUIDs to AutoGen.c.\r
- *\r
- * @param fileBuffer\r
- * String Buffer for Autogen.c file.\r
- * @throws BuildException\r
- * Guid must set value!\r
- */\r
+ PpiGuidToAutogenc\r
+ \r
+ This function gets GUIDs from SPD file accrodeing to <PPIs> information\r
+ and write those GUIDs to AutoGen.c.\r
+ \r
+ @param fileBuffer\r
+ String Buffer for Autogen.c file.\r
+ @throws BuildException\r
+ Guid must set value!\r
+ **/\r
void PpiGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException {\r
String[] cNameGuid = null;\r
\r
}\r
\r
/**\r
- * ProtocolGuidToAutogenc\r
- *\r
- * This function gets GUIDs from SPD file accrodeing to <Protocol>\r
- * information and write those GUIDs to AutoGen.c.\r
- *\r
- * @param fileBuffer\r
- * String Buffer for Autogen.c file.\r
- * @throws BuildException\r
- * Protocol name must set.\r
- */\r
+ ProtocolGuidToAutogenc\r
+ \r
+ This function gets GUIDs from SPD file accrodeing to <Protocol>\r
+ information and write those GUIDs to AutoGen.c.\r
+ \r
+ @param fileBuffer\r
+ String Buffer for Autogen.c file.\r
+ @throws BuildException\r
+ Protocol name must set.\r
+ **/\r
void ProtocolGuidToAutogenC(StringBuffer fileBuffer) throws BuildException {\r
String[] cNameGuid = null;\r
\r
}\r
\r
/**\r
- * GuidGuidToAutogenc\r
- *\r
- * This function gets GUIDs from SPD file accrodeing to <Guids> information\r
- * and write those GUIDs to AutoGen.c.\r
- *\r
- * @param fileBuffer\r
- * String Buffer for Autogen.c file.\r
- *\r
- */\r
+ GuidGuidToAutogenc\r
+ \r
+ This function gets GUIDs from SPD file accrodeing to <Guids> information\r
+ and write those GUIDs to AutoGen.c.\r
+ \r
+ @param fileBuffer\r
+ String Buffer for Autogen.c file.\r
+ \r
+ **/\r
void GuidGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException {\r
String[] cNameGuid = null;\r
String guidKeyWord = null;\r
}\r
\r
/**\r
- * LibInstanceToAutogenC\r
- *\r
- * This function adds dependent library instance to autogen.c,which\r
- * includeing library's constructor, destructor, and library dependent ppi,\r
- * protocol, guid, pcd information.\r
- *\r
- * @param fileBuffer\r
- * String buffer for AutoGen.c\r
- * @throws BuildException\r
- */\r
+ LibInstanceToAutogenC\r
+ \r
+ This function adds dependent library instance to autogen.c,which\r
+ includeing library's constructor, destructor, and library dependent ppi,\r
+ protocol, guid, pcd information.\r
+ \r
+ @param fileBuffer\r
+ String buffer for AutoGen.c\r
+ @throws BuildException\r
+ **/\r
void LibInstanceToAutogenC(StringBuffer fileBuffer) throws BuildException {\r
try {\r
String moduleType = this.moduleId.getModuleType();\r
}\r
\r
/**\r
- * LibConstructorToAutogenc\r
- *\r
- * This function writes library constructor list to AutoGen.c. The library\r
- * constructor's parameter and return value depend on module type.\r
- *\r
- * @param libInstanceList\r
- * List of library construct name.\r
- * @param moduleType\r
- * Module type.\r
- * @param fileBuffer\r
- * String buffer for AutoGen.c\r
- * @throws Exception\r
- */\r
+ LibConstructorToAutogenc\r
+ \r
+ This function writes library constructor list to AutoGen.c. The library\r
+ constructor's parameter and return value depend on module type.\r
+ \r
+ @param libInstanceList\r
+ List of library construct name.\r
+ @param moduleType\r
+ Module type.\r
+ @param fileBuffer\r
+ String buffer for AutoGen.c\r
+ @throws Exception\r
+ **/\r
void LibConstructorToAutogenC(List<String> libInstanceList,\r
String moduleType, StringBuffer fileBuffer) throws Exception {\r
boolean isFirst = true;\r
}\r
\r
/**\r
- * LibDestructorToAutogenc\r
- *\r
- * This function writes library destructor list to AutoGen.c. The library\r
- * destructor's parameter and return value depend on module type.\r
- *\r
- * @param libInstanceList\r
- * List of library destructor name.\r
- * @param moduleType\r
- * Module type.\r
- * @param fileBuffer\r
- * String buffer for AutoGen.c\r
- * @throws Exception\r
- */\r
+ LibDestructorToAutogenc\r
+ \r
+ This function writes library destructor list to AutoGen.c. The library\r
+ destructor's parameter and return value depend on module type.\r
+ \r
+ @param libInstanceList\r
+ List of library destructor name.\r
+ @param moduleType\r
+ Module type.\r
+ @param fileBuffer\r
+ String buffer for AutoGen.c\r
+ @throws Exception\r
+ **/\r
void LibDestructorToAutogenC(List<String> libInstanceList,\r
String moduleType, StringBuffer fileBuffer) throws Exception {\r
boolean isFirst = true;\r
}\r
\r
/**\r
- * ExternsDriverBindingToAutoGenC\r
- *\r
- * This function is to write DRIVER_BINDING, COMPONENT_NAME,\r
- * DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.\r
- *\r
- * @param fileBuffer\r
- * String buffer for AutoGen.c\r
- */\r
+ ExternsDriverBindingToAutoGenC\r
+ \r
+ This function is to write DRIVER_BINDING, COMPONENT_NAME,\r
+ DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.\r
+ \r
+ @param fileBuffer\r
+ String buffer for AutoGen.c\r
+ **/\r
void ExternsDriverBindingToAutoGenC(StringBuffer fileBuffer)\r
throws BuildException {\r
\r
}\r
\r
/**\r
- * ExternCallBackToAutoGenC\r
- *\r
- * This function adds <SetVirtualAddressMapCallBack> and\r
- * <ExitBootServicesCallBack> infomation to AutoGen.c\r
- *\r
- * @param fileBuffer\r
- * String buffer for AutoGen.c\r
- * @throws BuildException\r
- */\r
+ ExternCallBackToAutoGenC\r
+ \r
+ This function adds <SetVirtualAddressMapCallBack> and\r
+ <ExitBootServicesCallBack> infomation to AutoGen.c\r
+ \r
+ @param fileBuffer\r
+ String buffer for AutoGen.c\r
+ @throws BuildException\r
+ **/\r
void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
throws BuildException {\r
//\r
\r
}\r
\r
+ /**\r
+ copyFlashMapHToDebugDir\r
+ \r
+ This function is to copy the falshmap.h to debug directory and change \r
+ its name to TianoR8FlashMap.h\r
+ \r
+ @param \r
+ @return\r
+ **/\r
private void copyFlashMapHToDebugDir() throws AutoGenException{\r
\r
- File inFile = new File(fvDir + File.separatorChar + CommonDefinition.flashMapH);\r
+ File inFile = new File(fvDir + File.separatorChar + CommonDefinition.FLASHMAPH);\r
int size = (int)inFile.length();\r
byte[] buffer = new byte[size];\r
- File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.tianoR8FlashMapH);\r
+ File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.TIANOR8PLASHMAPH);\r
//\r
// If TianoR8FlashMap.h existed and the flashMap.h don't change,\r
// do nothing.\r
}\r
\r
/**\r
- *This function first order the library instances, then collect\r
- *library instance 's PPI, Protocol, GUID,\r
- *SetVirtalAddressMapCallBack, ExitBootServiceCallBack, and\r
- *Destructor, Constructor.\r
- *\r
+ This function first order the library instances, then collect\r
+ library instance 's PPI, Protocol, GUID,\r
+ SetVirtalAddressMapCallBack, ExitBootServiceCallBack, and\r
+ Destructor, Constructor.\r
+ \r
+ @param\r
+ @return \r
**/\r
private void collectLibInstanceInfo(){\r
int index;\r
import java.util.Iterator;\r
import java.util.LinkedHashSet;\r
import java.util.Set;\r
-\r
+import org.tianocore.common.definitions.EdkDefinitions;\r
+import org.tianocore.common.definitions.ToolDefinitions;\r
/**\r
CommonDefinition\r
\r
**/\r
public class CommonDefinition {\r
\r
- public final static String LibraryStr = "LIBRARY";\r
- public final static String autoGenHbegin = "extern int __make_me_compile_correctly;\r\n";\r
- public final static String include = "#include";\r
- public final static String autoGenCLine1 = "\r\n";\r
+ ///\r
+ /// final static string\r
+ /// \r
+ public final static String LIBRARY = "LIBRARY";\r
+\r
+ public final static String AUTOGENHBEGIN = "extern int __make_me_compile_correctly;"\r
+ + ToolDefinitions.LINE_SEPARATOR;\r
+\r
+ public final static String INCLUDE = "#include";\r
+\r
+ //public final static String DEBUGPROPERYMASK = "const UINT8 _gDebugPropertyMask "\r
+ // + "= DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED"\r
+ // + " | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED"\r
+ // + " | DEBUG_PROPERTY_DEBUG_CODE_ENABLED;" \r
+ // + ToolDefinitions.LINE_SEPARATOR;\r
+\r
+ //public final static String DEFAULERROLEVEL = "const UINTN _gModuleDefaultErrorLevel"\r
+ // + " = EFI_D_ERROR | EFI_D_LOAD;"\r
+ // + ToolDefinitions.LINE_SEPARATOR;\r
+\r
+\r
+ public final static String INCLUDEAUTOGENH = INCLUDE \r
+ + " <AutoGen.h>"\r
+ + ToolDefinitions.LINE_SEPARATOR;\r
+\r
+ public final static String DEFINE = "#define ";\r
+\r
+ public final static String GEFI = "gEfi";\r
\r
- public final static String autoGenCLine2 = "const UINT8 _gDebugPropertyMask "\r
- + "= DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED"\r
- + " | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED"\r
- + " | DEBUG_PROPERTY_DEBUG_CODE_ENABLED;\r\n";\r
+ public final static String PRTOCOLGUID = "ProtocolGuid";\r
\r
- public final static String autoGenCLine3 = "const UINTN _gModuleDefaultErrorLevel"\r
- + " = EFI_D_ERROR | EFI_D_LOAD;\r\n";\r
+ public final static String PPIGUID = "PpiGuid";\r
\r
- public final static String autoGenHLine1 = "#define EFI_SPECIFICATION_VERSION 0x00020000\r\n";\r
- public final static String autoGenHVersionDefault = "#define EFI_SPECIFICATION_VERSION 0x00000000\r\n";\r
- public final static String autoGenHLine2 = "#define EDK_RELEASE_VERSION 0x00090000\r\n";\r
- public final static String autoGenHReleaseDefault = "#define EDK_RELEASE_VERSION 0x00000000\r\n";\r
+ public final static String GUID = "Guid";\r
\r
- public final static String includeAutogenH = "#include <AutoGen.h>\r\n" ;\r
- public final static String marcDefineStr = "#define ";\r
+ public final static String TIANOR8PLASHMAPH = "TianoR8FlashMap.h";\r
\r
- public final static String gEfi = "gEfi";\r
- public final static String protocolGuid = "ProtocolGuid";\r
- public final static String ppiGuid = "PpiGuid";\r
- public final static String guidGuid = "Guid";\r
+ public final static String FLASHMAPH = "FlashMap.h";\r
\r
- public final static String tianoR8FlashMapH = "TianoR8FlashMap.h";\r
- public final static String flashMapH = "FlashMap.h";\r
+ public final static String IFNDEF = "#ifndef ";\r
+\r
+ public final static String AUTOGENH = "_AUTOGENH_";\r
+\r
+ \r
+ ///\r
+ /// AutoGen.h and AutoGen.c file's header\r
+ ///\r
+ public final static String AUTOGENHNOTATION = "/**"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + " DO NOT EDIT"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + " FILE auto-generated by GenBuild tasks"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + " Module name:"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + " AutoGen.h"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + " Abstract:" \r
+ + " Auto-generated AutoGen.h for building module or library."\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + "**/"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + ToolDefinitions.LINE_SEPARATOR;\r
+\r
+ public final static String AUTOGENCNOTATION = "/**"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + " DO NOT EDIT"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + " FILE auto-generated by GenBuild tasks"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + " Module name:"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + " AutoGen.c"\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + " Abstract:" \r
+ + " Auto-generated AutoGen.c for building module or library."\r
+ + ToolDefinitions.LINE_SEPARATOR \r
+ + "**/"\r
+ + ToolDefinitions.LINE_SEPARATOR\r
+ + ToolDefinitions.LINE_SEPARATOR;\r
\r
///\r
/// The defintions for identifying current module\r
/// is PEI Pcd driver or Dxe Pcd driver.\r
/// \r
public static enum PCD_DRIVER_TYPE { NOT_PCD_DRIVER,\r
- PEI_PCD_DRIVER, \r
- DXE_PCD_DRIVER,\r
- UNKNOWN_PCD_DRIVER};\r
+ PEI_PCD_DRIVER, \r
+ DXE_PCD_DRIVER,\r
+ UNKNOWN_PCD_DRIVER\r
+ };\r
\r
- ///\r
- /// AutoGen.h and AutoGen.c file's header\r
- ///\r
- public final static String autogenHNotation = \r
- "/**\r\n" +\r
- " DO NOT EDIT\r\n" +\r
- " FILE auto-generated by GenBuild tasks\r\n" +\r
- " Module name:\r\n" +\r
- " AutoGen.h\r\n" +\r
- " Abstract:" +\r
- " Auto-generated AutoGen.h for building module or library.\r\n" +\r
- "**/\r\n\r\n";\r
-\r
- public final static String autogenCNotation = \r
- "/**\r\n" +\r
- " DO NOT EDIT\r\n" +\r
- " FILE auto-generated by GenBuild tasks\r\n" +\r
- " Module name:\r\n" +\r
- " AutoGen.c\r\n" +\r
- " Abstract:" +\r
- " Auto-generated AutoGen.c for building module or library.\r\n" +\r
- "**/\r\n\r\n";\r
\r
///\r
/// module type\r
///\r
- public final static int ModuleTypeBase = 0;\r
- public final static int ModuleTypeSec = 1;\r
- public final static int ModuleTypePeiCore = 2;\r
- public final static int ModuleTypePeim = 3;\r
- public final static int ModuleTypeDxeCore = 4;\r
- public final static int ModuleTypeDxeDriver = 5;\r
+ public final static int ModuleTypeBase = 0;\r
+ public final static int ModuleTypeSec = 1;\r
+ public final static int ModuleTypePeiCore = 2;\r
+ public final static int ModuleTypePeim = 3;\r
+ public final static int ModuleTypeDxeCore = 4;\r
+ public final static int ModuleTypeDxeDriver = 5;\r
public final static int ModuleTypeDxeRuntimeDriver = 6;\r
- public final static int ModuleTypeDxeSmmDriver = 7;\r
- public final static int ModuleTypeDxeSalDriver = 8;\r
- public final static int ModuleTypeUefiDriver = 9;\r
- public final static int ModuleTypeUefiApplication = 10;\r
- public final static int ModuleTypeUnknown = 11;\r
+ public final static int ModuleTypeDxeSmmDriver = 7;\r
+ public final static int ModuleTypeDxeSalDriver = 8;\r
+ public final static int ModuleTypeUefiDriver = 9;\r
+ public final static int ModuleTypeUefiApplication = 10;\r
+ public final static int ModuleTypeUnknown = 11;\r
\r
///\r
/// Usaged style\r
///\r
- public final static String AlwaysConsumed = "ALWAYS_CONSUMED";\r
- public final static String AlwaysProduced = "ALWAYS_PRODUCED";\r
+ public final static String ALWAYSCONSUMED = "ALWAYS_CONSUMED";\r
+ public final static String ALWAYSPRODUCED = "ALWAYS_PRODUCED";\r
\r
\r
public static class MyEnum {\r
/// Module type\r
///\r
public static final MyEnum[] moduleEnum = new MyEnum[] {\r
- new MyEnum("BASE", ModuleTypeBase),\r
- new MyEnum("SEC", ModuleTypeSec),\r
- new MyEnum("PEI_CORE", ModuleTypePeiCore),\r
- new MyEnum("PEIM", ModuleTypePeim),\r
- new MyEnum("DXE_CORE", ModuleTypeDxeCore),\r
- new MyEnum("DXE_DRIVER", ModuleTypeDxeDriver),\r
- new MyEnum("DXE_RUNTIME_DRIVER", ModuleTypeDxeRuntimeDriver),\r
- new MyEnum("DXE_SAL_DRIVER", ModuleTypeDxeSalDriver),\r
- new MyEnum("DXE_SMM_DRIVER", ModuleTypeDxeSmmDriver),\r
- new MyEnum("UEFI_DRIVER", ModuleTypeUefiDriver),\r
- new MyEnum("UEFI_APPLICATION", ModuleTypeUefiApplication)};\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_BASE, ModuleTypeBase),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_SEC, ModuleTypeSec),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_PEI_CORE, ModuleTypePeiCore),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_PEIM, ModuleTypePeim),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_CORE, ModuleTypeDxeCore),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_DRIVER, ModuleTypeDxeDriver),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_RUNTIME_DRIVER, ModuleTypeDxeRuntimeDriver),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_SAL_DRIVER, ModuleTypeDxeSalDriver),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_SMM_DRIVER, ModuleTypeDxeSmmDriver),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_UEFI_DRIVER, ModuleTypeUefiDriver),\r
+ new MyEnum(EdkDefinitions.MODULE_TYPE_UEFI_APPLICATION, ModuleTypeUefiApplication)};\r
\r
/**\r
getModuleType\r
@param moduleTypeStr String of modlue type.\r
@return \r
**/\r
- static public int getModuleType(String moduleTypeStr) {\r
+ public static int getModuleType(String moduleTypeStr) {\r
int returnValue = -1;\r
for (int i = 0; i < CommonDefinition.moduleEnum.length; i++) {\r
returnValue = CommonDefinition.moduleEnum[i].ForInt(moduleTypeStr);\r