]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Restored the SetVirtualAddress and SetExitBootService related code generation for...
[mirror_edk2.git] / Tools / Java / Source / GenBuild / org / tianocore / build / autogen / AutoGen.java
index e3e6ff54fec2ab6657051dc2cbc0d12e7fcd1740..ad69f07c132f67a73aacca9387f230a214a7e1a8 100644 (file)
@@ -430,8 +430,9 @@ public class AutoGen {
         // DriverBinding/ComponentName/DriverConfiguration/DriverDialog\r
         // to AutoGen.c\r
         //\r
-\r
-        ExternsDriverBindingToAutoGenC(fileBuffer);\r
+        if (!moduleId.getModuleType().equalsIgnoreCase("UEFI_APPLICATION")) {\r
+            ExternsDriverBindingToAutoGenC(fileBuffer);\r
+        }\r
 \r
         //\r
         // Write DriverExitBootServicesEvent/DriverSetVirtualAddressMapEvent\r
@@ -1099,7 +1100,11 @@ public class AutoGen {
                         if (!entryPointList[i].equals("")) {\r
                             fileBuffer.append("  if (SetJump (&mJumpContext) == 0) {\r\n");\r
                             fileBuffer.append(String.format("    " + debugStr, entryPointList[i], entryPointList[i]));\r
-                            fileBuffer.append("    ExitDriver (");\r
+                            if (CommonDefinition.getModuleType(typeStr) == CommonDefinition.ModuleTypeUefiApplication) {\r
+                                fileBuffer.append("    Exit (");\r
+                            } else {\r
+                                fileBuffer.append("    ExitDriver (");\r
+                            }\r
                             fileBuffer.append(entryPointList[i]);\r
                             fileBuffer.append(" (ImageHandle, SystemTable));\r\n");\r
                             fileBuffer.append("    ASSERT (FALSE);\r\n");\r
@@ -1112,27 +1117,32 @@ public class AutoGen {
                 }\r
                 fileBuffer.append("}\r\n\r\n");\r
 \r
-                fileBuffer.append("VOID\r\n");\r
-                fileBuffer.append("EFIAPI\r\n");\r
-                fileBuffer.append("ExitDriver (\r\n");\r
-                fileBuffer.append("  IN EFI_STATUS  Status\r\n");\r
-                fileBuffer.append("  )\r\n\r\n");\r
-                fileBuffer.append("{\r\n");\r
-                if (entryPointCount <= 1) {\r
-                    fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
-                    fileBuffer.append("    ProcessLibraryDestructorList (gImageHandle, gST);\r\n");\r
-                    fileBuffer.append("  }\r\n");\r
-                    fileBuffer.append("  gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");\r
-                } else {\r
-                    fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
-                    fileBuffer.append("    mDriverEntryPointStatus = Status;\r\n");\r
-                    fileBuffer.append("  }\r\n");\r
-                    fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
-                    fileBuffer.append("  ASSERT (FALSE);\r\n");\r
+                if (CommonDefinition.getModuleType(typeStr) != CommonDefinition.ModuleTypeUefiApplication) {\r
+                    fileBuffer.append("VOID\r\n");\r
+                    fileBuffer.append("EFIAPI\r\n");\r
+                    fileBuffer.append("ExitDriver (\r\n");\r
+                    fileBuffer.append("  IN EFI_STATUS  Status\r\n");\r
+                    fileBuffer.append("  )\r\n\r\n");\r
+                    fileBuffer.append("{\r\n");\r
+                    if (entryPointCount <= 1) {\r
+                        fileBuffer.append("  if (EFI_ERROR (Status)) {\r\n");\r
+                        fileBuffer.append("    ProcessLibraryDestructorList (gImageHandle, gST);\r\n");\r
+                        fileBuffer.append("  }\r\n");\r
+                        fileBuffer.append("  gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");\r
+                    } else {\r
+                        fileBuffer.append("  if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");\r
+                        fileBuffer.append("    mDriverEntryPointStatus = Status;\r\n");\r
+                        fileBuffer.append("  }\r\n");\r
+                        fileBuffer.append("  LongJump (&mJumpContext, (UINTN)-1);\r\n");\r
+                        fileBuffer.append("  ASSERT (FALSE);\r\n");\r
+                    }\r
+                    fileBuffer.append("}\r\n\r\n");\r
                 }\r
-                fileBuffer.append("}\r\n\r\n");\r
             }\r
 \r
+            if (CommonDefinition.getModuleType(typeStr) == CommonDefinition.ModuleTypeUefiApplication) {\r
+                break;\r
+            }\r
             //\r
             // Add ModuleUnloadImage for DxeDriver and UefiDriver module type.\r
             //\r