diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-06 08:47:29 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-06 08:47:29 +0000 |
commit | 6cfc72925616a2c363300332a0344c16a1da801e (patch) | |
tree | e3171c94b5ae8d0a34529783406342fc8a56a55e /MdeModulePkg/Universal | |
parent | fcb6f89d0176c3fa28a20cf3d958ee91f9c18799 (diff) | |
download | edk2-6cfc72925616a2c363300332a0344c16a1da801e.zip edk2-6cfc72925616a2c363300332a0344c16a1da801e.tar.gz edk2-6cfc72925616a2c363300332a0344c16a1da801e.tar.bz2 |
Update string offset and default offset from UINT16 to STRING_HEAD to match the generated PCD database.
Signed-off-by: lgao4
Reviewed-by: jliu66
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13081 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Service.c | 12 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PCD/Pei/Service.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 8bfd199..53780dc 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -1,7 +1,7 @@ /** @file
Help functions used by PCD DXE driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -55,7 +55,7 @@ GetWorker ( EFI_STATUS Status;
UINT32 LocalTokenNumber;
UINT32 Offset;
- UINT16 StringTableIdx;
+ STRING_HEAD StringTableIdx;
BOOLEAN IsPeiDb;
//
@@ -139,7 +139,7 @@ GetWorker ( // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of
// string array in string table.
//
- StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);
+ StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);
VaraiableDefaultBuffer = (VOID *) (StringTable + StringTableIdx);
Status = GetHiiVariable (Guid, Name, &Data, &DataSize);
if (Status == EFI_SUCCESS) {
@@ -184,7 +184,7 @@ GetWorker ( break;
case PCD_TYPE_STRING:
- StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + Offset);
+ StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + Offset);
RetPtr = (VOID *) (StringTable + StringTableIdx);
break;
@@ -815,7 +815,7 @@ SetWorker ( case PCD_TYPE_STRING:
if (SetPtrTypeSize (TmpTokenNumber, Size)) {
- CopyMem (StringTable + *((UINT16 *)InternalData), Data, *Size);
+ CopyMem (StringTable + *((STRING_HEAD *)InternalData), Data, *Size);
Status = EFI_SUCCESS;
} else {
Status = EFI_INVALID_PARAMETER;
@@ -847,7 +847,7 @@ SetWorker ( if (EFI_NOT_FOUND == Status) {
if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {
CopyMem (
- StringTable + *(UINT16 *)(PcdDb + VariableHead->DefaultValueOffset),
+ StringTable + *(STRING_HEAD *)(PcdDb + VariableHead->DefaultValueOffset),
Data,
*Size
);
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index 4769600..e5d5f0c 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -2,7 +2,7 @@ The driver internal functions are implmented here.
They build Pei PCD database, and provide access service to PCD database.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -360,7 +360,7 @@ SetWorker ( {
UINT32 LocalTokenNumber;
PEI_PCD_DATABASE *PeiPcdDb;
- UINT16 StringTableIdx;
+ STRING_HEAD StringTableIdx;
UINTN Offset;
VOID *InternalData;
UINTN MaxSize;
@@ -432,7 +432,7 @@ SetWorker ( case PCD_TYPE_STRING:
if (SetPtrTypeSize (TokenNumber, Size, PeiPcdDb)) {
- StringTableIdx = *((UINT16 *)InternalData);
+ StringTableIdx = *((STRING_HEAD *)InternalData);
CopyMem (&PeiPcdDb->Init.StringTable[StringTableIdx], Data, *Size);
return EFI_SUCCESS;
} else {
@@ -594,7 +594,7 @@ GetWorker ( UINTN DataSize;
VOID *Data;
UINT8 *StringTable;
- UINT16 StringTableIdx;
+ STRING_HEAD StringTableIdx;
PEI_PCD_DATABASE *PeiPcdDb;
UINT32 LocalTokenNumber;
UINTN MaxSize;
@@ -654,7 +654,7 @@ GetWorker ( // Return the default value specified by Platform Integrator
//
if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {
- return (VOID*)&StringTable[*(UINT16*)((UINT8*)PeiPcdDb + VariableHead->DefaultValueOffset)];
+ return (VOID*)&StringTable[*(STRING_HEAD*)((UINT8*)PeiPcdDb + VariableHead->DefaultValueOffset)];
} else {
return (VOID *) ((UINT8 *) PeiPcdDb + VariableHead->DefaultValueOffset);
}
@@ -665,7 +665,7 @@ GetWorker ( return (VOID *) ((UINT8 *)PeiPcdDb + Offset);
case PCD_TYPE_STRING:
- StringTableIdx = * (UINT16*) ((UINT8 *) PeiPcdDb + Offset);
+ StringTableIdx = * (STRING_HEAD*) ((UINT8 *) PeiPcdDb + Offset);
return (VOID *) (&StringTable[StringTableIdx]);
default:
|