summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-27 11:34:11 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-27 11:34:11 +0000
commitd09651693b1de16a0e909a004172b73e888665ac (patch)
treef132cb90a9679e85fc2874ce0d5743feeeb05835 /MdeModulePkg
parenta81c3daf0a9cbad3f5333e264ecc3a365686f6ec (diff)
downloadedk2-platforms-d09651693b1de16a0e909a004172b73e888665ac.tar.xz
Fix the bug that build tool and PCD driver can not deal with byte array or ANSIC type value for dynamic PCD.
This patch including following change: 1) Build tools: a) StringTable in generated PCD database is changed to UINT8 array but not original UINT16, because it can also stored the ANSIC and byte array. b) The layout of string table in PCD database is changed. To make sure unicode string is in double byte aligned, the item in string table which hold unicode string value will be put ahead than other items. After unicode string item, the HII variable name item is immediate. The byte array item and ANSIC string array item will be put at tail of whole string table. c) Fix bug that build tools does not handle the size of unicode string, byte array and ANSIC string. 2) PCD PEI/DXE driver: The pointer of StringTable is changed to UINT8* but not original UINT16*. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8392 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c18
-rw-r--r--MdeModulePkg/Universal/PCD/Pei/Service.c4
2 files changed, 11 insertions, 11 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index bfc17e734c..60080f13f7 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -40,7 +40,7 @@ GetWorker (
{
UINT32 *LocalTokenNumberTable;
EFI_GUID *GuidTable;
- UINT16 *StringTable;
+ UINT8 *StringTable;
EFI_GUID *Guid;
UINT16 *Name;
VARIABLE_HEAD *VariableHead;
@@ -108,9 +108,9 @@ GetWorker (
PcdDb = IsPeiDb ? ((UINT8 *) &mPcdDatabase->PeiDb) : ((UINT8 *) &mPcdDatabase->DxeDb);
if (IsPeiDb) {
- StringTable = (UINT16 *) (&mPcdDatabase->PeiDb.Init.StringTable[0]);
+ StringTable = (UINT8 *) (&mPcdDatabase->PeiDb.Init.StringTable[0]);
} else {
- StringTable = (UINT16 *) (&mPcdDatabase->DxeDb.Init.StringTable[0]);
+ StringTable = (UINT8 *) (&mPcdDatabase->DxeDb.Init.StringTable[0]);
}
@@ -132,7 +132,7 @@ GetWorker (
VariableHead = (VARIABLE_HEAD *) (PcdDb + Offset);
Guid = GuidTable + VariableHead->GuidTableIndex;
- Name = StringTable + VariableHead->StringIndex;
+ Name = (UINT16*)(StringTable + VariableHead->StringIndex);
VaraiableDefaultBuffer = (UINT8 *) PcdDb + VariableHead->DefaultValueOffset;
Status = GetHiiVariable (Guid, Name, &Data, &DataSize);
@@ -694,7 +694,7 @@ SetWorker (
BOOLEAN IsPeiDb;
UINT32 LocalTokenNumber;
EFI_GUID *GuidTable;
- UINT16 *StringTable;
+ UINT8 *StringTable;
EFI_GUID *Guid;
UINT16 *Name;
UINTN VariableOffset;
@@ -770,9 +770,9 @@ SetWorker (
PcdDb = IsPeiDb ? ((UINT8 *) &mPcdDatabase->PeiDb) : ((UINT8 *) &mPcdDatabase->DxeDb);
if (IsPeiDb) {
- StringTable = (UINT16 *) (&mPcdDatabase->PeiDb.Init.StringTable[0]);
+ StringTable = (UINT8 *) (&mPcdDatabase->PeiDb.Init.StringTable[0]);
} else {
- StringTable = (UINT16 *) (&mPcdDatabase->DxeDb.Init.StringTable[0]);
+ StringTable = (UINT8 *) (&mPcdDatabase->DxeDb.Init.StringTable[0]);
}
@@ -786,7 +786,7 @@ SetWorker (
case PCD_TYPE_STRING:
if (SetPtrTypeSize (TmpTokenNumber, Size)) {
- CopyMem (StringTable + *((UINT16 *)InternalData), Data, *Size);
+ CopyMem (StringTable + *((UINT8 *)InternalData), Data, *Size);
Status = EFI_SUCCESS;
} else {
Status = EFI_INVALID_PARAMETER;
@@ -810,7 +810,7 @@ SetWorker (
VariableHead = (VARIABLE_HEAD *) (PcdDb + Offset);
Guid = GuidTable + VariableHead->GuidTableIndex;
- Name = StringTable + VariableHead->StringIndex;
+ Name = (UINT16*) (StringTable + VariableHead->StringIndex);
VariableOffset = VariableHead->Offset;
Status = SetHiiVariable (Guid, Name, Data, *Size, VariableOffset);
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c
index 5bc1dc8205..ff59b81dcd 100644
--- a/MdeModulePkg/Universal/PCD/Pei/Service.c
+++ b/MdeModulePkg/Universal/PCD/Pei/Service.c
@@ -573,7 +573,7 @@ GetWorker (
EFI_STATUS Status;
UINTN DataSize;
VOID *Data;
- UINT16 *StringTable;
+ UINT8 *StringTable;
UINT16 StringTableIdx;
PEI_PCD_DATABASE *PeiPcdDb;
UINT32 LocalTokenNumber;
@@ -622,7 +622,7 @@ GetWorker (
VariableHead = (VARIABLE_HEAD *) ((UINT8 *)PeiPcdDb + Offset);
Guid = &(PeiPcdDb->Init.GuidTable[VariableHead->GuidTableIndex]);
- Name = &StringTable[VariableHead->StringIndex];
+ Name = (UINT16*)&StringTable[VariableHead->StringIndex];
Status = GetHiiVariable (Guid, Name, &Data, &DataSize);