]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib: Fix some typo and clean up code format
authorMichael Kinney <michael.d.kinney@intel.com>
Tue, 8 Dec 2015 05:20:44 +0000 (05:20 +0000)
committervanjeff <vanjeff@Edk2>
Tue, 8 Dec 2015 05:20:44 +0000 (05:20 +0000)
Fixed some typo. Removed some trailing spaces and TAB key. Clean up code format.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19152 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/Include/Library/MtrrLib.h
UefiCpuPkg/Library/MtrrLib/MtrrLib.c

index f9002e7cbfc710aaef68dc6fb67716293bd032d9..884c7bb6996cf26e851ad43f9bb38bf0b479e41d 100644 (file)
@@ -84,8 +84,8 @@ typedef struct {
 // Structure to hold base and mask pair for variable MTRR register\r
 //\r
 typedef struct _MTRR_VARIABLE_SETTING_ {\r
 // Structure to hold base and mask pair for variable MTRR register\r
 //\r
 typedef struct _MTRR_VARIABLE_SETTING_ {\r
-       UINT64    Base;\r
-       UINT64    Mask;\r
+  UINT64    Base;\r
+  UINT64    Mask;\r
 } MTRR_VARIABLE_SETTING;\r
 \r
 //\r
 } MTRR_VARIABLE_SETTING;\r
 \r
 //\r
@@ -115,11 +115,11 @@ typedef struct _MTRR_SETTINGS_ {
 // Memory cache types\r
 //\r
 typedef enum {\r
 // Memory cache types\r
 //\r
 typedef enum {\r
-       CacheUncacheable    = 0,\r
-       CacheWriteCombining = 1,\r
-       CacheWriteThrough   = 4,\r
-       CacheWriteProtected = 5,\r
-       CacheWriteBack      = 6\r
+  CacheUncacheable    = 0,\r
+  CacheWriteCombining = 1,\r
+  CacheWriteThrough   = 4,\r
+  CacheWriteProtected = 5,\r
+  CacheWriteBack      = 6\r
 } MTRR_MEMORY_CACHE_TYPE;\r
 \r
 #define  MTRR_CACHE_UNCACHEABLE      0\r
 } MTRR_MEMORY_CACHE_TYPE;\r
 \r
 #define  MTRR_CACHE_UNCACHEABLE      0\r
@@ -156,20 +156,27 @@ GetFirmwareVariableMtrrCount (
 /**\r
   This function attempts to set the attributes for a memory range.\r
 \r
 /**\r
   This function attempts to set the attributes for a memory range.\r
 \r
-  @param  BaseAddress            The physical address that is the start address of a memory region.\r
-  @param  Length                 The size in bytes of the memory region.\r
-  @param  Attributes             The bit mask of attributes to set for the memory region.\r
+  @param[in]       BaseAddress       The physical address that is the start\r
+                                     address of a memory region.\r
+  @param[in]       Length            The size in bytes of the memory region.\r
+  @param[in]       Attribute         The bit mask of attributes to set for the\r
+                                     memory region.\r
 \r
 \r
-  @retval RETURN_SUCCESS            The attributes were set for the memory region.\r
+  @retval RETURN_SUCCESS            The attributes were set for the memory\r
+                                    region.\r
   @retval RETURN_INVALID_PARAMETER  Length is zero.\r
   @retval RETURN_INVALID_PARAMETER  Length is zero.\r
-  @retval RETURN_UNSUPPORTED        The processor does not support one or more bytes of the\r
-                                 memory resource range specified by BaseAddress and Length.\r
-  @retval RETURN_UNSUPPORTED        The bit mask of attributes is not support for the memory resource\r
-                                 range specified by BaseAddress and Length.\r
-  @retval RETURN_ACCESS_DENIED      The attributes for the memory resource range specified by\r
-                                 BaseAddress and Length cannot be modified.\r
-  @retval RETURN_OUT_OF_RESOURCES   There are not enough system resources to modify the attributes of\r
-                                 the memory resource range.\r
+  @retval RETURN_UNSUPPORTED        The processor does not support one or\r
+                                    more bytes of the memory resource range\r
+                                    specified by BaseAddress and Length.\r
+  @retval RETURN_UNSUPPORTED        The bit mask of attributes is not support\r
+                                    for the memory resource range specified\r
+                                    by BaseAddress and Length.\r
+  @retval RETURN_ACCESS_DENIED      The attributes for the memory resource\r
+                                    range specified by BaseAddress and Length\r
+                                    cannot be modified.\r
+  @retval RETURN_OUT_OF_RESOURCES   There are not enough system resources to\r
+                                    modify the attributes of the memory\r
+                                    resource range.\r
 \r
 **/\r
 RETURN_STATUS\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -185,7 +192,7 @@ MtrrSetMemoryAttribute (
   This function will get the memory cache type of the specific address.\r
   This function is mainly for debugging purposes.\r
 \r
   This function will get the memory cache type of the specific address.\r
   This function is mainly for debugging purposes.\r
 \r
-  @param  Address            The specific address\r
+  @param[in]  Address            The specific address\r
 \r
   @return The memory cache type of the specific address\r
 \r
 \r
   @return The memory cache type of the specific address\r
 \r
@@ -200,7 +207,7 @@ MtrrGetMemoryAttribute (
 /**\r
   This function will get the raw value in variable MTRRs\r
 \r
 /**\r
   This function will get the raw value in variable MTRRs\r
 \r
-  @param  VariableSettings   A buffer to hold variable MTRRs content.\r
+  @param[out]  VariableSettings   A buffer to hold variable MTRRs content.\r
 \r
   @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the content of the variable mtrr\r
 \r
 \r
   @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the content of the variable mtrr\r
 \r
@@ -215,7 +222,7 @@ MtrrGetVariableMtrr (
 /**\r
   This function sets fixed MTRRs\r
 \r
 /**\r
   This function sets fixed MTRRs\r
 \r
-  @param  VariableSettings   A buffer to hold variable MTRRs content.\r
+  @param[in]  VariableSettings   A buffer to hold variable MTRRs content.\r
 \r
   @return The pointer of VariableSettings\r
 \r
 \r
   @return The pointer of VariableSettings\r
 \r
@@ -230,7 +237,7 @@ MtrrSetVariableMtrr (
 /**\r
   This function gets the content in fixed MTRRs\r
 \r
 /**\r
   This function gets the content in fixed MTRRs\r
 \r
-  @param  FixedSettings      A buffer to hold fixed MTRRs content.\r
+  @param[out]  FixedSettings      A buffer to hold fixed MTRRs content.\r
 \r
   @return The pointer of FixedSettings\r
 \r
 \r
   @return The pointer of FixedSettings\r
 \r
@@ -245,7 +252,7 @@ MtrrGetFixedMtrr (
 /**\r
   This function sets fixed MTRRs\r
 \r
 /**\r
   This function sets fixed MTRRs\r
 \r
-  @param   FixedSettings      A buffer holding fixed MTRRs content.\r
+  @param[in]   FixedSettings      A buffer holding fixed MTRRs content.\r
 \r
   @return  The pointer of FixedSettings\r
 \r
 \r
   @return  The pointer of FixedSettings\r
 \r
@@ -260,7 +267,7 @@ MtrrSetFixedMtrr (
 /**\r
   This function gets the content in all MTRRs (variable and fixed)\r
 \r
 /**\r
   This function gets the content in all MTRRs (variable and fixed)\r
 \r
-  @param  MtrrSetting   A buffer to hold all MTRRs content.\r
+  @param[out]  MtrrSetting   A buffer to hold all MTRRs content.\r
 \r
   @return The pointer of MtrrSetting\r
 \r
 \r
   @return The pointer of MtrrSetting\r
 \r
@@ -275,7 +282,7 @@ MtrrGetAllMtrrs (
 /**\r
   This function sets all MTRRs (variable and fixed)\r
 \r
 /**\r
   This function sets all MTRRs (variable and fixed)\r
 \r
-  @param  MtrrSetting   A buffer to hold all MTRRs content.\r
+  @param[in]  MtrrSetting   A buffer to hold all MTRRs content.\r
 \r
   @return The pointer of MtrrSetting\r
 \r
 \r
   @return The pointer of MtrrSetting\r
 \r
@@ -293,11 +300,12 @@ MtrrSetAllMtrrs (
   This function shadows the content of variable MTRRs into\r
   an internal array: VariableMtrr\r
 \r
   This function shadows the content of variable MTRRs into\r
   an internal array: VariableMtrr\r
 \r
-  @param  MtrrValidBitsMask     The mask for the valid bit of the MTRR\r
-  @param  MtrrValidAddressMask  The valid address mask for MTRR since the base address in\r
-                                MTRR must align to 4K, so valid address mask equal to\r
-                                MtrrValidBitsMask & 0xfffffffffffff000ULL\r
-  @param  VariableMtrr          The array to shadow variable MTRRs content\r
+  @param[in]   MtrrValidBitsMask    The mask for the valid bit of the MTRR\r
+  @param[in]   MtrrValidAddressMask The valid address mask for MTRR since the base address in\r
+                                    MTRR must align to 4K, so valid address mask equal to\r
+                                    MtrrValidBitsMask & 0xfffffffffffff000ULL\r
+  @param[out]  VariableMtrr         The array to shadow variable MTRRs content\r
+\r
   @return                       The ruturn value of this paramter indicates the number of\r
                                 MTRRs which has been used.\r
 **/\r
   @return                       The ruturn value of this paramter indicates the number of\r
                                 MTRRs which has been used.\r
 **/\r
index 82223379e773962211af2b0c4a42ca57afe1f272..1584ae23d9ce49d57fdfa034c04a6d1644b6dd44 100644 (file)
@@ -86,7 +86,7 @@ CONST FIXED_MTRR  mMtrrLibFixedMtrrTable[] = {
     MTRR_LIB_IA32_MTRR_FIX4K_F8000,\r
     0xF8000,\r
     SIZE_4KB\r
     MTRR_LIB_IA32_MTRR_FIX4K_F8000,\r
     0xF8000,\r
     SIZE_4KB\r
-  },\r
+  }\r
 };\r
 \r
 //\r
 };\r
 \r
 //\r
@@ -188,7 +188,7 @@ PreMtrrChange (
   // Disable interrupts and save current interrupt state\r
   //\r
   MtrrContext->InterruptState = SaveAndDisableInterrupts();\r
   // Disable interrupts and save current interrupt state\r
   //\r
   MtrrContext->InterruptState = SaveAndDisableInterrupts();\r
-  \r
+\r
   //\r
   // Enter no fill cache mode, CD=1(Bit30), NW=0 (Bit29)\r
   //\r
   //\r
   // Enter no fill cache mode, CD=1(Bit30), NW=0 (Bit29)\r
   //\r
@@ -206,7 +206,7 @@ PreMtrrChange (
   CpuFlushTlb ();\r
 \r
   //\r
   CpuFlushTlb ();\r
 \r
   //\r
-  // Disable Mtrrs\r
+  // Disable MTRRs\r
   //\r
   AsmMsrBitFieldWrite64 (MTRR_LIB_IA32_MTRR_DEF_TYPE, 10, 11, 0);\r
 }\r
   //\r
   AsmMsrBitFieldWrite64 (MTRR_LIB_IA32_MTRR_DEF_TYPE, 10, 11, 0);\r
 }\r
@@ -226,7 +226,7 @@ PostMtrrChangeEnableCache (
   )\r
 {\r
   //\r
   )\r
 {\r
   //\r
-  // Flush all TLBs \r
+  // Flush all TLBs\r
   //\r
   CpuFlushTlb ();\r
 \r
   //\r
   CpuFlushTlb ();\r
 \r
@@ -239,7 +239,7 @@ PostMtrrChangeEnableCache (
   // Restore original CR4 value\r
   //\r
   AsmWriteCr4 (MtrrContext->Cr4);\r
   // Restore original CR4 value\r
   //\r
   AsmWriteCr4 (MtrrContext->Cr4);\r
-  \r
+\r
   //\r
   // Restore original interrupt state\r
   //\r
   //\r
   // Restore original interrupt state\r
   //\r
@@ -272,9 +272,9 @@ PostMtrrChange (
 /**\r
   Programs fixed MTRRs registers.\r
 \r
 /**\r
   Programs fixed MTRRs registers.\r
 \r
-  @param  MemoryCacheType  The memory type to set.\r
-  @param  Base             The base address of memory range.\r
-  @param  Length           The length of memory range.\r
+  @param[in]      MemoryCacheType  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
 \r
   @retval RETURN_SUCCESS      The cache type was updated successfully\r
   @retval RETURN_UNSUPPORTED  The requested range or cache type was invalid\r
 \r
   @retval RETURN_SUCCESS      The cache type was updated successfully\r
   @retval RETURN_UNSUPPORTED  The requested range or cache type was invalid\r
@@ -356,14 +356,14 @@ ProgramFixedMtrr (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Get the attribute of variable MTRRs.\r
+  Gets the attribute of variable MTRRs.\r
 \r
   This function shadows the content of variable MTRRs into an\r
   internal array: VariableMtrr.\r
 \r
 \r
   This function shadows the content of variable MTRRs into an\r
   internal array: VariableMtrr.\r
 \r
-  @param  MtrrValidBitsMask     The mask for the valid bit of the MTRR\r
-  @param  MtrrValidAddressMask  The valid address mask for MTRR\r
-  @param  VariableMtrr          The array to shadow variable MTRRs content\r
+  @param[in]   MtrrValidBitsMask     The mask for the valid bit of the MTRR\r
+  @param[in]   MtrrValidAddressMask  The valid address mask for MTRR\r
+  @param[out]  VariableMtrr          The array to shadow variable MTRRs content\r
 \r
   @return                       The return value of this paramter indicates the\r
                                 number of MTRRs which has been used.\r
 \r
   @return                       The return value of this paramter indicates the\r
                                 number of MTRRs which has been used.\r
@@ -423,9 +423,9 @@ MtrrGetMemoryAttributeInVariableMtrr (
 /**\r
   Checks overlap between given memory range and MTRRs.\r
 \r
 /**\r
   Checks overlap between given memory range and MTRRs.\r
 \r
-  @param  Start            The start address of memory range.\r
-  @param  End              The end address of memory range.\r
-  @param  VariableMtrr     The array to shadow variable MTRRs content\r
+  @param[in]  Start                      The start address of memory range.\r
+  @param[in]  End                        The end address of memory range.\r
+  @param[in]  VariableMtrr               The array to shadow variable MTRRs content\r
 \r
   @retval TRUE             Overlap exists.\r
   @retval FALSE            No overlap.\r
 \r
   @retval TRUE             Overlap exists.\r
   @retval FALSE            No overlap.\r
@@ -461,9 +461,9 @@ CheckMemoryAttributeOverlap (
 /**\r
   Marks a variable MTRR as non-valid.\r
 \r
 /**\r
   Marks a variable MTRR as non-valid.\r
 \r
-  @param  Index         The index of the array VariableMtrr to be invalidated\r
-  @param  VariableMtrr  The array to shadow variable MTRRs content\r
-  @param  UsedMtrr      The number of MTRRs which has already been used\r
+  @param[in]   Index         The index of the array VariableMtrr to be invalidated\r
+  @param[in]   VariableMtrr  The array to shadow variable MTRRs content\r
+  @param[out]  UsedMtrr      The number of MTRRs which has already been used\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -479,16 +479,16 @@ InvalidateShadowMtrr (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Combine memory attributes.\r
+  Combines memory attributes.\r
 \r
   If overlap exists between given memory range and MTRRs, try to combine them.\r
 \r
 \r
   If overlap exists between given memory range and MTRRs, try to combine them.\r
 \r
-  @param  Attributes             The memory type to set.\r
-  @param  Base                   The base address of memory range.\r
-  @param  Length                 The length of memory range.\r
-  @param  VariableMtrr           The array to shadow variable MTRRs content\r
-  @param  UsedMtrr               The number of MTRRs which has already been used\r
-  @param  OverwriteExistingMtrr  Returns whether an existing MTRR was used\r
+  @param[in]       Attributes                 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]       VariableMtrr               The array to shadow variable MTRRs content\r
+  @param[in, out]  UsedMtrr                   The number of MTRRs which has already been used\r
+  @param[out]      OverwriteExistingMtrr      Returns whether an existing MTRR was used\r
 \r
   @retval EFI_SUCCESS            Memory region successfully combined.\r
   @retval EFI_ACCESS_DENIED      Memory region cannot be combined.\r
 \r
   @retval EFI_SUCCESS            Memory region successfully combined.\r
   @retval EFI_ACCESS_DENIED      Memory region cannot be combined.\r
@@ -536,7 +536,7 @@ CombineMemoryAttribute (
     //\r
     if (Attributes == VariableMtrr[Index].Type) {\r
       //\r
     //\r
     if (Attributes == VariableMtrr[Index].Type) {\r
       //\r
-      // if the Mtrr range contain the request range, set a flag, then continue to \r
+      // if the MTRR range contain the request range, set a flag, then continue to\r
       // invalidate any MTRR of the same request range with higher priority cache type.\r
       //\r
       if (VariableMtrr[Index].BaseAddress <= *Base && MtrrEnd >= EndAddress) {\r
       // invalidate any MTRR of the same request range with higher priority cache type.\r
       //\r
       if (VariableMtrr[Index].BaseAddress <= *Base && MtrrEnd >= EndAddress) {\r
@@ -597,9 +597,10 @@ CombineMemoryAttribute (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Calculate the maximum value which is a power of 2, but less the MemoryLength.\r
+  Calculates the maximum value which is a power of 2, but less the MemoryLength.\r
+\r
+  @param[in]  MemoryLength        The number to pass in.\r
 \r
 \r
-  @param  MemoryLength        The number to pass in.\r
   @return The maximum value which is align to power of 2 and less the MemoryLength\r
 \r
 **/\r
   @return The maximum value which is align to power of 2 and less the MemoryLength\r
 \r
 **/\r
@@ -626,21 +627,22 @@ Power2MaxMemory (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Determine the MTRR numbers used to program a memory range.\r
+  Determines the MTRR numbers used to program a memory range.\r
 \r
 \r
-  This function first checks the alignment of the base address. If the alignment of the base address <= Length,\r
-  cover the memory range (BaseAddress, alignment) by a MTRR, then BaseAddress += alignment and Length -= alignment.\r
-  Repeat the step until alignment > Length.\r
+  This function first checks the alignment of the base address.\r
+  If the alignment of the base address <= Length, cover the memory range\r
+ (BaseAddress, alignment) by a MTRR, then BaseAddress += alignment and\r
+  Length -= alignment. Repeat the step until alignment > Length.\r
 \r
 \r
-  Then this function determines which direction of programming the variable MTRRs for the remaining length\r
-  will use fewer MTRRs.\r
+  Then this function determines which direction of programming the variable\r
+  MTRRs for the remaining length will use fewer MTRRs.\r
 \r
 \r
-  @param  BaseAddress Length of Memory to program MTRR\r
-  @param  Length      Length of Memory to program MTRR\r
-  @param  MtrrNumber  Pointer to the number of necessary MTRRs\r
+  @param[in]  BaseAddress Length of Memory to program MTRR\r
+  @param[in]  Length      Length of Memory to program MTRR\r
+  @param[in]  MtrrNumber  Pointer to the number of necessary MTRRs\r
 \r
   @retval TRUE        Positive direction is better.\r
 \r
   @retval TRUE        Positive direction is better.\r
-          FALSE       Negtive direction is better.\r
+          FALSE       Negative direction is better.\r
 \r
 **/\r
 BOOLEAN\r
 \r
 **/\r
 BOOLEAN\r
@@ -709,13 +711,13 @@ GetMtrrNumberAndDirection (
   This function programs MTRRs according to the values specified\r
   in the shadow array.\r
 \r
   This function programs MTRRs according to the values specified\r
   in the shadow array.\r
 \r
-  @param  VariableMtrr   The array to shadow variable MTRRs content\r
+  @param[in, out]  VariableMtrr       Shadow of variable MTRR contents\r
 \r
 **/\r
 VOID\r
 InvalidateMtrr (\r
 \r
 **/\r
 VOID\r
 InvalidateMtrr (\r
-   IN     VARIABLE_MTRR      *VariableMtrr\r
-   )\r
+  IN OUT VARIABLE_MTRR           *VariableMtrr\r
+  )\r
 {\r
   UINTN         Index;\r
   UINTN         VariableMtrrCount;\r
 {\r
   UINTN         Index;\r
   UINTN         VariableMtrrCount;\r
@@ -741,11 +743,11 @@ InvalidateMtrr (
 \r
   This function programs variable MTRRs\r
 \r
 \r
   This function programs variable MTRRs\r
 \r
-  @param  MtrrNumber            Index of MTRR to program.\r
-  @param  BaseAddress           Base address of memory region.\r
-  @param  Length                Length of memory region.\r
-  @param  MemoryCacheType       Memory type to set.\r
-  @param  MtrrValidAddressMask  The valid address mask for MTRR\r
+  @param[in]       MtrrNumber            Index of MTRR to program.\r
+  @param[in]       BaseAddress           Base address of memory region.\r
+  @param[in]       Length                Length of memory region.\r
+  @param[in]       MemoryCacheType       Memory type to set.\r
+  @param[in]       MtrrValidAddressMask  The valid address mask for MTRR\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -782,9 +784,9 @@ ProgramVariableMtrr (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Convert the Memory attibute value to MTRR_MEMORY_CACHE_TYPE.\r
+  Converts the Memory attribute value to MTRR_MEMORY_CACHE_TYPE.\r
 \r
 \r
-  @param  MtrrType  MTRR memory type\r
+  @param[in]  MtrrType           MTRR memory type\r
 \r
   @return The enum item in MTRR_MEMORY_CACHE_TYPE\r
 \r
 \r
   @return The enum item in MTRR_MEMORY_CACHE_TYPE\r
 \r
@@ -808,7 +810,7 @@ GetMemoryCacheTypeFromMtrrType (
   default:\r
     //\r
     // MtrrType is MTRR_CACHE_INVALID_TYPE, that means\r
   default:\r
     //\r
     // MtrrType is MTRR_CACHE_INVALID_TYPE, that means\r
-    // no mtrr covers the range\r
+    // no MTRR covers the range\r
     //\r
     return MtrrGetDefaultMemoryType ();\r
   }\r
     //\r
     return MtrrGetDefaultMemoryType ();\r
   }\r
@@ -819,8 +821,8 @@ GetMemoryCacheTypeFromMtrrType (
 \r
   This function initializes the valid bits mask and valid address mask for MTRRs.\r
 \r
 \r
   This function initializes the valid bits mask and valid address mask for MTRRs.\r
 \r
-  @param  MtrrValidBitsMask     The mask for the valid bit of the MTRR\r
-  @param  MtrrValidAddressMask  The valid address mask for the MTRR\r
+  @param[out]  MtrrValidBitsMask     The mask for the valid bit of the MTRR\r
+  @param[out]  MtrrValidAddressMask  The valid address mask for the MTRR\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -849,21 +851,21 @@ MtrrLibInitializeMtrrMask (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Determing the real attribute of a memory range.\r
+  Determines the real attribute of a memory range.\r
 \r
   This function is to arbitrate the real attribute of the memory when\r
 \r
   This function is to arbitrate the real attribute of the memory when\r
-  there are 2 MTRR covers the same memory range.  For further details,\r
+  there are 2 MTRRs covers the same memory range.  For further details,\r
   please refer the IA32 Software Developer's Manual, Volume 3,\r
   Section 10.11.4.1.\r
 \r
   please refer the IA32 Software Developer's Manual, Volume 3,\r
   Section 10.11.4.1.\r
 \r
-  @param  MtrrType1    the first kind of Memory type\r
-  @param  MtrrType2    the second kind of memory type\r
+  @param[in]  MtrrType1    The first kind of Memory type\r
+  @param[in]  MtrrType2    The second kind of memory type\r
 \r
 **/\r
 UINT64\r
 MtrrPrecedence (\r
 \r
 **/\r
 UINT64\r
 MtrrPrecedence (\r
-  UINT64    MtrrType1,\r
-  UINT64    MtrrType2\r
+  IN UINT64    MtrrType1,\r
+  IN UINT64    MtrrType2\r
   )\r
 {\r
   UINT64 MtrrType;\r
   )\r
 {\r
   UINT64 MtrrType;\r
@@ -923,11 +925,11 @@ MtrrPrecedence (
 /**\r
   This function attempts to set the attributes for a memory range.\r
 \r
 /**\r
   This function attempts to set the attributes for a memory range.\r
 \r
-  @param  BaseAddress            The physical address that is the start\r
-                                 address of a memory region.\r
-  @param  Length                 The size in bytes of the memory region.\r
-  @param  Attributes             The bit mask of attributes to set for the\r
-                                 memory region.\r
+  @param[in]       BaseAddress       The physical address that is the start\r
+                                     address of a memory region.\r
+  @param[in]       Length            The size in bytes of the memory region.\r
+  @param[in]       Attribute         The bit mask of attributes to set for the\r
+                                     memory region.\r
 \r
   @retval RETURN_SUCCESS            The attributes were set for the memory\r
                                     region.\r
 \r
   @retval RETURN_SUCCESS            The attributes were set for the memory\r
                                     region.\r
@@ -1198,9 +1200,9 @@ Done:
 \r
   This function is mainly for debug purpose.\r
 \r
 \r
   This function is mainly for debug purpose.\r
 \r
-  @param  Address   The specific address\r
+  @param[in]  Address            The specific address\r
 \r
 \r
-  @return Memory cache type of the sepcific address\r
+  @return Memory cache type of the specific address\r
 \r
 **/\r
 MTRR_MEMORY_CACHE_TYPE\r
 \r
 **/\r
 MTRR_MEMORY_CACHE_TYPE\r
@@ -1290,7 +1292,7 @@ MtrrGetMemoryAttribute (
 /**\r
   This function will get the raw value in variable MTRRs\r
 \r
 /**\r
   This function will get the raw value in variable MTRRs\r
 \r
-  @param  VariableSettings   A buffer to hold variable MTRRs content.\r
+  @param[out]  FixedSettings  A buffer to hold fixed MTRRs content.\r
 \r
   @return The VariableSettings input pointer\r
 \r
 \r
   @return The VariableSettings input pointer\r
 \r
@@ -1325,7 +1327,7 @@ MtrrGetVariableMtrr (
 /**\r
   Worker function setting variable MTRRs\r
 \r
 /**\r
   Worker function setting variable MTRRs\r
 \r
-  @param  VariableSettings   A buffer to hold variable MTRRs content.\r
+  @param[in]  VariableSettings   A buffer to hold variable MTRRs content.\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -1355,7 +1357,7 @@ MtrrSetVariableMtrrWorker (
 /**\r
   This function sets variable MTRRs\r
 \r
 /**\r
   This function sets variable MTRRs\r
 \r
-  @param  VariableSettings   A buffer to hold variable MTRRs content.\r
+  @param[in]  VariableSettings   A buffer to hold variable MTRRs content.\r
 \r
   @return The pointer of VariableSettings\r
 \r
 \r
   @return The pointer of VariableSettings\r
 \r
@@ -1382,7 +1384,7 @@ MtrrSetVariableMtrr (
 /**\r
   This function gets the content in fixed MTRRs\r
 \r
 /**\r
   This function gets the content in fixed MTRRs\r
 \r
-  @param  FixedSettings  A buffer to hold fixed Mtrrs content.\r
+  @param[out]  FixedSettings  A buffer to hold fixed Mtrrs content.\r
 \r
   @retval The pointer of FixedSettings\r
 \r
 \r
   @retval The pointer of FixedSettings\r
 \r
@@ -1410,7 +1412,7 @@ MtrrGetFixedMtrr (
 /**\r
   Worker function setting fixed MTRRs\r
 \r
 /**\r
   Worker function setting fixed MTRRs\r
 \r
-  @param  FixedSettings  A buffer to hold fixed Mtrrs content.\r
+  @param[in]  FixedSettings  A buffer to hold fixed Mtrrs content.\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -1432,7 +1434,7 @@ MtrrSetFixedMtrrWorker (
 /**\r
   This function sets fixed MTRRs\r
 \r
 /**\r
   This function sets fixed MTRRs\r
 \r
-  @param  FixedSettings  A buffer to hold fixed Mtrrs content.\r
+  @param[in]  FixedSettings  A buffer to hold fixed Mtrrs content.\r
 \r
   @retval The pointer of FixedSettings\r
 \r
 \r
   @retval The pointer of FixedSettings\r
 \r
@@ -1460,7 +1462,7 @@ MtrrSetFixedMtrr (
 /**\r
   This function gets the content in all MTRRs (variable and fixed)\r
 \r
 /**\r
   This function gets the content in all MTRRs (variable and fixed)\r
 \r
-  @param  MtrrSetting  A buffer to hold all Mtrrs content.\r
+  @param[out]  MtrrSetting  A buffer to hold all Mtrrs content.\r
 \r
   @retval the pointer of MtrrSetting\r
 \r
 \r
   @retval the pointer of MtrrSetting\r
 \r
@@ -1497,7 +1499,7 @@ MtrrGetAllMtrrs (
 /**\r
   This function sets all MTRRs (variable and fixed)\r
 \r
 /**\r
   This function sets all MTRRs (variable and fixed)\r
 \r
-  @param  MtrrSetting  A buffer holding all MTRRs content.\r
+  @param[in]  MtrrSetting  A buffer holding all MTRRs content.\r
 \r
   @retval The pointer of MtrrSetting\r
 \r
 \r
   @retval The pointer of MtrrSetting\r
 \r
@@ -1569,7 +1571,7 @@ MtrrDebugPrintAllMtrrs (
 \r
     DEBUG((DEBUG_CACHE, "MTRR Settings\n"));\r
     DEBUG((DEBUG_CACHE, "=============\n"));\r
 \r
     DEBUG((DEBUG_CACHE, "MTRR Settings\n"));\r
     DEBUG((DEBUG_CACHE, "=============\n"));\r
-    \r
+\r
     MtrrGetAllMtrrs (&MtrrSettings);\r
     DEBUG((DEBUG_CACHE, "MTRR Default Type: %016lx\n", MtrrSettings.MtrrDefType));\r
     for (Index = 0; Index < MTRR_NUMBER_OF_FIXED_MTRR; Index++) {\r
     MtrrGetAllMtrrs (&MtrrSettings);\r
     DEBUG((DEBUG_CACHE, "MTRR Default Type: %016lx\n", MtrrSettings.MtrrDefType));\r
     for (Index = 0; Index < MTRR_NUMBER_OF_FIXED_MTRR; Index++) {\r
@@ -1596,7 +1598,7 @@ MtrrDebugPrintAllMtrrs (
       MemoryType = (UINTN)(RShiftU64 (MtrrSettings.Fixed.Mtrr[Index], Index1 * 8) & 0xff);\r
         if (MemoryType > CacheWriteBack) {\r
           MemoryType = MTRR_CACHE_INVALID_TYPE;\r
       MemoryType = (UINTN)(RShiftU64 (MtrrSettings.Fixed.Mtrr[Index], Index1 * 8) & 0xff);\r
         if (MemoryType > CacheWriteBack) {\r
           MemoryType = MTRR_CACHE_INVALID_TYPE;\r
-        }            \r
+        }\r
         if (MemoryType != PreviousMemoryType) {\r
           if (PreviousMemoryType != MTRR_CACHE_INVALID_TYPE) {\r
             DEBUG((DEBUG_CACHE, "%016lx\n", Base - 1));\r
         if (MemoryType != PreviousMemoryType) {\r
           if (PreviousMemoryType != MTRR_CACHE_INVALID_TYPE) {\r
             DEBUG((DEBUG_CACHE, "%016lx\n", Base - 1));\r
@@ -1632,12 +1634,12 @@ MtrrDebugPrintAllMtrrs (
         PreviousMemoryType = MemoryType;\r
         DEBUG((DEBUG_CACHE, "%a:%016lx-", mMtrrMemoryCacheTypeShortName[MemoryType], Base));\r
       }\r
         PreviousMemoryType = MemoryType;\r
         DEBUG((DEBUG_CACHE, "%a:%016lx-", mMtrrMemoryCacheTypeShortName[MemoryType], Base));\r
       }\r
-      \r
-      RangeBase    = BASE_1MB;        \r
+\r
+      RangeBase    = BASE_1MB;\r
       NoRangeBase  = BASE_1MB;\r
       RangeLimit   = Limit;\r
       NoRangeLimit = Limit;\r
       NoRangeBase  = BASE_1MB;\r
       RangeLimit   = Limit;\r
       NoRangeLimit = Limit;\r
-      \r
+\r
       for (Index = 0, Found = FALSE; Index < VariableMtrrCount; Index++) {\r
         if ((MtrrSettings.Variables.Mtrr[Index].Mask & BIT11) == 0) {\r
           //\r
       for (Index = 0, Found = FALSE; Index < VariableMtrrCount; Index++) {\r
         if ((MtrrSettings.Variables.Mtrr[Index].Mask & BIT11) == 0) {\r
           //\r
@@ -1651,7 +1653,7 @@ MtrrDebugPrintAllMtrrs (
         if (Base >= MtrrBase && Base < MtrrLimit) {\r
           Found = TRUE;\r
         }\r
         if (Base >= MtrrBase && Base < MtrrLimit) {\r
           Found = TRUE;\r
         }\r
-        \r
+\r
         if (Base >= MtrrBase && MtrrBase > RangeBase) {\r
           RangeBase = MtrrBase;\r
         }\r
         if (Base >= MtrrBase && MtrrBase > RangeBase) {\r
           RangeBase = MtrrBase;\r
         }\r
@@ -1664,7 +1666,7 @@ MtrrDebugPrintAllMtrrs (
         if (Base < MtrrLimit && MtrrLimit <= RangeLimit) {\r
           RangeLimit = MtrrLimit;\r
         }\r
         if (Base < MtrrLimit && MtrrLimit <= RangeLimit) {\r
           RangeLimit = MtrrLimit;\r
         }\r
-        \r
+\r
         if (Base > MtrrLimit && NoRangeBase < MtrrLimit) {\r
           NoRangeBase = MtrrLimit + 1;\r
         }\r
         if (Base > MtrrLimit && NoRangeBase < MtrrLimit) {\r
           NoRangeBase = MtrrLimit + 1;\r
         }\r
@@ -1672,7 +1674,7 @@ MtrrDebugPrintAllMtrrs (
           NoRangeLimit = MtrrBase - 1;\r
         }\r
       }\r
           NoRangeLimit = MtrrBase - 1;\r
         }\r
       }\r
-      \r
+\r
       if (Found) {\r
         Base = RangeLimit + 1;\r
       } else {\r
       if (Found) {\r
         Base = RangeLimit + 1;\r
       } else {\r