- for (index = 0; index < guidList.length; index++) {\r
- this.mGuidList.add(guidList[index]);\r
- }\r
- for (index = 0; index < pkgList.length; index++){\r
- if (!this.mDepPkgList.contains(pkgList[index])){\r
- this.mDepPkgList.add(pkgList[index]);\r
- }\r
- }\r
-\r
- //\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
-\r
- SurfaceAreaQuery.pop();\r
- //\r
- // Add dependent library instance constructor function.\r
- //\r
- if (libConstructName != null) {\r
- libConstructList.add(libConstructName);\r
- }\r
- //\r
- // Add dependent library instance destructor fuction.\r
- //\r
- if (libDestructName != null) {\r
- libDestructList.add(libDestructName);\r
- }\r
- }\r
-\r
- }\r
-\r
- //\r
- // Add library constructor to AutoGen.c\r
- //\r
- LibConstructorToAutogenC(libConstructList, moduleType,\r
- fileBuffer/* autogenC */);\r
- //\r
- // Add library destructor to AutoGen.c\r
- //\r
- LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer/* autogenC */);\r
- }\r
-\r
- } catch (Exception e) {\r
- throw new BuildException(e.getMessage());\r
- }\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
- void LibConstructorToAutogenC(List<String> libInstanceList,\r
- String moduleType, StringBuffer fileBuffer) throws Exception {\r
- boolean isFirst = true;\r
+ case CommonDefinition.ModuleTypePeiCore:\r
+ case CommonDefinition.ModuleTypePeim:\r
+ fileBuffer.append("EFI_STATUS\r\n");\r
+ fileBuffer.append("EFIAPI\r\n");\r
+ fileBuffer.append(libInstanceList.get(i)[0]);\r
+ fileBuffer.append(" (\r\n");\r
+ fileBuffer\r
+ .append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");\r
+ fileBuffer\r
+ .append(" IN EFI_PEI_SERVICES **PeiServices\r\n");\r
+ fileBuffer.append(" );\r\n");\r
+ break;\r
+ \r
+ case CommonDefinition.ModuleTypeDxeCore:\r
+ case CommonDefinition.ModuleTypeDxeDriver:\r
+ case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
+ case CommonDefinition.ModuleTypeDxeSmmDriver:\r
+ case CommonDefinition.ModuleTypeDxeSalDriver:\r
+ case CommonDefinition.ModuleTypeUefiDriver:\r
+ case CommonDefinition.ModuleTypeUefiApplication:\r
+ fileBuffer.append("EFI_STATUS\r\n");\r
+ fileBuffer.append("EFIAPI\r\n");\r
+ fileBuffer.append(libInstanceList.get(i)[0]);\r
+ fileBuffer.append(" (\r\n");\r
+ fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");\r
+ fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");\r
+ fileBuffer.append(" );\r\n");\r
+ break;\r