+ private void setVirtualAddressToAutogenC(StringBuffer fileBuffer){\r
+ //\r
+ // Entry point lib for these module types needs to know the count\r
+ // of entryPoint.\r
+ //\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
+ int Count = 0;\r
+ int i = 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
+ if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {\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
+ } 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
+ // add the NULL at the end of _gDriverSetVirtualAddressMapEvent list.\r
+ //\r
+ fileBuffer.append(",\r\n NULL");\r
+ fileBuffer.append("\r\n};\r\n\r\n");\r
+ }\r
+ }\r
+\r
+\r
+ private void setExitBootServiceToAutogenC(StringBuffer fileBuffer){\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
+ int Count = 0;\r
+ int i = 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
+ if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {\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
+ } 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
+ \r
+ fileBuffer.append(",\r\n NULL");\r
+ fileBuffer.append("\r\n};\r\n\r\n");\r
+ }\r
+\r
+ }\r
+\r