]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Follow UEFI spec, set TimeOut and HwErrRecSupport variable by EFI variable service...
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 5 Mar 2013 12:20:53 +0000 (12:20 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 5 Mar 2013 12:20:53 +0000 (12:20 +0000)
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14162 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
IntelFrameworkModulePkg/Universal/BdsDxe/HwErrRecSupport.c

index 025ebfb3e2cf3640edef030627875cc4f8e884a8..9484b5d2c5896aaca72ee0231063c94b6684fe72 100644 (file)
@@ -2,7 +2,7 @@
 # Intel Framework Module Package contains the definitions and module implementation\r
 # which follows Intel EFI Framework Specification.\r
 #\r
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
   ## The PCD is used to mark whether the machine is in first boot cycle.\r
   #  TRUE means the machine is in first boot cycle. After completing the first boot,\r
   #  the PCD's value will be updated to FALSE.\r
+  #  This PCD should be set as HII type PCD by platform integrator.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootState|TRUE|BOOLEAN|0x0001002f\r
 \r
   ## Timeout value for displaying progressing bar in before boot OS.\r
   #  According to UEFI 2.0 spec, the default TimeOut should be 0xffff.\r
+  #  This PCD should be set as HII type PCD by platform integrator mapped to variable L"TimeOut" and gEfiGlobalVariableGuid.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0x40000001\r
 \r
   ## Error level for hardware recorder. If value 0, platform does not support feature of hardware error record.\r
-  #  This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport"\r
+  #  This PCD should be set as HII type PCD by platform integrator mapped to variable L"HwErrRecSupport" and gEfiGlobalVariableGuid.\r
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|0|UINT16|0x40000002\r
 \r
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]\r
 \r
   ## This PCD specifies whether to use the optimized timing for best PS2 detection performance.\r
   #  Note this PCD could be set to TRUE for best boot performance and set to FALSE for best device compatibility.\r
-  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFastPS2Detection|FALSE|BOOLEAN|0x3000000b
\ No newline at end of file
+  gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFastPS2Detection|FALSE|BOOLEAN|0x3000000b\r
index f9b83a4499dbf87342a46efe883c1a1ce2502a8a..6eaec886f2317d484021538260a6ba5b0dfc8897 100644 (file)
@@ -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
@@ -510,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
index d1705a0b9cec59a9d4389fa98e4a3904d9eb03bf..44d9b71c400e4ff06b41eebc6c9961e0cf2de171 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The functions for Boot Maintainence Main menu.\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
@@ -672,7 +672,14 @@ ApplyChangeHandler (
     break;\r
 \r
   case FORM_TIME_OUT_ID:\r
-    PcdSet16 (PcdPlatformBootTimeOut, CurrentFakeNVMap->BootTimeOut);\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
+                    &(CurrentFakeNVMap->BootTimeOut)\r
+                    );\r
+    ASSERT_EFI_ERROR(Status);\r
 \r
     Private->BmmOldFakeNVData.BootTimeOut = CurrentFakeNVMap->BootTimeOut;\r
     break;\r
index ee1763b32d2a39cebcf99684770cd727047acdce..ddb2f9398080455f41a520f21e42e6a85221b41b 100644 (file)
@@ -2,7 +2,7 @@
   Set the level of support for Hardware Error Record Persistence that is\r
   implemented by the platform.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -26,17 +26,23 @@ InitializeHwErrRecSupport (
   VOID\r
   )\r
 {\r
-  UINT16 HardwareErrorRecordLevel;\r
+  EFI_STATUS    Status;\r
+  UINT16        HardwareErrorRecordLevel;\r
   \r
   HardwareErrorRecordLevel = PcdGet16 (PcdHardwareErrorRecordLevel);\r
   \r
   if (HardwareErrorRecordLevel != 0) {\r
     //\r
-    // Set original value again to make sure this value is stored into variable\r
-    // area but not PCD database.\r
-    // if level value equal 0, no need set to 0 to variable area because UEFI specification\r
-    // define same behavior between no value or 0 value for L"HwErrRecSupport"\r
+    // If level value equal 0, no need set to 0 to variable area because UEFI specification\r
+    // define same behavior between no value or 0 value for L"HwErrRecSupport".\r
     //\r
-    PcdSet16 (PcdHardwareErrorRecordLevel, HardwareErrorRecordLevel);\r
+    Status = gRT->SetVariable (\r
+                    L"HwErrRecSupport",\r
+                    &gEfiGlobalVariableGuid,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                    sizeof (UINT16),\r
+                    &HardwareErrorRecordLevel\r
+                    );\r
+    ASSERT_EFI_ERROR(Status);\r
   }\r
 }\r