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>
This commit is contained in:
Liming Gao 2017-07-11 11:33:58 +08:00
parent c6e79f2507
commit 3b341e263d
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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);