UINT64 Address;\r
UINT64 Alignment;\r
UINT64 Length;\r
- UINT8 Type : 7;\r
+ MTRR_MEMORY_CACHE_TYPE Type : 7;\r
\r
//\r
// Temprary use for calculating the best MTRR settings.\r
while (SubStart != SubStop) {\r
Status = MtrrLibAppendVariableMtrr (\r
Mtrrs, MtrrCapacity, MtrrCount,\r
- Vertices[SubStart].Address, Vertices[SubStart].Length, (MTRR_MEMORY_CACHE_TYPE) Vertices[SubStart].Type\r
+ Vertices[SubStart].Address, Vertices[SubStart].Length, Vertices[SubStart].Type\r
);\r
if (RETURN_ERROR (Status)) {\r
return Status;\r
Pre = Vertices[Cur].Previous;\r
SubStop = Pre;\r
\r
- if (Weight[M (Pre, Cur)] != 0) {\r
+ if (Weight[M (Pre, Cur)] + Weight[O (Pre, Cur)] != 0) {\r
Status = MtrrLibAppendVariableMtrr (\r
Mtrrs, MtrrCapacity, MtrrCount,\r
- Vertices[Pre].Address, Vertices[Cur].Address - Vertices[Pre].Address, LowestPrecedentType\r
+ Vertices[Pre].Address, Vertices[Cur].Address - Vertices[Pre].Address,\r
+ (Pre != Cur - 1) ? LowestPrecedentType : Vertices[Pre].Type\r
);\r
if (RETURN_ERROR (Status)) {\r
return Status;\r