summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-09-02 10:41:28 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2017-03-31 13:57:32 +0800
commit94240f1b05fb72f1fd104713229c95b4541a8199 (patch)
tree26d988603a5ddcf343cba999850db8188ba7b8ca
parent386f5785ea31fc535a7d85e7f477da2dc0a8c9ba (diff)
UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrr
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
-rw-r--r--UefiCpuPkg/Library/MtrrLib/MtrrLib.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index cbcc584f1f..624be8730e 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -445,7 +445,7 @@ MtrrGetVariableMtrr (
/**
Programs fixed MTRRs registers.
- @param[in] MemoryCacheType The memory type to set.
+ @param[in] Type The memory type to set.
@param[in, out] Base The base address of memory range.
@param[in, out] Length The length of memory range.
@param[in, out] LastMsrNum On input, the last index of the fixed MTRR MSR to program.
@@ -459,13 +459,13 @@ MtrrGetVariableMtrr (
**/
RETURN_STATUS
-ProgramFixedMtrr (
- IN UINT64 MemoryCacheType,
- IN OUT UINT64 *Base,
- IN OUT UINT64 *Length,
- IN OUT UINT32 *LastMsrNum,
- OUT UINT64 *ReturnClearMask,
- OUT UINT64 *ReturnOrMask
+MtrrLibProgramFixedMtrr (
+ IN MTRR_MEMORY_CACHE_TYPE Type,
+ IN OUT UINT64 *Base,
+ IN OUT UINT64 *Length,
+ IN OUT UINT32 *LastMsrNum,
+ OUT UINT64 *ReturnClearMask,
+ OUT UINT64 *ReturnOrMask
)
{
UINT32 MsrNum;
@@ -491,7 +491,7 @@ ProgramFixedMtrr (
}
}
- if (MsrNum >= MTRR_NUMBER_OF_FIXED_MTRR) {
+ if (MsrNum == MTRR_NUMBER_OF_FIXED_MTRR) {
return RETURN_UNSUPPORTED;
}
@@ -526,7 +526,7 @@ ProgramFixedMtrr (
}
ClearMask = CLEAR_SEED;
- OrMask = MultU64x32 (OR_SEED, (UINT32)MemoryCacheType);
+ OrMask = MultU64x32 (OR_SEED, (UINT32) Type);
if (LeftByteShift != 0) {
//
@@ -1562,7 +1562,7 @@ MtrrSetMemoryAttributeWorker (
if (BaseAddress < BASE_1MB) {
MsrNum = (UINT32)-1;
while ((BaseAddress < BASE_1MB) && (Length > 0) && Status == RETURN_SUCCESS) {
- Status = ProgramFixedMtrr (MemoryType, &BaseAddress, &Length, &MsrNum, &ClearMask, &OrMask);
+ Status = MtrrLibProgramFixedMtrr (Attribute, &BaseAddress, &Length, &MsrNum, &ClearMask, &OrMask);
if (RETURN_ERROR (Status)) {
goto Done;
}