]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
OvmfPkg/PlatformBootManagerLib: sync Timeout with PcdPlatformBootTimeOut
[mirror_edk2.git] / OvmfPkg / Library / PlatformBootManagerLib / BdsPlatform.c
index 8af9b71f18a3df4e0bf5dd2ebf3678fbc515698e..45d0ee9cc3a8df517f9f4c5f5051b95f4019de2a 100644 (file)
@@ -353,6 +353,7 @@ PlatformBootManagerBeforeConsole (
 {\r
   EFI_HANDLE    Handle;\r
   EFI_STATUS    Status;\r
+  UINT16        FrontPageTimeout;\r
   RETURN_STATUS PcdStatus;\r
 \r
   DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));\r
@@ -400,9 +401,30 @@ PlatformBootManagerBeforeConsole (
 \r
   PlatformInitializeConsole (\r
     XenDetected() ? gXenPlatformConsole : gPlatformConsole);\r
-  PcdStatus = PcdSet16S (PcdPlatformBootTimeOut,\r
-                GetFrontPageTimeoutFromQemu ());\r
+\r
+  FrontPageTimeout = GetFrontPageTimeoutFromQemu ();\r
+  PcdStatus = PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout);\r
   ASSERT_RETURN_ERROR (PcdStatus);\r
+  //\r
+  // Reflect the PCD in the standard Timeout variable.\r
+  //\r
+  Status = gRT->SetVariable (\r
+                  EFI_TIME_OUT_VARIABLE_NAME,\r
+                  &gEfiGlobalVariableGuid,\r
+                  (EFI_VARIABLE_NON_VOLATILE |\r
+                   EFI_VARIABLE_BOOTSERVICE_ACCESS |\r
+                   EFI_VARIABLE_RUNTIME_ACCESS),\r
+                  sizeof FrontPageTimeout,\r
+                  &FrontPageTimeout\r
+                  );\r
+  DEBUG ((\r
+    EFI_ERROR (Status) ? DEBUG_ERROR : DEBUG_VERBOSE,\r
+    "%a: SetVariable(%s, %u): %r\n",\r
+    __FUNCTION__,\r
+    EFI_TIME_OUT_VARIABLE_NAME,\r
+    FrontPageTimeout,\r
+    Status\r
+    ));\r
 \r
   PlatformRegisterOptionsAndKeys ();\r
 \r