From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from host12.webserveralpha.com (host12.webserveralpha.com [69.167.158.73]) (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 7D62421E87978 for ; Wed, 13 Sep 2017 08:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mc2research.org; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:In-Reply-To:References:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=K3kY/w62/6LT08CdtFTTUQukQVMM6Al+Va2NWk6Xee4=; b=WQ+AzxaZfgI6u2INtgRRocfQQH SIe6Y4R4Xlbeb5exIrojHX9isygHs+EdvEZTIOXDJQBCD1e65YUHXJJMQG0wFF6R59jd4LJshqPo6 +1jNXToM1zQwh/9A/OCtH292H; Received: from mobile-166-176-186-121.mycingular.net ([166.176.186.121]:21664 helo=Willow) by host12.webserveralpha.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1ds9T9-0004Fm-Ha; Wed, 13 Sep 2017 11:20:51 -0400 From: "Daryl McDaniel \(EDK2 Lists\)" To: "'Eric Dong'" , Cc: "'Jaben Carsey'" , "'Ruiyu Ni'" References: <1505297397-8656-1-git-send-email-eric.dong@intel.com> In-Reply-To: <1505297397-8656-1-git-send-email-eric.dong@intel.com> Date: Wed, 13 Sep 2017 08:20:50 -0700 Organization: Micronetics Message-ID: <08f401d32ca3$e312d530$a9387f90$@mc2research.org> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQIQcZmeu18EoVT+quPF3cQnOmJqgqI4ZDJQ X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host12.webserveralpha.com X-AntiAbuse: Original Domain - lists.01.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mc2research.org X-Get-Message-Sender-Via: host12.webserveralpha.com: authenticated_id: darylm@mc2research.com X-Authenticated-Sender: host12.webserveralpha.com: darylm@mc2research.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [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: , X-List-Received-Date: Wed, 13 Sep 2017 15:17:55 -0000 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Language: en-us Looks good. Reviewed-by: Daryl McDaniel > -----Original Message----- > From: Eric Dong [mailto:eric.dong@intel.com] > Sent: Wednesday, September 13, 2017 3:10 AM > To: edk2-devel@lists.01.org > Cc: Daryl McDaniel ; Jaben Carsey > ; Ruiyu Ni > Subject: [Patch] AppPkg/WebServer: Fix build failure. > > 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 > --- > 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/Applications/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 ] = { > 0ULL, > 0x10000ULL, > @@ -302,8 +302,8 @@ MemoryTypeRegistersPage ( > // > // Get the capabilities > // > - Capabilities = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_CAP ); > - DefType = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_DEF_TYPE ); > + Capabilities.Uint64 = AsmReadMsr64 ( MSR_IA32_MTRRCAP ); > + DefType.Uint64 = AsmReadMsr64 ( MSR_IA32_MTRR_DEF_TYPE ); > > // > // Display the capabilities > @@ -316,7 +316,7 @@ MemoryTypeRegistersPage ( > } > Status = HttpSendHexValue ( SocketFD, > pPort, > - Capabilities ); > + Capabilities.Uint64 ); > if ( EFI_ERROR ( Status )) { > break; > } > @@ -338,7 +338,7 @@ MemoryTypeRegistersPage ( > } > Status = HttpSendHexValue ( SocketFD, > pPort, > - DefType ); > + DefType.Uint64); > if ( EFI_ERROR ( Status )) { > break; > } > @@ -350,7 +350,7 @@ MemoryTypeRegistersPage ( > } > Status = HttpSendAnsiString ( SocketFD, > pPort, > - ( 0 != ( DefType & > MTRR_LIB_CACHE_MTRR_ENABLED )) > + ( 0 != DefType.Bits.E ) > ? "Enabled" > : "Disabled" ); > if ( EFI_ERROR ( Status )) { > @@ -364,7 +364,7 @@ MemoryTypeRegistersPage ( > } > Status = HttpSendAnsiString ( SocketFD, > pPort, > - ( 0 != ( DefType & > MTRR_LIB_CACHE_FIXED_MTRR_ENABLED )) > + ( 0 != DefType.Bits.FE ) > ? "Enabled" > : "Disabled" ); > if ( EFI_ERROR ( Status )) { > @@ -376,7 +376,7 @@ MemoryTypeRegistersPage ( > if ( EFI_ERROR ( Status )) { > break; > } > - Type = DefType & 0xff; > + Type = DefType.Uint64 & 0xff; > Status = HttpSendAnsiString ( SocketFD, > pPort, > ( DIM ( mMemoryType ) > Type ) > @@ -395,7 +395,7 @@ MemoryTypeRegistersPage ( > // > // Determine if MTRRs are enabled > // > - if ( 0 == ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED )) { > + if ( 0 == DefType.Bits.E ) { > Status = HttpSendAnsiString ( SocketFD, > pPort, > "

All memory is uncached!

\r\n" ); > @@ -412,8 +412,8 @@ MemoryTypeRegistersPage ( > // > // Determine if the fixed MTRRs are supported > // > - if (( 0 != ( Capabilities & 0x100 )) > - && ( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))) { > + if (( 0 != Capabilities.Bits.FIX ) > + && ( 0 != DefType.Bits.FE)) { > > // > // Beginning of table > @@ -615,8 +615,7 @@ MemoryTypeRegistersPage ( > // > // Determine if the variable MTRRs are supported > // > - MaxMtrrs = 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 = 0; MaxMtrrs > Count; Count++ ) { > + for ( Count = 0; Capabilities.Bits.VCNT > Count; Count++ ) { > // > // Start the row > // > diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h > b/AppPkg/Applications/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 @@ > > #include > > +#include > #include > #include > #include > -- > 2.7.0.windows.1