From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 15D4420945C16 for ; Wed, 13 Sep 2017 07:10:44 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 07:13:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,388,1500966000"; d="scan'208";a="148735937" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 13 Sep 2017 07:13:41 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 07:13:41 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.182]) by fmsmsx123.amr.corp.intel.com ([169.254.7.170]) with mapi id 14.03.0319.002; Wed, 13 Sep 2017 07:13:41 -0700 From: "Carsey, Jaben" To: "Dong, Eric" , "edk2-devel@lists.01.org" CC: Daryl McDaniel , "Ni, Ruiyu" Thread-Topic: [Patch] AppPkg/WebServer: Fix build failure. Thread-Index: AQHTLHh6davKroUpyk+SI27KWxXjDqKy3Akw Date: Wed, 13 Sep 2017 14:13:40 +0000 Message-ID: References: <1505297397-8656-1-git-send-email-eric.dong@intel.com> In-Reply-To: <1505297397-8656-1-git-send-email-eric.dong@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjc0ODc1NzUtZmMyYy00YTRjLWE4NmItMDBmMzg3ZGVlNDEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkhBWVBWanZkcWgyZ3JqdDNkZEVDZDJrZFFXSG10bUt6bTNORDNJQzFZZUU9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.107] MIME-Version: 1.0 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 14:10:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: Dong, Eric > Sent: Wednesday, September 13, 2017 3:10 AM > To: edk2-devel@lists.01.org > Cc: Daryl McDaniel ; Carsey, Jaben > ; Ni, Ruiyu > Subject: [Patch] AppPkg/WebServer: Fix build failure. > Importance: High >=20 > Fix build failure caused by UefiCpuPkg/MtrrLib removes deprecated macros. >=20 > 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(-) >=20 > 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 ] =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_= MTRR_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_FIXED_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/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 @@ >=20 > #include >=20 > +#include > #include > #include > #include > -- > 2.7.0.windows.1