]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add assertion to ensure HwErr type variable range is less than or equal to VariableSt...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Aug 2009 02:59:28 +0000 (02:59 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 26 Aug 2009 02:59:28 +0000 (02:59 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9199 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index f2c7081dd16908fc00c9433880f5a616503bda67..83c85348584bbc853c6bc0f2d8b49e2a1df2b342 100644 (file)
   # In IA64 platforms, this value should be larger than 128KB.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000|UINT32|0x30000004\r
 \r
-  ## The size of reserved HwErr variable space. This space is located at NV variable range.\r
-  # HwErr type variable is stored with common non-volatile variables in NV region.\r
+  ## The size of reserved HwErr variable space. Note that this value must be less than or equal to PcdFlashNvStorageVariableSize\r
+  # In EdkII implementation, HwErr type variable is stored with common non-volatile variables in the same NV region.\r
+  # so the platform integrator should ensure this value is less than or equal to PcdFlashNvStorageVariableSize.\r
   # this value is used to guarantee the space of HwErr type variable and not populated by common variable.\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize|0x8000|UINT32|0x30000006\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize|0x0000|UINT32|0x30000006\r
 \r
   ## The size of volatile buffer. This buffer is used to store VOLATILE attribute variable.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000|UINT32|0x30000005\r
index 228d7d8cffadcb8cdb4ec00f3303591a19466eb9..2da9a7c3084eb5da687cd55fb47b768d765a2633 100644 (file)
@@ -1313,6 +1313,14 @@ InitializeVariableStore (
 {\r
   VARIABLE_STORE_HEADER *VariableStore;\r
 \r
+  //\r
+  // Note that in EdkII variable driver implementation, Hardware Error Record type variable\r
+  // is stored with common variable in the same NV region. So the platform integrator should\r
+  // ensure that the value of PcdHwErrStorageSize is less than or equal to the value of \r
+  // PcdFlashNvStorageVariableSize.\r
+  //\r
+  ASSERT (FixedPcdGet32(PcdHwErrStorageSize) <= FixedPcdGet32(PcdFlashNvStorageVariableSize));\r
+\r
   //\r
   // Allocate memory for volatile variable store\r
   //\r
index aadda4b5879d2dc72ae8b123bcc8fdcb7bd8317a..e524777843a9ca4d40882be98c75c99eab9c6f97 100644 (file)
@@ -2246,6 +2246,14 @@ VariableCommonInitialize (
 \r
   EfiInitializeLock(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock, TPL_NOTIFY);\r
 \r
+  //\r
+  // Note that in EdkII variable driver implementation, Hardware Error Record type variable\r
+  // is stored with common variable in the same NV region. So the platform integrator should\r
+  // ensure that the value of PcdHwErrStorageSize is less than or equal to the value of \r
+  // PcdFlashNvStorageVariableSize.\r
+  //\r
+  ASSERT (FixedPcdGet32(PcdHwErrStorageSize) <= FixedPcdGet32(PcdFlashNvStorageVariableSize));\r
+\r
   //\r
   // Allocate memory for volatile variable store, note that there is a scratch space to store scratch data.\r
   //\r