Roll back the change on GetMemorySpaceAttributeFromMtrrType()'s parameter type, from MTRR_MEMORY_CACHE_TYPE to UINT8 since MtrrAttributes may be the value not belongs to MTRR_MEMORY_CACHE_TYPE.

Signed-off-by: vanjeff



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12609 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2011-10-31 06:45:56 +00:00
parent da27b950d5
commit 2c4b1bdce7
1 changed files with 6 additions and 6 deletions

View File

@ -714,7 +714,7 @@ InitializeMtrrMask (
**/
UINT64
GetMemorySpaceAttributeFromMtrrType (
IN MTRR_MEMORY_CACHE_TYPE MtrrAttributes
IN UINT8 MtrrAttributes
)
{
switch (MtrrAttributes) {
@ -879,14 +879,14 @@ RefreshGcdMemoryAttributes (
UINT64 Length;
UINT64 Attributes;
UINT64 CurrentAttributes;
MTRR_MEMORY_CACHE_TYPE MtrrType;
UINT8 MtrrType;
UINTN NumberOfDescriptors;
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;
UINT64 DefaultAttributes;
VARIABLE_MTRR VariableMtrr[MTRR_NUMBER_OF_VARIABLE_MTRR];
MTRR_FIXED_SETTINGS MtrrFixedSettings;
UINT32 FirmwareVariableMtrrCount;
MTRR_MEMORY_CACHE_TYPE DefaultMemoryType;
UINT8 DefaultMemoryType;
if (!IsMtrrSupported ()) {
return;
@ -921,7 +921,7 @@ RefreshGcdMemoryAttributes (
);
ASSERT_EFI_ERROR (Status);
DefaultMemoryType = MtrrGetDefaultMemoryType ();
DefaultMemoryType = (UINT8) MtrrGetDefaultMemoryType ();
DefaultAttributes = GetMemorySpaceAttributeFromMtrrType (DefaultMemoryType);
//
@ -962,7 +962,7 @@ RefreshGcdMemoryAttributes (
if (VariableMtrr[Index].Valid &&
VariableMtrr[Index].Type != MTRR_CACHE_WRITE_BACK &&
VariableMtrr[Index].Type != MTRR_CACHE_UNCACHEABLE) {
Attributes = GetMemorySpaceAttributeFromMtrrType ((MTRR_MEMORY_CACHE_TYPE) VariableMtrr[Index].Type);
Attributes = GetMemorySpaceAttributeFromMtrrType ((UINT8) VariableMtrr[Index].Type);
SetGcdMemorySpaceAttributes (
MemorySpaceMap,
NumberOfDescriptors,
@ -1002,7 +1002,7 @@ RefreshGcdMemoryAttributes (
// Check for continuous fixed MTRR sections
//
for (SubIndex = 0; SubIndex < 8; SubIndex++) {
MtrrType = (MTRR_MEMORY_CACHE_TYPE) RShiftU64 (RegValue, SubIndex * 8);
MtrrType = (UINT8) RShiftU64 (RegValue, SubIndex * 8);
CurrentAttributes = GetMemorySpaceAttributeFromMtrrType (MtrrType);
if (Length == 0) {
//