]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
Follow UEFI spec, set TimeOut and HwErrRecSupport variable by EFI variable service...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BdsEntry.c
index 5486a5c5301d58e41682f1b8968c5d76fce345fa..6eaec886f2317d484021538260a6ba5b0dfc8897 100644 (file)
@@ -5,7 +5,7 @@
   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked\r
   to enter BDS phase.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, 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
@@ -457,6 +457,8 @@ BdsEntry (
   LIST_ENTRY                      BootOptionList;\r
   UINTN                           BootNextSize;\r
   CHAR16                          *FirmwareVendor;\r
+  EFI_STATUS                      Status;\r
+  UINT16                          BootTimeOut;\r
 \r
   //\r
   // Insert the performance probe\r
@@ -486,6 +488,7 @@ BdsEntry (
   //\r
   // Fixup Tasble CRC after we updated Firmware Vendor and Revision\r
   //\r
+  gST->Hdr.CRC32 = 0;\r
   gBS->CalculateCrc32 ((VOID *)gST, sizeof(EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
 \r
   //\r
@@ -509,6 +512,25 @@ BdsEntry (
 \r
   InitializeHwErrRecSupport();\r
 \r
+  //\r
+  // Initialize L"Timeout" EFI global variable.\r
+  //\r
+  BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);\r
+  if (BootTimeOut != 0xFFFF) {\r
+    //\r
+    // If time out value equal 0xFFFF, no need set to 0xFFFF to variable area because UEFI specification\r
+    // define same behavior between no value or 0xFFFF value for L"Timeout".\r
+    //\r
+    Status = gRT->SetVariable (\r
+                    L"Timeout",\r
+                    &gEfiGlobalVariableGuid,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                    sizeof (UINT16),\r
+                    &BootTimeOut\r
+                    );\r
+    ASSERT_EFI_ERROR(Status);\r
+  }\r
+\r
   //\r
   // bugbug: platform specific code\r
   // Initialize the platform specific string and language\r