Code refinement.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10647 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2010-07-13 03:08:54 +00:00
parent 099f2b1882
commit 430fbbe096
14 changed files with 1010 additions and 333 deletions

View File

@@ -23,7 +23,6 @@
//
// This table defines the offset, base and length of the fixed MTRRs
//
STATIC
FIXED_MTRR MtrrLibFixedMtrrTable[] = {
{
MTRR_LIB_IA32_MTRR_FIX64K_00000,
@@ -552,7 +551,7 @@ Power2MaxMemory (
{
UINT64 Result;
if (RShiftU64 (MemoryLength, 32)) {
if (RShiftU64 (MemoryLength, 32) != 0) {
Result = LShiftU64 (
(UINT64) GetPowerOfTwo32 (
(UINT32) RShiftU64 (MemoryLength, 32)
@@ -624,7 +623,6 @@ GetDirection (
@param VariableMtrr The array to shadow variable MTRRs content
**/
STATIC
VOID
InvalidateMtrr (
IN VARIABLE_MTRR *VariableMtrr
@@ -638,7 +636,7 @@ InvalidateMtrr (
Index = 0;
VariableMtrrCount = GetVariableMtrrCount ();
while (Index < VariableMtrrCount) {
if (VariableMtrr[Index].Valid == FALSE && VariableMtrr[Index].Used == TRUE ) {
if (!VariableMtrr[Index].Valid && VariableMtrr[Index].Used) {
AsmWriteMsr64 (VariableMtrr[Index].Msr, 0);
AsmWriteMsr64 (VariableMtrr[Index].Msr + 1, 0);
VariableMtrr[Index].Used = FALSE;
@@ -661,7 +659,6 @@ InvalidateMtrr (
@param MtrrValidAddressMask The valid address mask for MTRR
**/
STATIC
VOID
ProgramVariableMtrr (
IN UINTN MtrrNumber,
@@ -703,7 +700,6 @@ ProgramVariableMtrr (
@return The enum item in MTRR_MEMORY_CACHE_TYPE
**/
STATIC
MTRR_MEMORY_CACHE_TYPE
GetMemoryCacheTypeFromMtrrType (
IN UINT64 MtrrType
@@ -738,7 +734,6 @@ GetMemoryCacheTypeFromMtrrType (
@param MtrrValidAddressMask The valid address mask for the MTRR
**/
STATIC
VOID
MtrrLibInitializeMtrrMask (
OUT UINT64 *MtrrValidBitsMask,
@@ -1452,7 +1447,9 @@ MtrrSetAllMtrrs (
This function prints all MTRRs for debugging.
**/
VOID
EFIAPI
MtrrDebugPrintAllMtrrs (
VOID
)
{
DEBUG_CODE (