From 48cd992ac738da11878f2996f33f90efe0875b8e Mon Sep 17 00:00:00 2001 From: eric_tian Date: Wed, 26 Aug 2009 02:59:28 +0000 Subject: add assertion to ensure HwErr type variable range is less than or equal to VariableStore range. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9199 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c') diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index aadda4b58..e52477784 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -2246,6 +2246,14 @@ VariableCommonInitialize ( EfiInitializeLock(&mVariableModuleGlobal->VariableGlobal.VariableServicesLock, TPL_NOTIFY); + // + // Note that in EdkII variable driver implementation, Hardware Error Record type variable + // is stored with common variable in the same NV region. So the platform integrator should + // ensure that the value of PcdHwErrStorageSize is less than or equal to the value of + // PcdFlashNvStorageVariableSize. + // + ASSERT (FixedPcdGet32(PcdHwErrStorageSize) <= FixedPcdGet32(PcdFlashNvStorageVariableSize)); + // // Allocate memory for volatile variable store, note that there is a scratch space to store scratch data. // -- cgit v1.2.3