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>
{
UINT64 Addr;
BOOLEAN bValid;
{
UINT64 Addr;
BOOLEAN bValid;
+ MSR_IA32_MTRRCAP_REGISTER Capabilities;
+ MSR_IA32_MTRR_DEF_TYPE_REGISTER DefType;
UINTN Index;
UINT64 Mask;
UINTN Index;
UINT64 Mask;
CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = {
0ULL,
0x10000ULL,
CONST UINT64 mFixedAddresses [( 8 * MTRR_NUMBER_OF_FIXED_MTRR ) + 1 ] = {
0ULL,
0x10000ULL,
//
// Get the capabilities
//
//
// 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
//
// Display the capabilities
}
Status = HttpSendHexValue ( SocketFD,
pPort,
}
Status = HttpSendHexValue ( SocketFD,
pPort,
if ( EFI_ERROR ( Status )) {
break;
}
if ( EFI_ERROR ( Status )) {
break;
}
}
Status = HttpSendHexValue ( SocketFD,
pPort,
}
Status = HttpSendHexValue ( SocketFD,
pPort,
if ( EFI_ERROR ( Status )) {
break;
}
if ( EFI_ERROR ( Status )) {
break;
}
}
Status = HttpSendAnsiString ( SocketFD,
pPort,
}
Status = HttpSendAnsiString ( SocketFD,
pPort,
- ( 0 != ( DefType & MTRR_LIB_CACHE_MTRR_ENABLED ))
+ ( 0 != DefType.Bits.E )
? "Enabled"
: "Disabled" );
if ( EFI_ERROR ( Status )) {
? "Enabled"
: "Disabled" );
if ( EFI_ERROR ( Status )) {
}
Status = HttpSendAnsiString ( SocketFD,
pPort,
}
Status = HttpSendAnsiString ( SocketFD,
pPort,
- ( 0 != ( DefType & MTRR_LIB_CACHE_FIXED_MTRR_ENABLED ))
+ ( 0 != DefType.Bits.FE )
? "Enabled"
: "Disabled" );
if ( EFI_ERROR ( Status )) {
? "Enabled"
: "Disabled" );
if ( EFI_ERROR ( Status )) {
if ( EFI_ERROR ( Status )) {
break;
}
if ( EFI_ERROR ( Status )) {
break;
}
+ Type = DefType.Uint64 & 0xff;
Status = HttpSendAnsiString ( SocketFD,
pPort,
( DIM ( mMemoryType ) > Type )
Status = HttpSendAnsiString ( SocketFD,
pPort,
( DIM ( mMemoryType ) > Type )
//
// 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,
pPort,
"<p>All memory is uncached!</p>\r\n" );
Status = HttpSendAnsiString ( SocketFD,
pPort,
"<p>All memory is uncached!</p>\r\n" );
//
// Determine if the fixed MTRRs are supported
//
//
// 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)) {
//
// 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 < MaxMtrrs ) {
+ if ( 0 < Capabilities.Bits.VCNT ) {
//
// Beginning of table
//
//
// Beginning of table
//
//
// Display the variable MTRRs
//
//
// Display the variable MTRRs
//
- for ( Count = 0; MaxMtrrs > Count; Count++ ) {
+ for ( Count = 0; Capabilities.Bits.VCNT > Count; Count++ ) {
\r
#include <Guid/EventGroup.h>\r
\r
\r
#include <Guid/EventGroup.h>\r
\r
+#include <Register/Msr.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MemoryAllocationLib.h>\r