/** @file\r
Help functions used by PCD DXE driver.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_STATUS Status;\r
UINT32 LocalTokenNumber;\r
UINT32 Offset;\r
- UINT16 StringTableIdx; \r
+ STRING_HEAD StringTableIdx; \r
BOOLEAN IsPeiDb;\r
\r
//\r
// If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of \r
// string array in string table.\r
//\r
- StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset); \r
+ StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset); \r
VaraiableDefaultBuffer = (VOID *) (StringTable + StringTableIdx); \r
Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
if (Status == EFI_SUCCESS) {\r
break;\r
\r
case PCD_TYPE_STRING:\r
- StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + Offset);\r
+ StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + Offset);\r
RetPtr = (VOID *) (StringTable + StringTableIdx);\r
break;\r
\r
\r
case PCD_TYPE_STRING:\r
if (SetPtrTypeSize (TmpTokenNumber, Size)) {\r
- CopyMem (StringTable + *((UINT16 *)InternalData), Data, *Size);\r
+ CopyMem (StringTable + *((STRING_HEAD *)InternalData), Data, *Size);\r
Status = EFI_SUCCESS;\r
} else {\r
Status = EFI_INVALID_PARAMETER;\r
if (EFI_NOT_FOUND == Status) {\r
if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {\r
CopyMem (\r
- StringTable + *(UINT16 *)(PcdDb + VariableHead->DefaultValueOffset),\r
+ StringTable + *(STRING_HEAD *)(PcdDb + VariableHead->DefaultValueOffset),\r
Data,\r
*Size\r
);\r
The driver internal functions are implmented here.\r
They build Pei PCD database, and provide access service to PCD database.\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
UINT32 LocalTokenNumber;\r
PEI_PCD_DATABASE *PeiPcdDb;\r
- UINT16 StringTableIdx;\r
+ STRING_HEAD StringTableIdx;\r
UINTN Offset;\r
VOID *InternalData;\r
UINTN MaxSize;\r
\r
case PCD_TYPE_STRING:\r
if (SetPtrTypeSize (TokenNumber, Size, PeiPcdDb)) {\r
- StringTableIdx = *((UINT16 *)InternalData);\r
+ StringTableIdx = *((STRING_HEAD *)InternalData);\r
CopyMem (&PeiPcdDb->Init.StringTable[StringTableIdx], Data, *Size);\r
return EFI_SUCCESS;\r
} else {\r
UINTN DataSize;\r
VOID *Data;\r
UINT8 *StringTable;\r
- UINT16 StringTableIdx;\r
+ STRING_HEAD StringTableIdx;\r
PEI_PCD_DATABASE *PeiPcdDb;\r
UINT32 LocalTokenNumber;\r
UINTN MaxSize;\r
// Return the default value specified by Platform Integrator \r
//\r
if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {\r
- return (VOID*)&StringTable[*(UINT16*)((UINT8*)PeiPcdDb + VariableHead->DefaultValueOffset)];\r
+ return (VOID*)&StringTable[*(STRING_HEAD*)((UINT8*)PeiPcdDb + VariableHead->DefaultValueOffset)];\r
} else {\r
return (VOID *) ((UINT8 *) PeiPcdDb + VariableHead->DefaultValueOffset);\r
}\r
return (VOID *) ((UINT8 *)PeiPcdDb + Offset);\r
\r
case PCD_TYPE_STRING:\r
- StringTableIdx = * (UINT16*) ((UINT8 *) PeiPcdDb + Offset);\r
+ StringTableIdx = * (STRING_HEAD*) ((UINT8 *) PeiPcdDb + Offset);\r
return (VOID *) (&StringTable[StringTableIdx]);\r
\r
default:\r