]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[mirror_edk2.git] / OvmfPkg / Library / PlatformBootManagerLib / BdsPlatform.c
index 74cb5a4327aa3735f64025f8e80fa5cac80013c5..025252e72b3905453adef678aa7acb62bec39289 100644 (file)
@@ -37,11 +37,6 @@ CONST UINT8 PciHostIrqs[] = {
   0x0a, 0x0a, 0x0b, 0x0b\r
 };\r
 \r
-//\r
-// Array Size macro\r
-//\r
-#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))\r
-\r
 //\r
 // Type definitions\r
 //\r
@@ -342,7 +337,7 @@ PlatformBootManagerBeforeConsole (
 \r
 Routine Description:\r
 \r
-  Platform Bds init. Incude the platform firmware vendor, revision\r
+  Platform Bds init. Include the platform firmware vendor, revision\r
   and so crc check.\r
 \r
 Arguments:\r
@@ -353,8 +348,9 @@ Returns:
 \r
 --*/\r
 {\r
-  EFI_HANDLE Handle;\r
-  EFI_STATUS Status;\r
+  EFI_HANDLE    Handle;\r
+  EFI_STATUS    Status;\r
+  RETURN_STATUS PcdStatus;\r
 \r
   DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));\r
   InstallDevicePathCallback ();\r
@@ -393,8 +389,15 @@ Returns:
                   NULL);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Dispatch deferred images after EndOfDxe event and ReadyToLock installation.\r
+  //\r
+  EfiBootManagerDispatchDeferredImages ();\r
+\r
   PlatformInitializeConsole (gPlatformConsole);\r
-  PcdSet16 (PcdPlatformBootTimeOut, GetFrontPageTimeoutFromQemu ());\r
+  PcdStatus = PcdSet16S (PcdPlatformBootTimeOut,\r
+                GetFrontPageTimeoutFromQemu ());\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   PlatformRegisterOptionsAndKeys ();\r
 }\r
@@ -566,7 +569,7 @@ GetGopDevicePath (
   }\r
 \r
   //\r
-  // Try to connect this handle, so that GOP dirver could start on this\r
+  // Try to connect this handle, so that GOP driver could start on this\r
   // device and create child handles with GraphicsOutput Protocol installed\r
   // on them, then we get device paths of these child handles and select\r
   // them as possible console device.\r
@@ -598,7 +601,7 @@ GetGopDevicePath (
         // In current implementation, we only enable one of the child handles\r
         // as console device, i.e. sotre one of the child handle's device\r
         // path to variable "ConOut"\r
-        // In futhure, we could select all child handles to be console device\r
+        // In future, we could select all child handles to be console device\r
         //\r
 \r
         *GopDevicePath = TempDevicePath;\r
@@ -915,7 +918,7 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  PlatformConsole         - Predfined platform default console device array.\r
+  PlatformConsole         - Predefined platform default console device array.\r
 --*/\r
 {\r
   UINTN                              Index;\r
@@ -936,7 +939,7 @@ Arguments:
 \r
     //\r
     // Have chance to connect the platform default console,\r
-    // the platform default console is the minimue device group\r
+    // the platform default console is the minimum device group\r
     // the platform should support\r
     //\r
     for (Index = 0; PlatformConsole[Index].DevicePath != NULL; ++Index) {\r
@@ -1281,6 +1284,7 @@ VisitingFileSystemInstance (
 {\r
   EFI_STATUS      Status;\r
   STATIC BOOLEAN  ConnectedToFileSystem = FALSE;\r
+  RETURN_STATUS   PcdStatus;\r
 \r
   if (ConnectedToFileSystem) {\r
     return EFI_ALREADY_STARTED;\r
@@ -1300,7 +1304,9 @@ VisitingFileSystemInstance (
       NULL,\r
       &mEmuVariableEventReg\r
       );\r
-  PcdSet64 (PcdEmuVariableEvent, (UINT64)(UINTN) mEmuVariableEvent);\r
+  PcdStatus = PcdSet64S (PcdEmuVariableEvent,\r
+                (UINT64)(UINTN) mEmuVariableEvent);\r
+  ASSERT_RETURN_ERROR (PcdStatus);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -1327,7 +1333,7 @@ PlatformBdsConnectSequence (
 \r
 Routine Description:\r
 \r
-  Connect with predeined platform connect sequence,\r
+  Connect with predefined platform connect sequence,\r
   the OEM/IBV can customize with their own connect sequence.\r
 \r
 Arguments:\r
@@ -1409,7 +1415,7 @@ PlatformBootManagerAfterConsole (
 \r
 Routine Description:\r
 \r
-  The function will excute with as the platform policy, current policy\r
+  The function will execute with as the platform policy, current policy\r
   is driven by boot mode. IBV/OEM can customize this code for their specific\r
   policy action.\r
 \r
@@ -1434,7 +1440,7 @@ Routine Description:
   // Get current Boot Mode\r
   //\r
   BootMode = GetBootModeHob ();\r
-  DEBUG ((EFI_D_ERROR, "Boot Mode:%x\n", BootMode));\r
+  DEBUG ((DEBUG_INFO, "Boot Mode:%x\n", BootMode));\r
 \r
   //\r
   // Go the different platform policy with different boot mode\r