]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update string offset and default offset from UINT16 to STRING_HEAD to match the gener...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 6 Mar 2012 08:47:29 +0000 (08:47 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 6 Mar 2012 08:47:29 +0000 (08:47 +0000)
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

MdeModulePkg/Universal/PCD/Dxe/Service.c
MdeModulePkg/Universal/PCD/Pei/Service.c

index 8bfd199e4826bb25ac77a95f1fce599821e0e73b..53780dca9fac2db9d2713fff74a3495e26071064 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -55,7 +55,7 @@ GetWorker (
   EFI_STATUS          Status;\r
   UINT32              LocalTokenNumber;\r
   UINT32              Offset;\r
-  UINT16              StringTableIdx;      \r
+  STRING_HEAD         StringTableIdx;      \r
   BOOLEAN             IsPeiDb;\r
 \r
   //\r
@@ -139,7 +139,7 @@ GetWorker (
                // 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
@@ -184,7 +184,7 @@ GetWorker (
       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
@@ -815,7 +815,7 @@ SetWorker (
     \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
@@ -847,7 +847,7 @@ SetWorker (
       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
index 4769600da762d9f7811b99efd45ce0ff0a7fa437..e5d5f0c2085fbc49af613eb3bff95f8fb80bf443 100644 (file)
@@ -2,7 +2,7 @@
   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
@@ -360,7 +360,7 @@ SetWorker (
 {\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
@@ -432,7 +432,7 @@ SetWorker (
 \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
@@ -594,7 +594,7 @@ GetWorker (
   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
@@ -654,7 +654,7 @@ GetWorker (
         // 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
@@ -665,7 +665,7 @@ GetWorker (
       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