]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrr
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 2 Sep 2016 02:41:28 +0000 (10:41 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 31 Mar 2017 05:57:32 +0000 (13:57 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
UefiCpuPkg/Library/MtrrLib/MtrrLib.c

index cbcc584f1fb4b0ae67751b3899b1e288656d569f..624be8730e9634f847a6c115c0a0f957a24fc53f 100644 (file)
@@ -445,7 +445,7 @@ MtrrGetVariableMtrr (
 /**\r
   Programs fixed MTRRs registers.\r
 \r
-  @param[in]      MemoryCacheType  The memory type to set.\r
+  @param[in]      Type             The memory type to set.\r
   @param[in, out] Base             The base address of memory range.\r
   @param[in, out] Length           The length of memory range.\r
   @param[in, out] LastMsrNum       On input, the last index of the fixed MTRR MSR to program.\r
@@ -459,13 +459,13 @@ MtrrGetVariableMtrr (
 \r
 **/\r
 RETURN_STATUS\r
-ProgramFixedMtrr (\r
-  IN     UINT64               MemoryCacheType,\r
-  IN OUT UINT64               *Base,\r
-  IN OUT UINT64               *Length,\r
-  IN OUT UINT32               *LastMsrNum,\r
-  OUT    UINT64               *ReturnClearMask,\r
-  OUT    UINT64               *ReturnOrMask\r
+MtrrLibProgramFixedMtrr (\r
+  IN     MTRR_MEMORY_CACHE_TYPE  Type,\r
+  IN OUT UINT64                  *Base,\r
+  IN OUT UINT64                  *Length,\r
+  IN OUT UINT32                  *LastMsrNum,\r
+  OUT    UINT64                  *ReturnClearMask,\r
+  OUT    UINT64                  *ReturnOrMask\r
   )\r
 {\r
   UINT32  MsrNum;\r
@@ -491,7 +491,7 @@ ProgramFixedMtrr (
     }\r
   }\r
 \r
-  if (MsrNum >= MTRR_NUMBER_OF_FIXED_MTRR) {\r
+  if (MsrNum == MTRR_NUMBER_OF_FIXED_MTRR) {\r
     return RETURN_UNSUPPORTED;\r
   }\r
 \r
@@ -526,7 +526,7 @@ ProgramFixedMtrr (
   }\r
 \r
   ClearMask = CLEAR_SEED;\r
-  OrMask    = MultU64x32 (OR_SEED, (UINT32)MemoryCacheType);\r
+  OrMask    = MultU64x32 (OR_SEED, (UINT32) Type);\r
 \r
   if (LeftByteShift != 0) {\r
     //\r
@@ -1562,7 +1562,7 @@ MtrrSetMemoryAttributeWorker (
   if (BaseAddress < BASE_1MB) {\r
     MsrNum = (UINT32)-1;\r
     while ((BaseAddress < BASE_1MB) && (Length > 0) && Status == RETURN_SUCCESS) {\r
-      Status = ProgramFixedMtrr (MemoryType, &BaseAddress, &Length, &MsrNum, &ClearMask, &OrMask);\r
+      Status = MtrrLibProgramFixedMtrr (Attribute, &BaseAddress, &Length, &MsrNum, &ClearMask, &OrMask);\r
       if (RETURN_ERROR (Status)) {\r
         goto Done;\r
       }\r