X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fautogen%2FAutoGen.java;h=b1414a7c75be072b7c0a81766caaddc677db018f;hp=b7d6ec4e395511997acd6692d79cbeee8dbbcab5;hb=8c8b94e252c4c17722f1092df10a35ea9f7b254e;hpb=66a9a6f8e99c1bf744e012448afcbd62bda7034d diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java index b7d6ec4e39..b1414a7c75 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java @@ -82,22 +82,10 @@ public class AutoGen { private CommonDefinition.PCD_DRIVER_TYPE pcdDriverType; /// - /// The protocl list which records in module or library surface area and - /// it's dependence on library instance surface area. + /// The Guid CName list which recoreded in module or library surface area + /// and it's dependence on library instance surface area. /// - private Set mProtocolList = new HashSet(); - - /// - /// The Ppi list which recorded in module or library surface area and its - /// dependency on library instance surface area. - /// - private Set mPpiList = new HashSet(); - - /// - /// The Guid list which recoreded in module or library surface area and it's - /// dependence on library instance surface area. - /// - private Set mGuidList = new HashSet(); + private Set mGuidCNameList = new HashSet(); /// /// The dependence package list which recoreded in module or library surface @@ -120,6 +108,7 @@ public class AutoGen { private List exitBootServiceList = new ArrayList(); private StringBuffer functionDeclarations = new StringBuffer(10240); + private StringBuffer globalDeclarations = new StringBuffer(10240); // // flag of PcdComponentNameDisable, PcdDriverDiagnosticDisable @@ -347,23 +336,37 @@ public class AutoGen { // // Write library class's related *.h file to autogen.h. // + List libClasses = new ArrayList(100); String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch, null); - if (libClassList.length > 0) { - libClassIncludeH = LibraryClassToAutogenH(libClassList); - item = libClassIncludeH.iterator(); - while (item.hasNext()) { - fileBuffer.append(item.next().toString()); - } + for (int i = 0; i < libClassList.length; ++i) { + libClasses.add(libClassList[i]); } libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch, null); - if (libClassList.length > 0) { - libClassIncludeH = LibraryClassToAutogenH(libClassList); - item = libClassIncludeH.iterator(); - while (item.hasNext()) { - fileBuffer.append(item.next().toString()); + for (int i = 0; i < libClassList.length; ++i) { + libClasses.add(libClassList[i]); + } + // + // Add AutoGen used library class + // + int moduleTypeId = CommonDefinition.getModuleType(moduleType); + if (!libClasses.contains("DebugLib") && moduleTypeId != CommonDefinition.ModuleTypeUnknown + && moduleTypeId != CommonDefinition.ModuleTypeBase) { + libClasses.add("DebugLib"); + } + switch (moduleTypeId) { + case CommonDefinition.ModuleTypeDxeDriver: + case CommonDefinition.ModuleTypeDxeRuntimeDriver: + case CommonDefinition.ModuleTypeDxeSalDriver: + case CommonDefinition.ModuleTypeDxeSmmDriver: + case CommonDefinition.ModuleTypeUefiDriver: + case CommonDefinition.ModuleTypeUefiApplication: + if (!libClasses.contains("UefiBootServicesTableLib")) { + libClasses.add("UefiBootServicesTableLib"); } + break; } + LibraryClassToAutogenH(fileBuffer, libClasses.toArray(new String[libClasses.size()])); fileBuffer.append("\r\n"); // @@ -384,6 +387,7 @@ public class AutoGen { fileBuffer.append(this.myPcdAutogen.getHAutoGenString()); } + fileBuffer.append(globalDeclarations); fileBuffer.append(functionDeclarations); // // Append the #endif at AutoGen.h @@ -426,8 +430,9 @@ public class AutoGen { // DriverBinding/ComponentName/DriverConfiguration/DriverDialog // to AutoGen.c // - - ExternsDriverBindingToAutoGenC(fileBuffer); + if (!moduleId.getModuleType().equalsIgnoreCase("UEFI_APPLICATION")) { + ExternsDriverBindingToAutoGenC(fileBuffer); + } // // Write DriverExitBootServicesEvent/DriverSetVirtualAddressMapEvent @@ -456,8 +461,10 @@ public class AutoGen { // String guid = CommonDefinition.formatGuidName(saq.getModuleGuid()); if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { + globalDeclarations.append("extern GUID gEfiCallerIdGuid;\r\n"); fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {"); - } else { + } else if (!this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_USER_DEFINED)) { + globalDeclarations.append("extern EFI_GUID gEfiCallerIdGuid;\r\n"); fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {"); } @@ -494,11 +501,9 @@ public class AutoGen { } // - // Write consumed ppi, guid, protocol to autogen.c + // Write consumed ppi, guid, protocol, etc to autogen.c // - ProtocolGuidToAutogenC(fileBuffer); - PpiGuidToAutogenC(fileBuffer); - GuidGuidToAutogenC(fileBuffer); + CNameToAutogenC(fileBuffer); // // Call pcd autogen. @@ -584,23 +589,37 @@ public class AutoGen { // // Write library class's related *.h file to autogen.h // + List libClasses = new ArrayList(100); String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch, null); - if (libClassList != null) { - libClassIncludeH = LibraryClassToAutogenH(libClassList); - item = libClassIncludeH.iterator(); - while (item.hasNext()) { - fileBuffer.append(item.next().toString()); - } + for (int i = 0; i < libClassList.length; ++i) { + libClasses.add(libClassList[i]); } libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch, null); - if (libClassList != null) { - libClassIncludeH = LibraryClassToAutogenH(libClassList); - item = libClassIncludeH.iterator(); - while (item.hasNext()) { - fileBuffer.append(item.next().toString()); + for (int i = 0; i < libClassList.length; ++i) { + libClasses.add(libClassList[i]); + } + // + // Add AutoGen used library class + // + int moduleTypeId = CommonDefinition.getModuleType(moduleType); + if (!libClasses.contains("DebugLib") && moduleTypeId != CommonDefinition.ModuleTypeUnknown + && moduleTypeId != CommonDefinition.ModuleTypeBase) { + libClasses.add("DebugLib"); + } + switch (moduleTypeId) { + case CommonDefinition.ModuleTypeDxeDriver: + case CommonDefinition.ModuleTypeDxeRuntimeDriver: + case CommonDefinition.ModuleTypeDxeSalDriver: + case CommonDefinition.ModuleTypeDxeSmmDriver: + case CommonDefinition.ModuleTypeUefiDriver: + case CommonDefinition.ModuleTypeUefiApplication: + if (!libClasses.contains("UefiBootServicesTableLib")) { + libClasses.add("UefiBootServicesTableLib"); } + break; } + LibraryClassToAutogenH(fileBuffer, libClasses.toArray(new String[libClasses.size()])); fileBuffer.append(ToolDefinitions.LINE_SEPARATOR); // @@ -686,9 +705,8 @@ public class AutoGen { build module or library. @return includeStrList List of *.h file. **/ - Set LibraryClassToAutogenH(String[] libClassList) + void LibraryClassToAutogenH(StringBuffer fileBuffer, String[] libClassList) throws EdkException { - Set includeStrList = new LinkedHashSet(); String includeName[]; String str = ""; @@ -707,14 +725,14 @@ public class AutoGen { for (int j = 0; j < includeName.length; j++) { String includeNameStr = includeName[j]; if (includeNameStr != null) { - str = CommonDefinition.INCLUDE + " " + "<"; - str = str + includeNameStr + ">\r\n"; - includeStrList.add(str); + fileBuffer.append(CommonDefinition.INCLUDE); + fileBuffer.append(" <"); + fileBuffer.append(includeNameStr); + fileBuffer.append(">\r\n"); includeNameStr = null; } } } - return includeStrList; } /** @@ -784,13 +802,13 @@ public class AutoGen { if (entryPointList == null ||entryPointList.length != 1 ) { throw new AutoGenException("Module type = 'PEI_CORE', can have only one module entry point!"); } else { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(entryPointList[0]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n"); - fileBuffer.append(" IN VOID *OldCoreData\r\n"); - fileBuffer.append(" );\r\n\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(entryPointList[0]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n"); + functionDeclarations.append(" IN VOID *OldCoreData\r\n"); + functionDeclarations.append(" );\r\n\r\n"); fileBuffer.append("EFI_STATUS\r\n"); fileBuffer.append("EFIAPI\r\n"); @@ -811,12 +829,12 @@ public class AutoGen { if (entryPointList == null || entryPointList.length != 1) { throw new AutoGenException("Module type = 'DXE_CORE', can have only one module entry point!"); } else { - fileBuffer.append("VOID\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(entryPointList[0]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN VOID *HobStart\r\n"); - fileBuffer.append(" );\r\n\r\n"); + functionDeclarations.append("VOID\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(entryPointList[0]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN VOID *HobStart\r\n"); + functionDeclarations.append(" );\r\n\r\n"); fileBuffer.append("VOID\r\n"); fileBuffer.append("EFIAPI\r\n"); @@ -847,13 +865,13 @@ public class AutoGen { break; } for (int i = 0; i < entryPointList.length; i++) { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(entryPointList[i]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); - fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n"); - fileBuffer.append(" );\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(entryPointList[i]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); + functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n"); + functionDeclarations.append(" );\r\n"); entryPointCount++; } @@ -913,13 +931,13 @@ public class AutoGen { } else { for (int i = 0; i < entryPointList.length; i++) { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(entryPointList[i]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n"); - fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n"); - fileBuffer.append(" );\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(entryPointList[i]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n"); + functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n"); + functionDeclarations.append(" );\r\n"); entryPointCount++; } fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = "); @@ -970,11 +988,11 @@ public class AutoGen { unloadImageCount = 0; if (unloadImageList != null) { for (int i = 0; i < unloadImageList.length; i++) { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append(unloadImageList[i]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n"); - fileBuffer.append(" );\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append(unloadImageList[i]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_HANDLE ImageHandle\r\n"); + functionDeclarations.append(" );\r\n"); unloadImageCount++; } } @@ -1045,13 +1063,13 @@ public class AutoGen { } else { for (int i = 0; i < entryPointList.length; i++) { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(entryPointList[i]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n"); - fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n"); - fileBuffer.append(" );\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(entryPointList[i]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n"); + functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n"); + functionDeclarations.append(" );\r\n"); entryPointCount++; } @@ -1105,8 +1123,7 @@ public class AutoGen { fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n"); fileBuffer.append(" ProcessLibraryDestructorList (gImageHandle, gST);\r\n"); fileBuffer.append(" }\r\n"); - fileBuffer - .append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n"); + fileBuffer.append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n"); } else { fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n"); fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n"); @@ -1117,6 +1134,9 @@ public class AutoGen { fileBuffer.append("}\r\n\r\n"); } + if (CommonDefinition.getModuleType(typeStr) == CommonDefinition.ModuleTypeUefiApplication) { + break; + } // // Add ModuleUnloadImage for DxeDriver and UefiDriver module type. // @@ -1129,12 +1149,12 @@ public class AutoGen { unloadImageCount = 0; if (unloadImageList != null) { for (int i = 0; i < unloadImageList.length; i++) { - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(unloadImageList[i]); - fileBuffer.append(" (\r\n"); - fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n"); - fileBuffer.append(" );\r\n"); + functionDeclarations.append("EFI_STATUS\r\n"); + functionDeclarations.append("EFIAPI\r\n"); + functionDeclarations.append(unloadImageList[i]); + functionDeclarations.append(" (\r\n"); + functionDeclarations.append(" IN EFI_HANDLE ImageHandle\r\n"); + functionDeclarations.append(" );\r\n"); unloadImageCount++; } } @@ -1184,153 +1204,50 @@ public class AutoGen { } /** - PpiGuidToAutogenc + CNameToAutogenc - This function gets GUIDs from SPD file accrodeing to information - and write those GUIDs to AutoGen.c. + This function gets GUIDs from SPD file accrodeing to + information and write those GUIDs to AutoGen.c. @param fileBuffer String Buffer for Autogen.c file. - @throws BuildException - Guid must set value! - **/ - void PpiGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException { - String[] cNameGuid = null; - - // - // Get the all PPI adn PPI Notify from MSA file, - // then add those PPI ,and PPI Notify name to list. - // - - String[] ppiList = saq.getPpiArray(this.arch); - for (int i = 0; i < ppiList.length; i++) { - this.mPpiList.add(ppiList[i]); - } - - String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch); - for (int i = 0; i < ppiNotifyList.length; i++) { - this.mPpiList.add(ppiNotifyList[i]); - } - - // - // Find CNAME and GUID from dependence SPD file and write to Autogen.c - // - Iterator ppiIterator = this.mPpiList.iterator(); - String ppiKeyWord = null; - while (ppiIterator.hasNext()) { - ppiKeyWord = ppiIterator.next().toString(); - cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, ppiKeyWord); - if (cNameGuid != null) { - fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID "); - fileBuffer.append(cNameGuid[0]); - fileBuffer.append(" = { "); - fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1])); - fileBuffer.append(" } ;"); - } else { - // - // If can't find Ppi GUID declaration in every package - // - throw new AutoGenException("Can not find Ppi GUID [" - + ppiKeyWord + "] declaration in any SPD package!"); - } - } - } - - /** - ProtocolGuidToAutogenc - - This function gets GUIDs from SPD file accrodeing to - information and write those GUIDs to AutoGen.c. - @param fileBuffer - String Buffer for Autogen.c file. - @throws BuildException - Protocol name must set. **/ - void ProtocolGuidToAutogenC(StringBuffer fileBuffer) throws EdkException { - String[] cNameGuid = null; - - String[] protocolList = saq.getProtocolArray(this.arch); - - // - // Add result to Autogen global list. - // - for (int i = 0; i < protocolList.length; i++) { - this.mProtocolList.add(protocolList[i]); - } - - String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch); - - for (int i = 0; i < protocolNotifyList.length; i++) { - this.mProtocolList.add(protocolNotifyList[i]); - } - - // - // Get the NAME and GUID from dependence SPD and write to Autogen.c - // - Iterator protocolIterator = this.mProtocolList.iterator(); - String protocolKeyWord = null; - - - while (protocolIterator.hasNext()) { - protocolKeyWord = protocolIterator.next().toString(); - cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, protocolKeyWord); - if (cNameGuid != null) { - fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID "); - fileBuffer.append(cNameGuid[0]); - fileBuffer.append(" = { "); - fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1])); - fileBuffer.append(" } ;"); - } else { - // - // If can't find protocol GUID declaration in every package - // - throw new AutoGenException("Can not find protocol Guid [" - + protocolKeyWord + "] declaration in any SPD package!"); - } - } - } - - /** - GuidGuidToAutogenc - - This function gets GUIDs from SPD file accrodeing to information - and write those GUIDs to AutoGen.c. - - @param fileBuffer - String Buffer for Autogen.c file. - - **/ - void GuidGuidToAutogenC(StringBuffer fileBuffer) throws AutoGenException { + void CNameToAutogenC(StringBuffer fileBuffer) throws AutoGenException { String[] cNameGuid = null; String guidKeyWord = null; - String[] guidList = saq.getGuidEntryArray(this.arch); - - for (int i = 0; i < guidList.length; i++) { - this.mGuidList.add(guidList[i]); + String[] cnameList = saq.getCNameArray(this.arch); + for (int i = 0; i < cnameList.length; i++) { + this.mGuidCNameList.add(cnameList[i]); } - Iterator guidIterator = this.mGuidList.iterator(); + Iterator guidIterator = this.mGuidCNameList.iterator(); while (guidIterator.hasNext()) { guidKeyWord = guidIterator.next().toString(); cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord); - - if (cNameGuid != null) { - fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID "); - fileBuffer.append(cNameGuid[0]); - fileBuffer.append(" = { "); - fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1])); - fileBuffer.append("} ;"); - } else { - // - // If can't find GUID declaration in every package - // - throw new AutoGenException("Can not find Guid [" + guidKeyWord - + "] declaration in any SPD package. "); + if (cNameGuid == null) { + cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, guidKeyWord); + if (cNameGuid == null) { + cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, guidKeyWord); + if (cNameGuid == null) { + // + // If can't find GUID declaration in every package, stop the build + // + EdkLog.log(EdkLog.EDK_INFO,"WARN: Can not find Guid [" + guidKeyWord + "] declaration in any SPD file."); + continue; + //throw new AutoGenException("Can not find Guid [" + guidKeyWord + // + "] declaration in any SPD package. "); + } + } } + fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID "); + fileBuffer.append(cNameGuid[0]); + fileBuffer.append(" = { "); + fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1])); + fileBuffer.append("} ;"); } } @@ -1589,8 +1506,7 @@ public class AutoGen { case CommonDefinition.ModuleTypePeiCore: case CommonDefinition.ModuleTypePeim: fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n"); - fileBuffer - .append(" IN EFI_PEI_SERVICES **PeiServices\r\n"); + fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n"); break; case CommonDefinition.ModuleTypeDxeCore: @@ -1798,9 +1714,9 @@ public class AutoGen { // for (int i = 0; i < driverBindingGroup.length; i++) { if (driverBindingGroup[i][0] != null) { - fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL "); - fileBuffer.append(driverBindingGroup[i][0]); - fileBuffer.append(";\r\n"); + globalDeclarations.append("extern EFI_DRIVER_BINDING_PROTOCOL "); + globalDeclarations.append(driverBindingGroup[i][0]); + globalDeclarations.append(";\r\n"); } } @@ -1812,9 +1728,9 @@ public class AutoGen { if (driverBindingGroup[i][1]!= null) { if (driverBindingGroup[i][0] != null) { BitMask |= 0x01; - fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL "); - fileBuffer.append(driverBindingGroup[i][1]); - fileBuffer.append(";\r\n"); + globalDeclarations.append("extern EFI_COMPONENT_NAME_PROTOCOL "); + globalDeclarations.append(driverBindingGroup[i][1]); + globalDeclarations.append(";\r\n"); } else { throw new AutoGenException("DriverBinding can't be empty!!"); } @@ -1829,9 +1745,9 @@ public class AutoGen { if (driverBindingGroup[i][2] != null) { if (driverBindingGroup[i][0] != null) { BitMask |= 0x02; - fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL "); - fileBuffer.append(driverBindingGroup[i][2]); - fileBuffer.append(";\r\n"); + globalDeclarations.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL "); + globalDeclarations.append(driverBindingGroup[i][2]); + globalDeclarations.append(";\r\n"); } else { throw new AutoGenException("DriverBinding can't be empty!!"); } @@ -1846,9 +1762,9 @@ public class AutoGen { if (driverBindingGroup[i][3] != null) { if (driverBindingGroup[i][0] != null) { BitMask |= 0x04; - fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL "); - fileBuffer.append(driverBindingGroup[i][3]); - fileBuffer.append(";\r\n"); + globalDeclarations.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL "); + globalDeclarations.append(driverBindingGroup[i][3]); + globalDeclarations.append(";\r\n"); } else { throw new AutoGenException("DriverBinding can't be empty!!"); } @@ -2038,7 +1954,6 @@ public class AutoGen { case CommonDefinition.ModuleTypeDxeRuntimeDriver: case CommonDefinition.ModuleTypeDxeSalDriver: case CommonDefinition.ModuleTypeUefiDriver: - case CommonDefinition.ModuleTypeUefiApplication: // // If moduleType is one of above, call setVirtualAddressToAutogenC, // and setExitBootServiceToAutogenC. @@ -2144,14 +2059,10 @@ public class AutoGen { + " doesn't support module type " + moduleType); } // - // Get , , list of this library + // Get CName list from , , , etc. of this library // instance. // - String[] ppiList = saq.getPpiArray(this.arch); - String[] ppiNotifyList = saq.getPpiNotifyArray(this.arch); - String[] protocolList = saq.getProtocolArray(this.arch); - String[] protocolNotifyList = saq.getProtocolNotifyArray(this.arch); - String[] guidList = saq.getGuidEntryArray(this.arch); + String[] guidCNameList = saq.getCNameArray(this.arch); PackageIdentification[] pkgList = saq.getDependencePkg(this.arch); // @@ -2159,25 +2070,10 @@ public class AutoGen { // protocol, guid // list. // - for (index = 0; index < ppiList.length; index++) { - this.mPpiList.add(ppiList[index]); + for (index = 0; index < guidCNameList.length; index++) { + this.mGuidCNameList.add(guidCNameList[index]); } - for (index = 0; index < ppiNotifyList.length; index++) { - this.mPpiList.add(ppiNotifyList[index]); - } - - for (index = 0; index < protocolList.length; index++) { - this.mProtocolList.add(protocolList[index]); - } - - for (index = 0; index < protocolNotifyList.length; index++) { - this.mProtocolList.add(protocolNotifyList[index]); - } - - for (index = 0; index < guidList.length; index++) { - this.mGuidList.add(guidList[index]); - } for (index = 0; index < pkgList.length; index++) { if (!this.mDepPkgList.contains(pkgList[index])) { this.mDepPkgList.add(pkgList[index]);