AppPkg/WebServer: Fix build failure.

Fix build failure caused by UefiCpuPkg/MtrrLib removes deprecated macros.
related bugz: https://bugzilla.tianocore.org/show_bug.cgi?id=691

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Eric Dong 2017-09-13 18:08:42 +08:00
parent 5afa5b8159
commit b30abe7df4
2 changed files with 16 additions and 16 deletions

View File

@ -146,12 +146,12 @@ MemoryTypeRegistersPage (
{ {
UINT64 Addr; UINT64 Addr;
BOOLEAN bValid; BOOLEAN bValid;
UINT64 Capabilities; MSR_IA32_MTRRCAP_REGISTER Capabilities;
UINTN Count; UINTN Count;
UINT64 DefType; MSR_IA32_MTRR_DEF_TYPE_REGISTER DefType;
UINTN Index; UINTN Index;
UINT64 Mask; UINT64 Mask;
UINT64 MaxMtrrs;
CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = { CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = {
0ULL, 0ULL,
0x10000ULL, 0x10000ULL,
@ -302,8 +302,8 @@ MemoryTypeRegistersPage (
// //
// Get the capabilities // Get the capabilities
// //
Capabilities = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_CAP ); Capabilities.Uint64 = AsmReadMsr64 ( MSR_IA32_MTRRCAP );
DefType = AsmReadMsr64 ( MTRR_LIB_IA32_MTRR_DEF_TYPE ); DefType.Uint64 = AsmReadMsr64 ( MSR_IA32_MTRR_DEF_TYPE );
// //
// Display the capabilities // Display the capabilities
@ -316,7 +316,7 @@ MemoryTypeRegistersPage (
} }
Status = HttpSendHexValue ( SocketFD, Status = HttpSendHexValue ( SocketFD,
pPort, pPort,
Capabilities ); Capabilities.Uint64 );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -338,7 +338,7 @@ MemoryTypeRegistersPage (
} }
Status = HttpSendHexValue ( SocketFD, Status = HttpSendHexValue ( SocketFD,
pPort, pPort,
DefType ); DefType.Uint64);
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
@ -350,7 +350,7 @@ MemoryTypeRegistersPage (
} }
Status = HttpSendAnsiString ( SocketFD, Status = HttpSendAnsiString ( SocketFD,
pPort, pPort,
( 0 != ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED )) ( 0 != DefType.Bits.E )
? "Enabled" ? "Enabled"
: "Disabled" ); : "Disabled" );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
@ -364,7 +364,7 @@ MemoryTypeRegistersPage (
} }
Status = HttpSendAnsiString ( SocketFD, Status = HttpSendAnsiString ( SocketFD,
pPort, pPort,
( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED )) ( 0 != DefType.Bits.FE )
? "Enabled" ? "Enabled"
: "Disabled" ); : "Disabled" );
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
@ -376,7 +376,7 @@ MemoryTypeRegistersPage (
if ( EFI_ERROR ( Status )) { if ( EFI_ERROR ( Status )) {
break; break;
} }
Type = DefType & 0xff; Type = DefType.Uint64 & 0xff;
Status = HttpSendAnsiString ( SocketFD, Status = HttpSendAnsiString ( SocketFD,
pPort, pPort,
( DIM ( mMemoryType ) > Type ) ( DIM ( mMemoryType ) > Type )
@ -395,7 +395,7 @@ MemoryTypeRegistersPage (
// //
// Determine if MTRRs are enabled // Determine if MTRRs are enabled
// //
if ( 0 == ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED )) { if ( 0 == DefType.Bits.E ) {
Status = HttpSendAnsiString ( SocketFD, Status = HttpSendAnsiString ( SocketFD,
pPort, pPort,
"<p>All memory is uncached!</p>\r\n" ); "<p>All memory is uncached!</p>\r\n" );
@ -412,8 +412,8 @@ MemoryTypeRegistersPage (
// //
// Determine if the fixed MTRRs are supported // Determine if the fixed MTRRs are supported
// //
if (( 0 != ( Capabilities & 0x100 )) if (( 0 != Capabilities.Bits.FIX )
&& ( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))) { && ( 0 != DefType.Bits.FE)) {
// //
// Beginning of table // Beginning of table
@ -615,8 +615,7 @@ MemoryTypeRegistersPage (
// //
// Determine if the variable MTRRs are supported // Determine if the variable MTRRs are supported
// //
MaxMtrrs = Capabilities & MTRR_LIB_IA32_MTRR_CAP_VCNT_MASK; if ( 0 < Capabilities.Bits.VCNT ) {
if ( 0 < MaxMtrrs ) {
// //
// Beginning of table // Beginning of table
// //
@ -632,7 +631,7 @@ MemoryTypeRegistersPage (
// //
// Display the variable MTRRs // Display the variable MTRRs
// //
for ( Count = 0; MaxMtrrs > Count; Count++ ) { for ( Count = 0; Capabilities.Bits.VCNT > Count; Count++ ) {
// //
// Start the row // Start the row
// //

View File

@ -20,6 +20,7 @@
#include <Guid/EventGroup.h> #include <Guid/EventGroup.h>
#include <Register/Msr.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>