X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fautogen%2FAutoGen.java;h=0d757b923b1c4b769096326b074db54482fdbf83;hb=2f4035206ec94f900ec5b2dfd852e62fa48da0eb;hp=cf83a871c5c262563d4d50f223eff1fc568dca6b;hpb=61528a1be326a5a7ddd7cbcac16f91c4e62060b3;p=mirror_edk2.git diff --git a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java index cf83a871c5..0d757b923b 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java +++ b/Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java @@ -34,15 +34,16 @@ import java.util.Set; import org.apache.tools.ant.BuildException; import org.apache.xmlbeans.XmlObject; -import org.tianocore.build.exception.*; +import org.tianocore.build.exception.AutoGenException; import org.tianocore.build.global.GlobalData; import org.tianocore.build.global.SurfaceAreaQuery; import org.tianocore.build.id.ModuleIdentification; import org.tianocore.build.id.PackageIdentification; import org.tianocore.build.pcd.action.PCDAutoGenAction; -import org.tianocore.common.logger.EdkLog; import org.tianocore.common.definitions.ToolDefinitions; +import org.tianocore.common.definitions.EdkDefinitions; import org.tianocore.common.exception.EdkException; +import org.tianocore.common.logger.EdkLog; /** This class is to generate Autogen.h and Autogen.c according to module surface @@ -106,10 +107,11 @@ public class AutoGen { /// /// For non library module, add its library instance's construct and destructor to - /// list. + /// list. String[0] recode LibConstructor name, String[1] recode Lib instance + /// module type. /// - private List libConstructList = new ArrayList(); - private List libDestructList = new ArrayList(); + private List libConstructList = new ArrayList(); + private List libDestructList = new ArrayList(); /// /// List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack @@ -118,6 +120,8 @@ public class AutoGen { private List exitBootServiceList = new ArrayList(); private SurfaceAreaQuery saq = null; + + private ModuleIdentification parentId = null; /** Construct function @@ -133,12 +137,13 @@ public class AutoGen { @param arch Target architecture. **/ - public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch, SurfaceAreaQuery saq) { + public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch, SurfaceAreaQuery saq, ModuleIdentification parentId) { this.outputPath = outputPath; this.moduleId = moduleId; this.arch = arch; this.fvDir = fvDir; this.saq = saq; + this.parentId = parentId; } /** @@ -447,9 +452,14 @@ public class AutoGen { // Write Guid to autogen.c // String guid = CommonDefinition.formatGuidName(saq.getModuleGuid()); - - fileBuffer - .append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {"); + if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { + fileBuffer + .append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {"); + } else { + fileBuffer + .append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {"); + } + if (guid == null) { throw new AutoGenException("Guid value must set!\n"); } @@ -496,7 +506,8 @@ public class AutoGen { arch, false, null, - pcdDriverType); + pcdDriverType, + parentId); this.myPcdAutogen.execute(); if (this.myPcdAutogen != null) { @@ -653,7 +664,8 @@ public class AutoGen { arch, true, saq.getModulePcdEntryNameArray(), - pcdDriverType); + pcdDriverType, + parentId); this.myPcdAutogen.execute(); if (this.myPcdAutogen != null) { fileBuffer.append(ToolDefinitions.LINE_SEPARATOR); @@ -776,7 +788,6 @@ public class AutoGen { "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 @@ -809,7 +820,6 @@ public class AutoGen { } else { fileBuffer.append("VOID\r\n"); - fileBuffer.append("EFIAPI\r\n"); fileBuffer.append(entryPointList[0]); fileBuffer.append(" (\n"); fileBuffer.append(" IN VOID *HobStart\r\n"); @@ -846,7 +856,6 @@ public class AutoGen { } 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 @@ -915,7 +924,6 @@ 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"); @@ -982,7 +990,6 @@ public class AutoGen { 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 @@ -1062,7 +1069,6 @@ public class AutoGen { 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"); @@ -1399,7 +1405,7 @@ public class AutoGen { String buffer for AutoGen.c @throws Exception **/ - void LibConstructorToAutogenC(List libInstanceList, + void LibConstructorToAutogenC(List libInstanceList, String moduleType, StringBuffer fileBuffer) throws EdkException { boolean isFirst = true; @@ -1408,44 +1414,54 @@ public class AutoGen { // module type. // for (int i = 0; i < libInstanceList.size(); i++) { - switch (CommonDefinition.getModuleType(moduleType)) { - case CommonDefinition.ModuleTypeBase: - fileBuffer.append("RETURN_STATUS\r\n"); + if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { + fileBuffer.append("RETURN_STATUS\r\n"); fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(i)); + fileBuffer.append(libInstanceList.get(i)[0]); fileBuffer.append(" (\r\n"); fileBuffer.append(" VOID\r\n"); fileBuffer.append(" );\r\n"); - break; - - case CommonDefinition.ModuleTypePeiCore: - case CommonDefinition.ModuleTypePeim: - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(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"); - break; + } else { + switch (CommonDefinition.getModuleType(moduleType)) { + case CommonDefinition.ModuleTypeBase: + fileBuffer.append("RETURN_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append(" (\r\n"); + fileBuffer.append(" VOID\r\n"); + fileBuffer.append(" );\r\n"); + break; - case CommonDefinition.ModuleTypeDxeCore: - case CommonDefinition.ModuleTypeDxeDriver: - case CommonDefinition.ModuleTypeDxeRuntimeDriver: - case CommonDefinition.ModuleTypeDxeSmmDriver: - case CommonDefinition.ModuleTypeDxeSalDriver: - case CommonDefinition.ModuleTypeUefiDriver: - case CommonDefinition.ModuleTypeUefiApplication: - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(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"); - break; + case CommonDefinition.ModuleTypePeiCore: + case CommonDefinition.ModuleTypePeim: + fileBuffer.append("EFI_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + 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"); + break; + + case CommonDefinition.ModuleTypeDxeCore: + case CommonDefinition.ModuleTypeDxeDriver: + case CommonDefinition.ModuleTypeDxeRuntimeDriver: + case CommonDefinition.ModuleTypeDxeSmmDriver: + case CommonDefinition.ModuleTypeDxeSalDriver: + case CommonDefinition.ModuleTypeUefiDriver: + case CommonDefinition.ModuleTypeUefiApplication: + fileBuffer.append("EFI_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + 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"); + break; + + } } } @@ -1494,32 +1510,38 @@ public class AutoGen { fileBuffer.append("\r\n"); isFirst = false; } - switch (CommonDefinition.getModuleType(moduleType)) { - case CommonDefinition.ModuleTypeBase: + if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { fileBuffer.append(" Status = "); - fileBuffer.append(libInstanceList.get(i)); + fileBuffer.append(libInstanceList.get(i)[0]); fileBuffer.append("();\r\n"); - fileBuffer.append(" VOID\r\n"); - break; - case CommonDefinition.ModuleTypePeiCore: - case CommonDefinition.ModuleTypePeim: - fileBuffer.append(" Status = "); - fileBuffer.append(libInstanceList.get(i)); - fileBuffer.append(" (FfsHeader, PeiServices);\r\n"); - break; - case CommonDefinition.ModuleTypeDxeCore: - case CommonDefinition.ModuleTypeDxeDriver: - case CommonDefinition.ModuleTypeDxeRuntimeDriver: - case CommonDefinition.ModuleTypeDxeSmmDriver: - case CommonDefinition.ModuleTypeDxeSalDriver: - case CommonDefinition.ModuleTypeUefiDriver: - case CommonDefinition.ModuleTypeUefiApplication: - fileBuffer.append(" Status = "); - fileBuffer.append(libInstanceList.get(i)); - fileBuffer.append(" (ImageHandle, SystemTable);\r\n"); - break; - default: - EdkLog.log(EdkLog.EDK_INFO,"Autogen doesn't know how to deal with module type - " + moduleType + "!"); + } else { + switch (CommonDefinition.getModuleType(moduleType)) { + case CommonDefinition.ModuleTypeBase: + fileBuffer.append(" Status = "); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append("();\r\n"); + break; + case CommonDefinition.ModuleTypePeiCore: + case CommonDefinition.ModuleTypePeim: + fileBuffer.append(" Status = "); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append(" (FfsHeader, PeiServices);\r\n"); + break; + case CommonDefinition.ModuleTypeDxeCore: + case CommonDefinition.ModuleTypeDxeDriver: + case CommonDefinition.ModuleTypeDxeRuntimeDriver: + case CommonDefinition.ModuleTypeDxeSmmDriver: + case CommonDefinition.ModuleTypeDxeSalDriver: + case CommonDefinition.ModuleTypeUefiDriver: + case CommonDefinition.ModuleTypeUefiApplication: + fileBuffer.append(" Status = "); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append(" (ImageHandle, SystemTable);\r\n"); + break; + default: + EdkLog.log(EdkLog.EDK_INFO,"Autogen doesn't know how to deal with module type - " + moduleType + "!"); + } + } fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n"); } @@ -1540,46 +1562,55 @@ public class AutoGen { String buffer for AutoGen.c @throws Exception **/ - void LibDestructorToAutogenC(List libInstanceList, + void LibDestructorToAutogenC(List libInstanceList, String moduleType, StringBuffer fileBuffer) throws EdkException { boolean isFirst = true; for (int i = 0; i < libInstanceList.size(); i++) { - switch (CommonDefinition.getModuleType(moduleType)) { - case CommonDefinition.ModuleTypeBase: + if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { fileBuffer.append("RETURN_STATUS\r\n"); fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(i)); + fileBuffer.append(libInstanceList.get(i)[0]); fileBuffer.append(" (\r\n"); fileBuffer.append(" VOID\r\n"); fileBuffer.append(" );\r\n"); - break; - case CommonDefinition.ModuleTypePeiCore: - case CommonDefinition.ModuleTypePeim: - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(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"); - break; - case CommonDefinition.ModuleTypeDxeCore: - case CommonDefinition.ModuleTypeDxeDriver: - case CommonDefinition.ModuleTypeDxeRuntimeDriver: - case CommonDefinition.ModuleTypeDxeSmmDriver: - case CommonDefinition.ModuleTypeDxeSalDriver: - case CommonDefinition.ModuleTypeUefiDriver: - case CommonDefinition.ModuleTypeUefiApplication: - fileBuffer.append("EFI_STATUS\r\n"); - fileBuffer.append("EFIAPI\r\n"); - fileBuffer.append(libInstanceList.get(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"); - break; + } else { + switch (CommonDefinition.getModuleType(moduleType)) { + case CommonDefinition.ModuleTypeBase: + fileBuffer.append("RETURN_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append(" (\r\n"); + fileBuffer.append(" VOID\r\n"); + fileBuffer.append(" );\r\n"); + break; + case CommonDefinition.ModuleTypePeiCore: + case CommonDefinition.ModuleTypePeim: + fileBuffer.append("EFI_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + 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"); + break; + case CommonDefinition.ModuleTypeDxeCore: + case CommonDefinition.ModuleTypeDxeDriver: + case CommonDefinition.ModuleTypeDxeRuntimeDriver: + case CommonDefinition.ModuleTypeDxeSmmDriver: + case CommonDefinition.ModuleTypeDxeSalDriver: + case CommonDefinition.ModuleTypeUefiDriver: + case CommonDefinition.ModuleTypeUefiApplication: + fileBuffer.append("EFI_STATUS\r\n"); + fileBuffer.append("EFIAPI\r\n"); + fileBuffer.append(libInstanceList.get(i)[0]); + 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"); + break; + } } } @@ -1616,10 +1647,17 @@ public class AutoGen { fileBuffer.append("\r\n"); isFirst = false; } - fileBuffer.append(" Status = "); - fileBuffer.append(libInstanceList.get(i)); - fileBuffer.append("(ImageHandle, SystemTable);\r\n"); - fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n"); + if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) { + fileBuffer.append(" Status = "); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append("();\r\n"); + fileBuffer.append(" VOID\r\n"); + } else { + fileBuffer.append(" Status = "); + fileBuffer.append(libInstanceList.get(i)[0]); + fileBuffer.append("(ImageHandle, SystemTable);\r\n"); + fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n"); + } } fileBuffer.append("}\r\n"); break; @@ -1639,88 +1677,76 @@ public class AutoGen { throws EdkException { // - // Check what contains. And the number of following elements - // under should be same. 1. DRIVER_BINDING 2. COMPONENT_NAME - // 3.DRIVER_CONFIGURATION 4. DRIVER_DIAGNOSTIC - // + // Get the arry of extern. The driverBindingGroup is a 2 dimension array. + // The second dimension is include following element: DriverBinding, + // ComponentName, DriverConfiguration, DriverDiag; + // + String[][] driverBindingGroup = this.saq.getExternProtocolGroup(); - String[] drvBindList = saq.getDriverBindingArray(); - - // - // If component name protocol,component configuration protocol, - // component diagnostic protocol is not null or empty, check - // if every one have the same number of the driver binding protocol. // - if (drvBindList == null || drvBindList.length == 0) { - return; - } - - String[] compNamList = saq.getComponentNameArray(); - String[] compConfList = saq.getDriverConfigArray(); - String[] compDiagList = saq.getDriverDiagArray(); - + // inital BitMask; + // int BitMask = 0; // // Write driver binding protocol extern to autogen.c // - for (int i = 0; i < drvBindList.length; i++) { - fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL "); - fileBuffer.append(drvBindList[i]); - fileBuffer.append(";\r\n"); + 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"); + } } // // Write component name protocol extern to autogen.c // - if (compNamList != null && compNamList.length != 0) { - if (drvBindList.length != compNamList.length) { - throw new AutoGenException( - "Different number of Driver Binding and Component Name protocols!"); - } - - BitMask |= 0x01; - for (int i = 0; i < compNamList.length; i++) { - fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL "); - fileBuffer.append(compNamList[i]); - fileBuffer.append(";\r\n"); - } - } + for (int i = 0; i < driverBindingGroup.length; i++) { + 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"); + } else { + throw new AutoGenException("DriverBinding can't be empty!!"); + } + } + } // // Write driver configration protocol extern to autogen.c // - if (compConfList != null && compConfList.length != 0) { - if (drvBindList.length != compConfList.length) { - throw new AutoGenException( - "Different number of Driver Binding and Driver Configuration protocols!"); - } - - BitMask |= 0x02; - for (int i = 0; i < compConfList.length; i++) { - fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL "); - fileBuffer.append(compConfList[i]); - fileBuffer.append(";\r\n"); - } - } - + for (int i = 0; i < driverBindingGroup.length; i++) { + 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"); + } else { + throw new AutoGenException("DriverBinding can't be empty!!"); + } + } + } + // // Write driver dignastic protocol extern to autogen.c // - if (compDiagList != null && compDiagList.length != 0) { - if (drvBindList.length != compDiagList.length) { - throw new AutoGenException( - "Different number of Driver Binding and Driver Diagnosis protocols!"); - } - - BitMask |= 0x04; - for (int i = 0; i < compDiagList.length; i++) { - fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL "); - fileBuffer.append(compDiagList[i]); - fileBuffer.append(";\r\n"); - } - } - + for (int i = 0; i < driverBindingGroup.length; i++) { + 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"); + } else { + throw new AutoGenException("DriverBinding can't be empty!!"); + } + } + } + // // Write driver module protocol bitmask. // @@ -1735,49 +1761,58 @@ public class AutoGen { fileBuffer .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = "); - fileBuffer.append(Integer.toString(drvBindList.length)); + fileBuffer.append(Integer.toString(driverBindingGroup.length)); fileBuffer.append(";\r\n"); // // Write drive module protocol list to autogen.c // - fileBuffer + if (driverBindingGroup.length > 0) { + fileBuffer .append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {"); - for (int i = 0; i < drvBindList.length; i++) { + } + + + for (int i = 0; i < driverBindingGroup.length; i++) { if (i != 0) { fileBuffer.append(","); } - fileBuffer.append("\r\n {\r\n"); + + fileBuffer.append("\r\n {\r\n"); fileBuffer.append(" &"); - fileBuffer.append(drvBindList[i]); + fileBuffer.append(driverBindingGroup[i][0]); fileBuffer.append(", \r\n"); + - if (compNamList != null) { + if (driverBindingGroup[i][1] != null) { fileBuffer.append(" &"); - fileBuffer.append(compNamList[i]); + fileBuffer.append(driverBindingGroup[i][1]); fileBuffer.append(", \r\n"); } else { fileBuffer.append(" NULL, \r\n"); } - if (compConfList != null) { + if (driverBindingGroup[i][2] != null) { fileBuffer.append(" &"); - fileBuffer.append(compConfList[i]); + fileBuffer.append(driverBindingGroup[i][2]); fileBuffer.append(", \r\n"); } else { fileBuffer.append(" NULL, \r\n"); } - if (compDiagList != null) { + if (driverBindingGroup[i][3] != null) { fileBuffer.append(" &"); - fileBuffer.append(compDiagList[i]); + fileBuffer.append(driverBindingGroup[i][3]); fileBuffer.append(", \r\n"); } else { fileBuffer.append(" NULL, \r\n"); } fileBuffer.append(" }"); } - fileBuffer.append("\r\n};\r\n"); + + if (driverBindingGroup.length > 0) { + fileBuffer.append("\r\n};\r\n"); + } } /** @@ -1884,6 +1919,7 @@ public class AutoGen { String libConstructName = null; String libDestructName = null; + String libModuleType = null; String[] setVirtuals = null; String[] exitBoots = null; @@ -1962,6 +1998,7 @@ public class AutoGen { // libConstructName = saq.getLibConstructorName(); libDestructName = saq.getLibDestructorName(); + libModuleType = saq.getModuleType(); // // Collect SetVirtualAddressMapCallBack and @@ -1984,13 +2021,13 @@ public class AutoGen { // Add dependent library instance constructor function. // if (libConstructName != null) { - this.libConstructList.add(libConstructName); + this.libConstructList.add(new String[] {libConstructName, libModuleType}); } // // Add dependent library instance destructor fuction. // if (libDestructName != null) { - this.libDestructList.add(libDestructName); + this.libDestructList.add(new String[] {libDestructName, libModuleType}); } } }