Signed-off-by: vanjeff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12609
6f19259b-4bc3-4df7-8a09-
765794883524
**/\r
UINT64\r
GetMemorySpaceAttributeFromMtrrType (\r
**/\r
UINT64\r
GetMemorySpaceAttributeFromMtrrType (\r
- IN MTRR_MEMORY_CACHE_TYPE MtrrAttributes\r
+ IN UINT8 MtrrAttributes\r
)\r
{\r
switch (MtrrAttributes) {\r
)\r
{\r
switch (MtrrAttributes) {\r
UINT64 Length;\r
UINT64 Attributes;\r
UINT64 CurrentAttributes;\r
UINT64 Length;\r
UINT64 Attributes;\r
UINT64 CurrentAttributes;\r
- MTRR_MEMORY_CACHE_TYPE MtrrType;\r
UINTN NumberOfDescriptors;\r
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;\r
UINT64 DefaultAttributes;\r
VARIABLE_MTRR VariableMtrr[MTRR_NUMBER_OF_VARIABLE_MTRR];\r
MTRR_FIXED_SETTINGS MtrrFixedSettings;\r
UINT32 FirmwareVariableMtrrCount;\r
UINTN NumberOfDescriptors;\r
EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap;\r
UINT64 DefaultAttributes;\r
VARIABLE_MTRR VariableMtrr[MTRR_NUMBER_OF_VARIABLE_MTRR];\r
MTRR_FIXED_SETTINGS MtrrFixedSettings;\r
UINT32 FirmwareVariableMtrrCount;\r
- MTRR_MEMORY_CACHE_TYPE DefaultMemoryType;\r
+ UINT8 DefaultMemoryType;\r
\r
if (!IsMtrrSupported ()) {\r
return;\r
\r
if (!IsMtrrSupported ()) {\r
return;\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- DefaultMemoryType = MtrrGetDefaultMemoryType ();\r
+ DefaultMemoryType = (UINT8) MtrrGetDefaultMemoryType ();\r
DefaultAttributes = GetMemorySpaceAttributeFromMtrrType (DefaultMemoryType);\r
\r
//\r
DefaultAttributes = GetMemorySpaceAttributeFromMtrrType (DefaultMemoryType);\r
\r
//\r
if (VariableMtrr[Index].Valid && \r
VariableMtrr[Index].Type != MTRR_CACHE_WRITE_BACK &&\r
VariableMtrr[Index].Type != MTRR_CACHE_UNCACHEABLE) {\r
if (VariableMtrr[Index].Valid && \r
VariableMtrr[Index].Type != MTRR_CACHE_WRITE_BACK &&\r
VariableMtrr[Index].Type != MTRR_CACHE_UNCACHEABLE) {\r
- Attributes = GetMemorySpaceAttributeFromMtrrType ((MTRR_MEMORY_CACHE_TYPE) VariableMtrr[Index].Type);\r
+ Attributes = GetMemorySpaceAttributeFromMtrrType ((UINT8) VariableMtrr[Index].Type);\r
SetGcdMemorySpaceAttributes (\r
MemorySpaceMap,\r
NumberOfDescriptors,\r
SetGcdMemorySpaceAttributes (\r
MemorySpaceMap,\r
NumberOfDescriptors,\r
// Check for continuous fixed MTRR sections\r
//\r
for (SubIndex = 0; SubIndex < 8; SubIndex++) {\r
// Check for continuous fixed MTRR sections\r
//\r
for (SubIndex = 0; SubIndex < 8; SubIndex++) {\r
- MtrrType = (MTRR_MEMORY_CACHE_TYPE) RShiftU64 (RegValue, SubIndex * 8);\r
+ MtrrType = (UINT8) RShiftU64 (RegValue, SubIndex * 8);\r
CurrentAttributes = GetMemorySpaceAttributeFromMtrrType (MtrrType);\r
if (Length == 0) {\r
//\r
CurrentAttributes = GetMemorySpaceAttributeFromMtrrType (MtrrType);\r
if (Length == 0) {\r
//\r