summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2013-12-06 09:24:47 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-06 09:24:47 +0000
commitd5ad0813ac6d7796d4c61208e906f4e84340f05f (patch)
tree42df211a74f0e24977dfbda714118e717f1450f9 /MdeModulePkg
parent97997527eec49cd605e3a3b6019054f691f76bfc (diff)
downloadedk2-platforms-d5ad0813ac6d7796d4c61208e906f4e84340f05f.tar.xz
MdeModulePkg Pcd(DXE): Use correct TokenNumber to call GetPtrTypeSize () when SKU ID enabled.
In GetLocalTokenNumber () of Service.c(DXE), the TokenNumber is wrong to call GetPtrTypeSize (). GetPtrTypeSize need the original TokenNumber. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob C Feng <bob.c.feng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14936 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index b082f0a6de..3a41bf5316 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -50,6 +50,7 @@ GetLocalTokenNumber (
IN UINTN TokenNumber
)
{
+ UINTN TmpTokenNumber;
UINT32 *LocalTokenNumberTable;
UINT32 LocalTokenNumber;
UINTN Size;
@@ -62,6 +63,11 @@ GetLocalTokenNumber (
//
TokenNumber--;
+ //
+ // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
+ //
+ TmpTokenNumber = TokenNumber;
+
LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
(UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
@@ -72,7 +78,7 @@ GetLocalTokenNumber (
if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == PCD_TYPE_SKU_ENABLED) {
if (Size == 0) {
- GetPtrTypeSize (TokenNumber, &MaxSize);
+ GetPtrTypeSize (TmpTokenNumber, &MaxSize);
} else {
MaxSize = Size;
}