- fileBuffer.append("\r\n");\r
- isFirst = false;\r
- }\r
- fileBuffer.append(" Status = ");\r
- fileBuffer.append(libInstanceList.get(i));\r
- fileBuffer.append("(ImageHandle, SystemTable);\r\n");\r
- fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");\r
- }\r
- fileBuffer.append("}\r\n");\r
- break;\r
- }\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
- void ExternsDriverBindingToAutoGenC(StringBuffer fileBuffer)\r
- throws BuildException {\r
-\r
- //\r
- // Check what <extern> contains. And the number of following elements\r
- // under <extern> should be same. 1. DRIVER_BINDING 2. COMPONENT_NAME\r
- // 3.DRIVER_CONFIGURATION 4. DRIVER_DIAGNOSTIC\r
- //\r
-\r
- String[] drvBindList = SurfaceAreaQuery.getDriverBindingArray();\r
-\r
- //\r
- // If component name protocol,component configuration protocol,\r
- // component diagnostic protocol is not null or empty, check\r
- // if every one have the same number of the driver binding protocol.\r
- //\r
- if (drvBindList == null || drvBindList.length == 0) {\r
- return;\r
- }\r
-\r
- String[] compNamList = SurfaceAreaQuery.getComponentNameArray();\r
- String[] compConfList = SurfaceAreaQuery.getDriverConfigArray();\r
- String[] compDiagList = SurfaceAreaQuery.getDriverDiagArray();\r
-\r
- int BitMask = 0;\r
-\r
- //\r
- // Write driver binding protocol extern to autogen.c\r
- //\r
- for (int i = 0; i < drvBindList.length; i++) {\r
- fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL ");\r
- fileBuffer.append(drvBindList[i]);\r
- fileBuffer.append(";\r\n");\r
- }\r
-\r
- //\r
- // Write component name protocol extern to autogen.c\r
- //\r
- if (compNamList != null && compNamList.length != 0) {\r
- if (drvBindList.length != compNamList.length) {\r
- throw new BuildException(\r
- "Different number of Driver Binding and Component Name protocols!");\r
- }\r
-\r
- BitMask |= 0x01;\r
- for (int i = 0; i < compNamList.length; i++) {\r
- fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL ");\r
- fileBuffer.append(compNamList[i]);\r
- fileBuffer.append(";\r\n");\r
- }\r
- }\r
-\r
- //\r
- // Write driver configration protocol extern to autogen.c\r
- //\r
- if (compConfList != null && compConfList.length != 0) {\r
- if (drvBindList.length != compConfList.length) {\r
- throw new BuildException(\r
- "Different number of Driver Binding and Driver Configuration protocols!");\r
- }\r
-\r
- BitMask |= 0x02;\r
- for (int i = 0; i < compConfList.length; i++) {\r
- fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");\r
- fileBuffer.append(compConfList[i]);\r
- fileBuffer.append(";\r\n");\r
- }\r
- }\r
-\r
- //\r
- // Write driver dignastic protocol extern to autogen.c\r
- //\r
- if (compDiagList != null && compDiagList.length != 0) {\r
- if (drvBindList.length != compDiagList.length) {\r
- throw new BuildException(\r
- "Different number of Driver Binding and Driver Diagnosis protocols!");\r
- }\r
-\r
- BitMask |= 0x04;\r
- for (int i = 0; i < compDiagList.length; i++) {\r
- fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");\r
- fileBuffer.append(compDiagList[i]);\r
- fileBuffer.append(";\r\n");\r
- }\r
- }\r
-\r
- //\r
- // Write driver module protocol bitmask.\r
- //\r
- fileBuffer\r
- .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverModelProtocolBitmask = ");\r
- fileBuffer.append(Integer.toString(BitMask));\r
- fileBuffer.append(";\r\n");\r
-\r
- //\r
- // Write driver module protocol list entry\r
- //\r
- fileBuffer\r
- .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = ");\r
-\r
- fileBuffer.append(Integer.toString(drvBindList.length));\r
- fileBuffer.append(";\r\n");\r
-\r
- //\r
- // Write drive module protocol list to autogen.c\r
- //\r
- fileBuffer\r
- .append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {");\r
- for (int i = 0; i < drvBindList.length; i++) {\r
- if (i != 0) {\r
- fileBuffer.append(",");\r
- }\r
- fileBuffer.append("\r\n {\r\n");\r
- fileBuffer.append(" &");\r
- fileBuffer.append(drvBindList[i]);\r
- fileBuffer.append(", \r\n");\r
-\r
- if (compNamList != null) {\r
- fileBuffer.append(" &");\r
- fileBuffer.append(compNamList[i]);\r
- fileBuffer.append(", \r\n");\r
- } else {\r
- fileBuffer.append(" NULL, \r\n");\r
- }\r
-\r
- if (compConfList != null) {\r
- fileBuffer.append(" &");\r
- fileBuffer.append(compConfList[i]);\r
- fileBuffer.append(", \r\n");\r
- } else {\r
- fileBuffer.append(" NULL, \r\n");\r
- }\r
-\r
- if (compDiagList != null) {\r
- fileBuffer.append(" &");\r
- fileBuffer.append(compDiagList[i]);\r
- fileBuffer.append(", \r\n");\r
- } else {\r
- fileBuffer.append(" NULL, \r\n");\r
- }\r
- fileBuffer.append(" }");\r
- }\r
- fileBuffer.append("\r\n};\r\n");\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
- void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
- throws BuildException {\r
- String[] setVirtualList = SurfaceAreaQuery\r
- .getSetVirtualAddressMapCallBackArray();\r
- String[] exitBootList = SurfaceAreaQuery\r
- .getExitBootServicesCallBackArray();\r
- String moduleType = SurfaceAreaQuery.getModuleType();\r
- boolean UefiOrDxeModule = false;\r
- int Count = 0;\r
- int i;\r
-\r
- switch (CommonDefinition.getModuleType(moduleType)) {\r
- case CommonDefinition.ModuleTypeDxeDriver:\r
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
- case CommonDefinition.ModuleTypeDxeSalDriver:\r
- case CommonDefinition.ModuleTypeUefiDriver:\r
- case CommonDefinition.ModuleTypeUefiApplication:\r
- //\r
- // Entry point lib for these module types needs to know the count\r
- // of entryPoint.\r
- //\r
- UefiOrDxeModule = true;\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");\r
-\r
- //\r
- // If the list is not valid or has no entries set count to zero else\r
- // set count to the number of valid entries\r
- //\r
- Count = 0;\r
- if (setVirtualList != null) {\r
- for (i = 0; i < setVirtualList.length; i++) {\r
- if (setVirtualList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
- }\r
- Count = i;\r
- }\r
-\r
- fileBuffer.append(Integer.toString(Count));\r
- fileBuffer.append(";\r\n\r\n");\r
- break;\r
- default:\r
- break;\r
- }\r
-\r
- if (setVirtualList == null) {\r
- if (UefiOrDxeModule) {\r
- //\r
- // No data so make a NULL list\r
- //\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");\r
- fileBuffer.append(" NULL\r\n");\r
- fileBuffer.append("};\r\n\r\n");\r
- }\r
- } else {\r
- //\r
- // Write SetVirtualAddressMap function definition.\r
- //\r
- for (i = 0; i < setVirtualList.length; i++) {\r
- if (setVirtualList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
- fileBuffer.append("VOID\r\n");\r
- fileBuffer.append("EFIAPI\r\n");\r
- fileBuffer.append(setVirtualList[i]);\r
- fileBuffer.append(" (\r\n");\r
- fileBuffer.append(" IN EFI_EVENT Event,\r\n");\r
- fileBuffer.append(" IN VOID *Context\r\n");\r
- fileBuffer.append(" );\r\n\r\n");\r
- }\r
-\r
- //\r
- // Write SetVirtualAddressMap entry point array.\r
- //\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");\r
- for (i = 0; i < setVirtualList.length; i++) {\r
- if (setVirtualList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
-\r
- if (i == 0) {\r
- fileBuffer.append("\r\n ");\r
- } else {\r
- fileBuffer.append(",\r\n ");\r
- }\r
-\r
- fileBuffer.append(setVirtualList[i]);\r
- }\r
- //\r
- // If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER\r
- // UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of \r
- // _gDriverSetVirtualAddressMapEvent list. \r
- //\r
- if (!UefiOrDxeModule) {\r
- fileBuffer.append(",\r\n NULL");\r
- }\r
- fileBuffer.append("\r\n};\r\n\r\n");\r
- }\r
-\r
- if (UefiOrDxeModule) {\r
- //\r
- // Entry point lib for these module types needs to know the count.\r
- //\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverExitBootServicesEventCount = ");\r
-\r
- //\r
- // If the list is not valid or has no entries set count to zero else\r
- // set count to the number of valid entries.\r
- //\r
- Count = 0;\r
- if (exitBootList != null) {\r
- for (i = 0; i < exitBootList.length; i++) {\r
- if (exitBootList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
- }\r
- Count = i;\r
- }\r
- fileBuffer.append(Integer.toString(Count));\r
- fileBuffer.append(";\r\n\r\n");\r
- }\r
-\r
- if (exitBootList == null) {\r
- if (UefiOrDxeModule) {\r
- //\r
- // No data so make a NULL list.\r
- //\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");\r
- fileBuffer.append(" NULL\r\n");\r
- fileBuffer.append("};\r\n\r\n");\r
- }\r
- } else {\r
- //\r
- // Write DriverExitBootServices function definition.\r
- //\r
- for (i = 0; i < exitBootList.length; i++) {\r
- if (exitBootList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
-\r
- fileBuffer.append("VOID\r\n");\r
- fileBuffer.append("EFIAPI\r\n");\r
- fileBuffer.append(exitBootList[i]);\r
- fileBuffer.append(" (\r\n");\r
- fileBuffer.append(" IN EFI_EVENT Event,\r\n");\r
- fileBuffer.append(" IN VOID *Context\r\n");\r
- fileBuffer.append(" );\r\n\r\n");\r
- }\r
-\r
- //\r
- // Write DriverExitBootServices entry point array.\r
- //\r
- fileBuffer\r
- .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");\r
- for (i = 0; i < exitBootList.length; i++) {\r
- if (exitBootList[i].equalsIgnoreCase("")) {\r
- break;\r
- }\r
-\r
- if (i == 0) {\r
- fileBuffer.append("\r\n ");\r
- } else {\r
- fileBuffer.append(",\r\n ");\r
- }\r
- fileBuffer.append(exitBootList[i]);\r
- }\r
- if (!UefiOrDxeModule) {\r
- fileBuffer.append(",\r\n NULL");\r
- }\r
- fileBuffer.append("\r\n};\r\n\r\n");\r
- }\r
-\r
- }\r
+ fileBuffer.append("\r\n");\r
+ isFirst = false;\r
+ }\r
+ fileBuffer.append(" Status = ");\r
+ fileBuffer.append(libInstanceList.get(i));\r
+ fileBuffer.append("(ImageHandle, SystemTable);\r\n");\r
+ fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");\r
+ }\r
+ fileBuffer.append("}\r\n");\r
+ break;\r
+ }\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
+ void ExternsDriverBindingToAutoGenC(StringBuffer fileBuffer)\r
+ throws BuildException {\r
+\r
+ //\r
+ // Check what <extern> contains. And the number of following elements\r
+ // under <extern> should be same. 1. DRIVER_BINDING 2. COMPONENT_NAME\r
+ // 3.DRIVER_CONFIGURATION 4. DRIVER_DIAGNOSTIC\r
+ //\r
+\r
+ String[] drvBindList = SurfaceAreaQuery.getDriverBindingArray();\r
+\r
+ //\r
+ // If component name protocol,component configuration protocol,\r
+ // component diagnostic protocol is not null or empty, check\r
+ // if every one have the same number of the driver binding protocol.\r
+ //\r
+ if (drvBindList == null || drvBindList.length == 0) {\r
+ return;\r
+ }\r
+\r
+ String[] compNamList = SurfaceAreaQuery.getComponentNameArray();\r
+ String[] compConfList = SurfaceAreaQuery.getDriverConfigArray();\r
+ String[] compDiagList = SurfaceAreaQuery.getDriverDiagArray();\r
+\r
+ int BitMask = 0;\r
+\r
+ //\r
+ // Write driver binding protocol extern to autogen.c\r
+ //\r
+ for (int i = 0; i < drvBindList.length; i++) {\r
+ fileBuffer.append("extern EFI_DRIVER_BINDING_PROTOCOL ");\r
+ fileBuffer.append(drvBindList[i]);\r
+ fileBuffer.append(";\r\n");\r
+ }\r
+\r
+ //\r
+ // Write component name protocol extern to autogen.c\r
+ //\r
+ if (compNamList != null && compNamList.length != 0) {\r
+ if (drvBindList.length != compNamList.length) {\r
+ throw new BuildException(\r
+ "Different number of Driver Binding and Component Name protocols!");\r
+ }\r
+\r
+ BitMask |= 0x01;\r
+ for (int i = 0; i < compNamList.length; i++) {\r
+ fileBuffer.append("extern EFI_COMPONENT_NAME_PROTOCOL ");\r
+ fileBuffer.append(compNamList[i]);\r
+ fileBuffer.append(";\r\n");\r
+ }\r
+ }\r
+\r
+ //\r
+ // Write driver configration protocol extern to autogen.c\r
+ //\r
+ if (compConfList != null && compConfList.length != 0) {\r
+ if (drvBindList.length != compConfList.length) {\r
+ throw new BuildException(\r
+ "Different number of Driver Binding and Driver Configuration protocols!");\r
+ }\r
+\r
+ BitMask |= 0x02;\r
+ for (int i = 0; i < compConfList.length; i++) {\r
+ fileBuffer.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");\r
+ fileBuffer.append(compConfList[i]);\r
+ fileBuffer.append(";\r\n");\r
+ }\r
+ }\r
+\r
+ //\r
+ // Write driver dignastic protocol extern to autogen.c\r
+ //\r
+ if (compDiagList != null && compDiagList.length != 0) {\r
+ if (drvBindList.length != compDiagList.length) {\r
+ throw new BuildException(\r
+ "Different number of Driver Binding and Driver Diagnosis protocols!");\r
+ }\r
+\r
+ BitMask |= 0x04;\r
+ for (int i = 0; i < compDiagList.length; i++) {\r
+ fileBuffer.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");\r
+ fileBuffer.append(compDiagList[i]);\r
+ fileBuffer.append(";\r\n");\r
+ }\r
+ }\r
+\r
+ //\r
+ // Write driver module protocol bitmask.\r
+ //\r
+ fileBuffer\r
+ .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverModelProtocolBitmask = ");\r
+ fileBuffer.append(Integer.toString(BitMask));\r
+ fileBuffer.append(";\r\n");\r
+\r
+ //\r
+ // Write driver module protocol list entry\r
+ //\r
+ fileBuffer\r
+ .append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = ");\r
+\r
+ fileBuffer.append(Integer.toString(drvBindList.length));\r
+ fileBuffer.append(";\r\n");\r
+\r
+ //\r
+ // Write drive module protocol list to autogen.c\r
+ //\r
+ fileBuffer\r
+ .append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {");\r
+ for (int i = 0; i < drvBindList.length; i++) {\r
+ if (i != 0) {\r
+ fileBuffer.append(",");\r
+ }\r
+ fileBuffer.append("\r\n {\r\n");\r
+ fileBuffer.append(" &");\r
+ fileBuffer.append(drvBindList[i]);\r
+ fileBuffer.append(", \r\n");\r
+\r
+ if (compNamList != null) {\r
+ fileBuffer.append(" &");\r
+ fileBuffer.append(compNamList[i]);\r
+ fileBuffer.append(", \r\n");\r
+ } else {\r
+ fileBuffer.append(" NULL, \r\n");\r
+ }\r
+\r
+ if (compConfList != null) {\r
+ fileBuffer.append(" &");\r
+ fileBuffer.append(compConfList[i]);\r
+ fileBuffer.append(", \r\n");\r
+ } else {\r
+ fileBuffer.append(" NULL, \r\n");\r
+ }\r
+\r
+ if (compDiagList != null) {\r
+ fileBuffer.append(" &");\r
+ fileBuffer.append(compDiagList[i]);\r
+ fileBuffer.append(", \r\n");\r
+ } else {\r
+ fileBuffer.append(" NULL, \r\n");\r
+ }\r
+ fileBuffer.append(" }");\r
+ }\r
+ fileBuffer.append("\r\n};\r\n");\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
+ void ExternCallBackToAutoGenC(StringBuffer fileBuffer)\r
+ throws BuildException {\r
+ //\r
+ // Collect module's <SetVirtualAddressMapCallBack> and\r
+ // <ExitBootServiceCallBack> and add to setVirtualAddList\r
+ // exitBootServiceList.\r
+ //\r
+ String[] setVirtuals = SurfaceAreaQuery.getSetVirtualAddressMapCallBackArray();\r
+ String[] exitBoots = SurfaceAreaQuery.getExitBootServicesCallBackArray();\r
+ if (setVirtuals != null) {\r
+ for (int j = 0; j < setVirtuals.length; j++) {\r
+ this.setVirtalAddList.add(setVirtuals[j]);\r
+ }\r
+ }\r
+ if (exitBoots != null) {\r
+ for (int k = 0; k < exitBoots.length; k++) {\r
+ this.exitBootServiceList.add(exitBoots[k]);\r
+ }\r
+ }\r
+ //\r
+ // Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>\r
+ // and <ExitBootServicesCallBack>\r
+ //\r
+ String moduleType = this.moduleId.getModuleType();\r
+ boolean UefiOrDxeModule = false;\r
+ int Count = 0;\r
+ int i;\r
+ switch (CommonDefinition.getModuleType(moduleType)) {\r
+ case CommonDefinition.ModuleTypeDxeDriver:\r
+ case CommonDefinition.ModuleTypeDxeRuntimeDriver:\r
+ case CommonDefinition.ModuleTypeDxeSalDriver:\r
+ case CommonDefinition.ModuleTypeUefiDriver:\r
+ case CommonDefinition.ModuleTypeUefiApplication:\r
+ //\r
+ // Entry point lib for these module types needs to know the count\r
+ // of entryPoint.\r
+ //\r
+ UefiOrDxeModule = true;\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");\r
+\r
+ //\r
+ // If the list is not valid or has no entries set count to zero else\r
+ // set count to the number of valid entries\r
+ //\r
+ Count = 0;\r
+ if (this.setVirtalAddList != null) {\r
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+ }\r
+ Count = i;\r
+ }\r
+\r
+ fileBuffer.append(Integer.toString(Count));\r
+ fileBuffer.append(";\r\n\r\n");\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+\r
+ if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {\r
+ if (UefiOrDxeModule) {\r
+ //\r
+ // No data so make a NULL list\r
+ //\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");\r
+ fileBuffer.append(" NULL\r\n");\r
+ fileBuffer.append("};\r\n\r\n");\r
+ }\r
+ } else {\r
+ //\r
+ // Write SetVirtualAddressMap function definition.\r
+ //\r
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+ fileBuffer.append("VOID\r\n");\r
+ fileBuffer.append("EFIAPI\r\n");\r
+ fileBuffer.append(this.setVirtalAddList.get(i));\r
+ fileBuffer.append(" (\r\n");\r
+ fileBuffer.append(" IN EFI_EVENT Event,\r\n");\r
+ fileBuffer.append(" IN VOID *Context\r\n");\r
+ fileBuffer.append(" );\r\n\r\n");\r
+ }\r
+\r
+ //\r
+ // Write SetVirtualAddressMap entry point array.\r
+ //\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");\r
+ for (i = 0; i < this.setVirtalAddList.size(); i++) {\r
+ if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+\r
+ if (i == 0) {\r
+ fileBuffer.append("\r\n ");\r
+ } else {\r
+ fileBuffer.append(",\r\n ");\r
+ }\r
+\r
+ fileBuffer.append(this.setVirtalAddList.get(i));\r
+ }\r
+ //\r
+ // If module is not DXE_DRIVER, DXE_RUNTIME_DIRVER, UEFI_DRIVER\r
+ // UEFI_APPLICATION and DXE_SAL_DRIVER add the NULL at the end of\r
+ // _gDriverSetVirtualAddressMapEvent list.\r
+ //\r
+ if (!UefiOrDxeModule) {\r
+ fileBuffer.append(",\r\n NULL");\r
+ }\r
+ fileBuffer.append("\r\n};\r\n\r\n");\r
+ }\r
+\r
+ if (UefiOrDxeModule) {\r
+ //\r
+ // Entry point lib for these module types needs to know the count.\r
+ //\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverExitBootServicesEventCount = ");\r
+\r
+ //\r
+ // If the list is not valid or has no entries set count to zero else\r
+ // set count to the number of valid entries.\r
+ //\r
+ Count = 0;\r
+ if (this.exitBootServiceList != null) {\r
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+ }\r
+ Count = i;\r
+ }\r
+ fileBuffer.append(Integer.toString(Count));\r
+ fileBuffer.append(";\r\n\r\n");\r
+ }\r
+\r
+ if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {\r
+ if (UefiOrDxeModule) {\r
+ //\r
+ // No data so make a NULL list.\r
+ //\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");\r
+ fileBuffer.append(" NULL\r\n");\r
+ fileBuffer.append("};\r\n\r\n");\r
+ }\r
+ } else {\r
+ //\r
+ // Write DriverExitBootServices function definition.\r
+ //\r
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+\r
+ fileBuffer.append("VOID\r\n");\r
+ fileBuffer.append("EFIAPI\r\n");\r
+ fileBuffer.append(this.exitBootServiceList.get(i));\r
+ fileBuffer.append(" (\r\n");\r
+ fileBuffer.append(" IN EFI_EVENT Event,\r\n");\r
+ fileBuffer.append(" IN VOID *Context\r\n");\r
+ fileBuffer.append(" );\r\n\r\n");\r
+ }\r
+\r
+ //\r
+ // Write DriverExitBootServices entry point array.\r
+ //\r
+ fileBuffer\r
+ .append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");\r
+ for (i = 0; i < this.exitBootServiceList.size(); i++) {\r
+ if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {\r
+ break;\r
+ }\r
+\r
+ if (i == 0) {\r
+ fileBuffer.append("\r\n ");\r
+ } else {\r
+ fileBuffer.append(",\r\n ");\r
+ }\r
+ fileBuffer.append(this.exitBootServiceList.get(i));\r
+ }\r
+ if (!UefiOrDxeModule) {\r
+ fileBuffer.append(",\r\n NULL");\r
+ }\r
+ fileBuffer.append("\r\n};\r\n\r\n");\r
+ }\r
+\r
+ }\r