From: "Fan, Jeff" <jeff.fan@intel.com>
To: "Gao, Liming" <liming.gao@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] UefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN
Date: Tue, 11 Jul 2017 15:08:14 +0000 [thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C623EEE@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1499744038-13992-1-git-send-email-liming.gao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Tuesday, July 11, 2017 11:34 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch] 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>
---
UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 2 +-
.../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 5e11b2b..e305aca 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 338f1a4..dd6a82b 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);
--
2.8.0.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2017-07-11 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 3:33 [Patch] UefiCpuPkg: Update RegisterCpuFeaturesLib to consume PcdGetSize with UINTN Liming Gao
2017-07-11 15:08 ` Fan, Jeff [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542CF652F8836A4AB8DBFAAD40ED192A4C623EEE@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox