mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
97997527ee
commit
d5ad0813ac
|
@ -50,6 +50,7 @@ GetLocalTokenNumber (
|
||||||
IN UINTN TokenNumber
|
IN UINTN TokenNumber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
UINTN TmpTokenNumber;
|
||||||
UINT32 *LocalTokenNumberTable;
|
UINT32 *LocalTokenNumberTable;
|
||||||
UINT32 LocalTokenNumber;
|
UINT32 LocalTokenNumber;
|
||||||
UINTN Size;
|
UINTN Size;
|
||||||
|
@ -62,6 +63,11 @@ GetLocalTokenNumber (
|
||||||
//
|
//
|
||||||
TokenNumber--;
|
TokenNumber--;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
|
||||||
|
//
|
||||||
|
TmpTokenNumber = TokenNumber;
|
||||||
|
|
||||||
LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
|
LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
|
||||||
(UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
|
(UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
|
||||||
TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
|
TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
|
||||||
|
@ -72,7 +78,7 @@ GetLocalTokenNumber (
|
||||||
|
|
||||||
if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == PCD_TYPE_SKU_ENABLED) {
|
if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == PCD_TYPE_SKU_ENABLED) {
|
||||||
if (Size == 0) {
|
if (Size == 0) {
|
||||||
GetPtrTypeSize (TokenNumber, &MaxSize);
|
GetPtrTypeSize (TmpTokenNumber, &MaxSize);
|
||||||
} else {
|
} else {
|
||||||
MaxSize = Size;
|
MaxSize = Size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue