From nobody Sun May 5 06:34:07 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1505297403485292.5042580430419; Wed, 13 Sep 2017 03:10:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 67E2521D492E9; Wed, 13 Sep 2017 03:07:04 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 A2E4121E8796F for ; Wed, 13 Sep 2017 03:07:03 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 03:10:01 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga003.jf.intel.com with ESMTP; 13 Sep 2017 03:09:59 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,387,1500966000"; d="scan'208";a="1013956001" From: Eric Dong To: edk2-devel@lists.01.org Date: Wed, 13 Sep 2017 18:09:57 +0800 Message-Id: <1505297397-8656-1-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [Patch] AppPkg/WebServer: Fix build failure. 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: , Cc: Jaben Carsey , Ruiyu Ni , Daryl McDaniel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Fix build failure caused by UefiCpuPkg/MtrrLib removes deprecated macros. Cc: Daryl McDaniel Cc: Jaben Carsey Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong Reviewed-by: Daryl McDaniel Reviewed-by: Jaben Carsey --- AppPkg/Applications/Sockets/WebServer/Mtrr.c | 31 +++++++++++--------= ---- AppPkg/Applications/Sockets/WebServer/WebServer.h | 1 + 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/AppPkg/Applications/Sockets/WebServer/Mtrr.c b/AppPkg/Applicat= ions/Sockets/WebServer/Mtrr.c index 92f90b0..54356bd 100644 --- a/AppPkg/Applications/Sockets/WebServer/Mtrr.c +++ b/AppPkg/Applications/Sockets/WebServer/Mtrr.c @@ -146,12 +146,12 @@ MemoryTypeRegistersPage ( { UINT64 Addr; BOOLEAN bValid; - UINT64 Capabilities; + MSR_IA32_MTRRCAP_REGISTER Capabilities; UINTN Count; - UINT64 DefType; + MSR_IA32_MTRR_DEF_TYPE_REGISTER DefType; UINTN Index; UINT64 Mask; - UINT64 MaxMtrrs; + CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = =3D { 0ULL, 0x10000ULL, @@ -302,8 +302,8 @@ MemoryTypeRegistersPage ( // // Get the capabilities // - Capabilities =3D AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_CAP ); - DefType =3D AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_DEF_TYPE ); + Capabilities.Uint64 =3D AsmReadMsr64 ( MSR_IA32_MTRRCAP ); + DefType.Uint64 =3D AsmReadMsr64 ( MSR_IA32_MTRR_DEF_TYPE ); =20 // // Display the capabilities @@ -316,7 +316,7 @@ MemoryTypeRegistersPage ( } Status =3D HttpSendHexValue ( SocketFD, pPort, - Capabilities ); + Capabilities.Uint64 ); if ( EFI_ERROR ( Status )) { break; } @@ -338,7 +338,7 @@ MemoryTypeRegistersPage ( } Status =3D HttpSendHexValue ( SocketFD, pPort, - DefType ); + DefType.Uint64); if ( EFI_ERROR ( Status )) { break; } @@ -350,7 +350,7 @@ MemoryTypeRegistersPage ( } Status =3D HttpSendAnsiString ( SocketFD, pPort, - ( 0 !=3D ( DefType & MTRR_LIB_CACHE_MT= RR_ENABLED )) + ( 0 !=3D DefType.Bits.E ) ? "Enabled" : "Disabled" ); if ( EFI_ERROR ( Status )) { @@ -364,7 +364,7 @@ MemoryTypeRegistersPage ( } Status =3D HttpSendAnsiString ( SocketFD, pPort, - ( 0 !=3D ( DefType & MTRR_LIB_CACHE_FI= XED_MTRR_ENABLED )) + ( 0 !=3D DefType.Bits.FE ) ? "Enabled" : "Disabled" ); if ( EFI_ERROR ( Status )) { @@ -376,7 +376,7 @@ MemoryTypeRegistersPage ( if ( EFI_ERROR ( Status )) { break; } - Type =3D DefType & 0xff; + Type =3D DefType.Uint64 & 0xff; Status =3D HttpSendAnsiString ( SocketFD, pPort, ( DIM ( mMemoryType ) > Type ) @@ -395,7 +395,7 @@ MemoryTypeRegistersPage ( // // Determine if MTRRs are enabled // - if ( 0 =3D=3D ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED )) { + if ( 0 =3D=3D DefType.Bits.E ) { Status =3D HttpSendAnsiString ( SocketFD, pPort, "

All memory is uncached!

\r\n"= ); @@ -412,8 +412,8 @@ MemoryTypeRegistersPage ( // // Determine if the fixed MTRRs are supported // - if (( 0 !=3D ( Capabilities & 0x100 )) - && ( 0 !=3D ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))) { + if (( 0 !=3D Capabilities.Bits.FIX ) + && ( 0 !=3D DefType.Bits.FE)) { =20 // // Beginning of table @@ -615,8 +615,7 @@ MemoryTypeRegistersPage ( // // Determine if the variable MTRRs are supported // - MaxMtrrs =3D Capabilities & MTRR_LIB_IA32_MTRR_CAP_VCNT_MASK; - if ( 0 < MaxMtrrs ) { + if ( 0 < Capabilities.Bits.VCNT ) { // // Beginning of table // @@ -632,7 +631,7 @@ MemoryTypeRegistersPage ( // // Display the variable MTRRs // - for ( Count =3D 0; MaxMtrrs > Count; Count++ ) { + for ( Count =3D 0; Capabilities.Bits.VCNT > Count; Count++ ) { // // Start the row // diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h b/AppPkg/App= lications/Sockets/WebServer/WebServer.h index 16c30c8..21b07b6 100644 --- a/AppPkg/Applications/Sockets/WebServer/WebServer.h +++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h @@ -20,6 +20,7 @@ =20 #include =20 +#include #include #include #include --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel