diff options
author | Liming Gao <liming.gao@intel.com> | 2017-07-11 11:33:58 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-07-26 09:00:30 +0800 |
commit | 3b341e263da957b2c8896317f41cc32880c878b0 (patch) | |
tree | 6104cce13411e2a8c32ce30f352a47cf35535ec0 /UefiCpuPkg | |
parent | c6e79f25070813eb42f9f4318df7f55fdf6799af (diff) | |
download | edk2-3b341e263da957b2c8896317f41cc32880c878b0.tar.gz edk2-3b341e263da957b2c8896317f41cc32880c878b0.tar.bz2 edk2-3b341e263da957b2c8896317f41cc32880c878b0.zip |
UefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN
PcdGetSize() returns UINTN data type. The consumer code should use UINTN data
to get its size.
This issue is found when PcdCpuFeaturesSupport is configured as patchable.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index 7a7673035d..54c98272ac 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -149,7 +149,7 @@ CpuInitDataInitialize ( CpuFeaturesData = GetCpuFeaturesData ();
CpuFeaturesData->InitOrder = AllocateZeroPool (sizeof (CPU_FEATURES_INIT_ORDER) * NumberOfCpus);
ASSERT (CpuFeaturesData->InitOrder != NULL);
- CpuFeaturesData->BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport);
+ CpuFeaturesData->BitMaskSize = (UINT32) PcdGetSize (PcdCpuFeaturesSupport);
//
// Collect CPU Features information
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c index 338f1a495c..dd6a82be7a 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c @@ -29,7 +29,7 @@ IsCpuFeatureMatch ( IN UINT8 *SecondFeatureMask
)
{
- UINT32 BitMaskSize;
+ UINTN BitMaskSize;
BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport);
if (CompareMem (FirstFeatureMask, SecondFeatureMask, BitMaskSize) == 0) {
@@ -51,7 +51,7 @@ DumpCpuFeatureMask ( {
UINTN Index;
UINT8 *Data8;
- UINT32 BitMaskSize;
+ UINTN BitMaskSize;
BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport);
Data8 = (UINT8 *) FeatureMask;
@@ -258,7 +258,7 @@ RegisterCpuFeatureWorker ( CPU_FEATURES_DATA *CpuFeaturesData;
CPU_FEATURES_ENTRY *CpuFeatureEntry;
LIST_ENTRY *Entry;
- UINT32 BitMaskSize;
+ UINTN BitMaskSize;
BOOLEAN FeatureExist;
BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport);
@@ -267,7 +267,7 @@ RegisterCpuFeatureWorker ( InitializeListHead (&CpuFeaturesData->FeatureList);
InitializeSpinLock (&CpuFeaturesData->MsrLock);
InitializeSpinLock (&CpuFeaturesData->MemoryMappedLock);
- CpuFeaturesData->BitMaskSize = BitMaskSize;
+ CpuFeaturesData->BitMaskSize = (UINT32) BitMaskSize;
}
ASSERT (CpuFeaturesData->BitMaskSize == BitMaskSize);
|