Add Checking for MTRR existence.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10223 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2010-03-10 02:38:39 +00:00
parent c4ae2792f2
commit 947a573ada
3 changed files with 108 additions and 1 deletions

View File

@@ -590,6 +590,10 @@ CpuSetMemoryAttributes (
RETURN_STATUS Status;
MTRR_MEMORY_CACHE_TYPE CacheType;
if (!IsMtrrSupported ()) {
return EFI_UNSUPPORTED;
}
DEBUG((EFI_D_ERROR, "CpuAp: SetMemorySpaceAttributes(BA=%08x, Len=%08x, Attr=%08x)\n", BaseAddress, Length, Attributes));
//
@@ -856,6 +860,10 @@ RefreshGcdMemoryAttributes (
MTRR_FIXED_SETTINGS MtrrFixedSettings;
UINT32 FirmwareVariableMtrrCount;
if (!IsMtrrSupported ()) {
return;
}
FirmwareVariableMtrrCount = GetFirmwareVariableMtrrCount ();
ASSERT (FirmwareVariableMtrrCount <= MTRR_NUMBER_OF_VARIABLE_MTRR);