]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index c34067e11845f4ce0e6b338b180a1ae2952de80d..fc46022c3c7f0ee678dee3cc5bcfcdb79dfe94dc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DXE Core Main Entry Point\r
 \r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -258,9 +258,9 @@ DxeMain (
   if (GuidHob != NULL) {\r
     VectorInfoList = (EFI_VECTOR_HANDOFF_INFO *) (GET_GUID_HOB_DATA(GuidHob));\r
   }\r
-  Status = InitializeCpuExceptionHandlers (VectorInfoList);\r
+  Status = InitializeCpuExceptionHandlersEx (VectorInfoList, NULL);\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   //\r
   // Initialize Debug Agent to support source level debug in DXE phase\r
   //\r
@@ -301,8 +301,8 @@ DxeMain (
   // Call constructor for all libraries\r
   //\r
   ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);\r
-  PERF_END   (NULL,"PEI", NULL, 0) ;\r
-  PERF_START (NULL,"DXE", NULL, 0) ;\r
+  PERF_CROSSMODULE_END   ("PEI");\r
+  PERF_CROSSMODULE_BEGIN ("DXE");\r
 \r
   //\r
   // Report DXE Core image information to the PE/COFF Extra Action Library\r
@@ -380,10 +380,43 @@ DxeMain (
       }\r
     }\r
     for (Hob.Raw = HobStart; !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
-      if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {\r
-        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV2 Hob           0x%0lx - 0x%0lx\n", Hob.FirmwareVolume2->BaseAddress, Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1));\r
-      } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {\r
-        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV Hob            0x%0lx - 0x%0lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume->Length - 1));\r
+      if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {\r
+        DEBUG ((\r
+          DEBUG_INFO | DEBUG_LOAD,\r
+          "FV Hob            0x%0lx - 0x%0lx\n",\r
+          Hob.FirmwareVolume->BaseAddress,\r
+          Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume->Length - 1\r
+          ));\r
+      } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {\r
+        DEBUG ((\r
+          DEBUG_INFO | DEBUG_LOAD,\r
+          "FV2 Hob           0x%0lx - 0x%0lx\n",\r
+          Hob.FirmwareVolume2->BaseAddress,\r
+          Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1\r
+          ));\r
+        DEBUG ((\r
+          DEBUG_INFO | DEBUG_LOAD,\r
+          "                  %g - %g\n",\r
+          &Hob.FirmwareVolume2->FvName,\r
+          &Hob.FirmwareVolume2->FileName\r
+          ));\r
+      } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV3) {\r
+        DEBUG ((\r
+          DEBUG_INFO | DEBUG_LOAD,\r
+          "FV3 Hob           0x%0lx - 0x%0lx - 0x%x - 0x%x\n",\r
+          Hob.FirmwareVolume3->BaseAddress,\r
+          Hob.FirmwareVolume3->BaseAddress + Hob.FirmwareVolume3->Length - 1,\r
+          Hob.FirmwareVolume3->AuthenticationStatus,\r
+          Hob.FirmwareVolume3->ExtractedFv\r
+          ));\r
+        if (Hob.FirmwareVolume3->ExtractedFv) {\r
+          DEBUG ((\r
+            DEBUG_INFO | DEBUG_LOAD,\r
+            "                  %g - %g\n",\r
+            &Hob.FirmwareVolume3->FvName,\r
+            &Hob.FirmwareVolume3->FileName\r
+            ));\r
+        }\r
       }\r
     }\r
   DEBUG_CODE_END ();\r
@@ -398,6 +431,7 @@ DxeMain (
 \r
   CoreInitializePropertiesTable ();\r
   CoreInitializeMemoryAttributesTable ();\r
+  CoreInitializeMemoryProtection ();\r
 \r
   //\r
   // Get persisted vector hand-off info from GUIDeed HOB again due to HobStart may be updated,\r
@@ -465,16 +499,12 @@ DxeMain (
   //\r
   // Initialize the DXE Dispatcher\r
   //\r
-  PERF_START (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
   CoreInitializeDispatcher ();\r
-  PERF_END (NULL,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
 \r
   //\r
   // Invoke the DXE Dispatcher\r
   //\r
-  PERF_START (NULL, "CoreDispatcher", "DxeMain", 0);\r
   CoreDispatcher ();\r
-  PERF_END (NULL, "CoreDispatcher", "DxeMain", 0);\r
 \r
   //\r
   // Display Architectural protocols that were not loaded if this is DEBUG build\r
@@ -502,7 +532,7 @@ DxeMain (
     REPORT_STATUS_CODE (\r
       EFI_ERROR_CODE | EFI_ERROR_MAJOR,\r
       (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_EC_NO_ARCH)\r
-      );    \r
+      );\r
   }\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -524,6 +554,8 @@ DxeMain (
   //\r
   ASSERT (FALSE);\r
   CpuDeadLoop ();\r
+\r
+  UNREACHABLE ();\r
 }\r
 \r
 \r
@@ -748,7 +780,7 @@ CoreExitBootServices (
   Status = CoreTerminateMemoryMap (MapKey);\r
   if (EFI_ERROR (Status)) {\r
     //\r
-    // Notify other drivers that ExitBootServices fail \r
+    // Notify other drivers that ExitBootServices fail\r
     //\r
     CoreNotifySignalList (&gEventExitBootServicesFailedGuid);\r
     return Status;\r
@@ -769,6 +801,8 @@ CoreExitBootServices (
     (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)\r
     );\r
 \r
+  MemoryProtectionExitBootServicesCallback();\r
+\r
   //\r
   // Disable interrupt of Debug timer.\r
   //\r