From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9626520084778 for ; Tue, 28 Mar 2017 20:03:54 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 28 Mar 2017 20:03:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,239,1486454400"; d="scan'208";a="1113146600" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2017 20:03:53 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jeff Fan Date: Wed, 29 Mar 2017 11:03:41 +0800 Message-Id: <20170329030346.249872-6-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170329030346.249872-1-ruiyu.ni@intel.com> References: <20170329030346.249872-1-ruiyu.ni@intel.com> Subject: [PATCH 05/10] UefiCpuPkg/MtrrLib: Add MtrrLib prefix to ProgramFixedMtrr X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 03:03:54 -0000 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jeff Fan --- UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c index 7e8a19a..4adc41f 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; } -- 2.9.0.windows.1