]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Added LibPatchPcdSetPtr.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 4 Jul 2006 12:43:59 +0000 (12:43 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 4 Jul 2006 12:43:59 +0000 (12:43 +0000)
Cleaup Pcd Database code generation routine.
Fixed a few bugs.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@745 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Universal/PCD/Dxe/Service.c
EdkModulePkg/Universal/PCD/Pei/Service.c
MdePkg/Include/Library/PcdLib.h
MdePkg/Library/BasePcdLibNull/BasePcdLibNull.msa
MdePkg/Library/BasePcdLibNull/PcdLib.c
MdePkg/Library/DxePcdLib/DxePcdLib.c
MdePkg/Library/DxePcdLib/DxePcdLib.msa
MdePkg/Library/PeiPcdLib/PeiPcdLib.c
MdePkg/Library/PeiPcdLib/PeiPcdLib.msa
Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java

index 717a4345ea11df329815b0a25ce96f28163e7a92..771c4db54d77cca45038ba4ffd12e6b43abbd56c 100644 (file)
@@ -102,7 +102,6 @@ GetWorker (
 \r
       Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
       if (Status == EFI_SUCCESS) {\r
 \r
       Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
       if (Status == EFI_SUCCESS) {\r
-        ASSERT (DataSize >= (UINTN) (VariableHead->Offset + Size));\r
         return (UINT8 *) Data + VariableHead->Offset;\r
       } else {\r
         //\r
         return (UINT8 *) Data + VariableHead->Offset;\r
       } else {\r
         //\r
index 011e3aa36ef4d9133988355ec18771184b2f4001..a85d1d1786a22d3bea2c179cacce6531f27014a5 100644 (file)
@@ -16,7 +16,6 @@ Module Name: Service.c
 **/\r
 #include "Service.h"\r
 \r
 **/\r
 #include "Service.h"\r
 \r
-\r
 /**\r
   The function registers the CallBackOnSet fucntion\r
   according to TokenNumber and EFI_GUID space.\r
 /**\r
   The function registers the CallBackOnSet fucntion\r
   according to TokenNumber and EFI_GUID space.\r
@@ -496,7 +495,6 @@ GetWorker (
       Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
 \r
       if (Status == EFI_SUCCESS) {\r
       Status = GetHiiVariable (Guid, Name, &Data, &DataSize);\r
 \r
       if (Status == EFI_SUCCESS) {\r
-        ASSERT (DataSize >= (UINTN) (VariableHead->Offset + Size));\r
         return (VOID *) ((UINT8 *) Data + VariableHead->Offset);\r
       } else {\r
         //\r
         return (VOID *) ((UINT8 *) Data + VariableHead->Offset);\r
       } else {\r
         //\r
index fe8a1e6939c7749c835a9d1420dde842fef0548e..37d435596e0327be2d09a4810f7aa810f21ca7f1 100644 (file)
@@ -725,17 +725,45 @@ LibPcdGetNextToken (
 \r
 \r
   \r
 \r
 \r
   \r
-  @param[in]  Pointer to a 128-bit unique value that designates from which namespace \r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates from which namespace \r
               to start the search.\r
 \r
   @retval CONST GUID *  The next valid token namespace.\r
 \r
 **/\r
               to start the search.\r
 \r
   @retval CONST GUID *  The next valid token namespace.\r
 \r
 **/\r
-\r
 GUID *           \r
 EFIAPI\r
 LibPcdGetNextTokenSpace (\r
   IN CONST GUID  *Guid\r
   );\r
 \r
 GUID *           \r
 EFIAPI\r
 LibPcdGetNextTokenSpace (\r
   IN CONST GUID  *Guid\r
   );\r
 \r
+\r
+/**\r
+  Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+  and SizeOfValue.  Buffer is returned.  If SizeOfValue is greater than \r
+  MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
+  NULL to indicate that the set operation was not actually performed.  \r
+  If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
+  MaximumDatumSize and NULL must be returned.\r
+  \r
+  If PatchVariable is NULL, then ASSERT().\r
+  If SizeOfValue is NULL, then ASSERT().\r
+  If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
+\r
+  @param[in] PatchVariable      A pointer to the global variable in a module that is \r
+                                the target of the set operation.\r
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.\r
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.\r
+  @param[in] Buffer             A pointer to the buffer to used to set the target variable.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtr (\r
+  IN        VOID        *PatchVariable,\r
+  IN        UINTN       MaximumDatumSize,\r
+  IN OUT    UINTN       *SizeOfBuffer,\r
+  IN CONST  VOID        *Buffer\r
+  );\r
+\r
 #endif\r
 #endif\r
index 26d6609b5141c3ad9d3939c44aba9729b1acf9a4..564ccc1e28a024f5a6923d06a7161bd28e4229da 100644 (file)
@@ -8,11 +8,11 @@
     <Abstract>NULL PCD Library</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
     <Abstract>NULL PCD Library</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
-    <License>All rights reserved. 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
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+    <License>All rights reserved. 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
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
@@ -28,6 +28,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>DebugLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>DebugLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PcdLib.c</Filename>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PcdLib.c</Filename>\r
@@ -39,4 +42,4 @@
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   </Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+</ModuleSurfaceArea>\r
index a2e46b05b2e3f84ac2742524b325e588d03d24a5..e58965cc686f3f643d10cb5c0c92b5a2f9306ee7 100644 (file)
@@ -780,3 +780,52 @@ LibPcdGetNextTokenSpace (
 {\r
   return NULL;\r
 }\r
 {\r
   return NULL;\r
 }\r
+\r
+\r
+\r
+/**\r
+  Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+  and SizeOfValue.  Buffer is returned.  If SizeOfValue is greater than \r
+  MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
+  NULL to indicate that the set operation was not actually performed.  \r
+  If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
+  MaximumDatumSize and NULL must be returned.\r
+  \r
+  If PatchVariable is NULL, then ASSERT().\r
+  If SizeOfValue is NULL, then ASSERT().\r
+  If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
+\r
+  @param[in] PatchVariable      A pointer to the global variable in a module that is \r
+                                the target of the set operation.\r
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.\r
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.\r
+  @param[in] Buffer             A pointer to the buffer to used to set the target variable.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtr (\r
+  IN        VOID        *PatchVariable,\r
+  IN        UINTN       MaximumDatumSize,\r
+  IN OUT    UINTN       *SizeOfBuffer,\r
+  IN CONST  VOID        *Buffer\r
+  )\r
+{\r
+  ASSERT (PatchVariable != NULL);\r
+  ASSERT (SizeOfBuffer  != NULL);\r
+  \r
+  if (*SizeOfBuffer > 0) {\r
+    ASSERT (Buffer != NULL);\r
+  }\r
+\r
+  if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+      (*SizeOfBuffer == MAX_ADDRESS)) {\r
+    *SizeOfBuffer = MaximumDatumSize;\r
+    return NULL;\r
+  }\r
+    \r
+  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+  \r
+  return (VOID *) Buffer;\r
+}\r
+\r
index b746614d5be64fd4d8c6b51ca25dadb1b27408aa..f0b0cbd8f662cac8c30ed4bb3c12a0383b35a74f 100644 (file)
@@ -923,3 +923,52 @@ LibPcdGetNextTokenSpace (
   return (GUID *) Guid;\r
 }\r
 \r
   return (GUID *) Guid;\r
 }\r
 \r
+\r
+/**\r
+  Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+  and SizeOfValue.  Buffer is returned.  If SizeOfValue is greater than \r
+  MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
+  NULL to indicate that the set operation was not actually performed.  \r
+  If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
+  MaximumDatumSize and NULL must be returned.\r
+  \r
+  If PatchVariable is NULL, then ASSERT().\r
+  If SizeOfValue is NULL, then ASSERT().\r
+  If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
+\r
+  @param[in] PatchVariable      A pointer to the global variable in a module that is \r
+                                the target of the set operation.\r
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.\r
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.\r
+  @param[in] Buffer             A pointer to the buffer to used to set the target variable.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtr (\r
+  IN        VOID        *PatchVariable,\r
+  IN        UINTN       MaximumDatumSize,\r
+  IN OUT    UINTN       *SizeOfBuffer,\r
+  IN CONST  VOID        *Buffer\r
+  )\r
+{\r
+  ASSERT (PatchVariable != NULL);\r
+  ASSERT (SizeOfBuffer  != NULL);\r
+  \r
+  if (*SizeOfBuffer > 0) {\r
+    ASSERT (Buffer != NULL);\r
+  }\r
+\r
+  if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+      (*SizeOfBuffer == MAX_ADDRESS)) {\r
+    *SizeOfBuffer = MaximumDatumSize;\r
+    return NULL;\r
+  }\r
+    \r
+  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+  \r
+  return (VOID *) Buffer;\r
+}\r
+\r
+\r
+\r
index c250fbeb3afb46624adce6c6197ae4933eddf79e..c50ac45220d5cadab054c35a889c48ac9908749e 100644 (file)
@@ -8,11 +8,11 @@
     <Abstract>IO Library implemented with Framework CPU IO Protocol</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
     <Abstract>IO Library implemented with Framework CPU IO Protocol</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-    <License>All rights reserved. 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
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+    <License>All rights reserved. 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
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
@@ -31,6 +31,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>DxePcdLib.c</Filename>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>DxePcdLib.c</Filename>\r
@@ -50,4 +53,4 @@
       <Constructor>PcdLibConstructor</Constructor>\r
     </Extern>\r
   </Externs>\r
       <Constructor>PcdLibConstructor</Constructor>\r
     </Extern>\r
   </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+</ModuleSurfaceArea>\r
index 57fa8211562240f0d2c63a8bd2bb60be1ca1173c..bee53860977c9f522e691064c135a54b9c919592 100644 (file)
@@ -1022,3 +1022,52 @@ LibPcdGetNextTokenSpace (
   return (GUID *)Guid;\r
 }\r
 \r
   return (GUID *)Guid;\r
 }\r
 \r
+\r
+\r
+/**\r
+  Sets the PCD entry specified by PatchVariable to the value specified by Buffer \r
+  and SizeOfValue.  Buffer is returned.  If SizeOfValue is greater than \r
+  MaximumDatumSize, then set SizeOfValue to MaximumDatumSize and return \r
+  NULL to indicate that the set operation was not actually performed.  \r
+  If SizeOfValue is set to MAX_ADDRESS, then SizeOfValue must be set to \r
+  MaximumDatumSize and NULL must be returned.\r
+  \r
+  If PatchVariable is NULL, then ASSERT().\r
+  If SizeOfValue is NULL, then ASSERT().\r
+  If SizeOfValue > 0 and Buffer is NULL, then ASSERT().\r
+\r
+  @param[in] PatchVariable      A pointer to the global variable in a module that is \r
+                                the target of the set operation.\r
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.\r
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.\r
+  @param[in] Buffer             A pointer to the buffer to used to set the target variable.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPatchPcdSetPtr (\r
+  IN        VOID        *PatchVariable,\r
+  IN        UINTN       MaximumDatumSize,\r
+  IN OUT    UINTN       *SizeOfBuffer,\r
+  IN CONST  VOID        *Buffer\r
+  )\r
+{\r
+  ASSERT (PatchVariable != NULL);\r
+  ASSERT (SizeOfBuffer  != NULL);\r
+  \r
+  if (*SizeOfBuffer > 0) {\r
+    ASSERT (Buffer != NULL);\r
+  }\r
+\r
+  if ((*SizeOfBuffer > MaximumDatumSize) ||\r
+      (*SizeOfBuffer == MAX_ADDRESS)) {\r
+    *SizeOfBuffer = MaximumDatumSize;\r
+    return NULL;\r
+  }\r
+    \r
+  CopyMem (PatchVariable, Buffer, *SizeOfBuffer);\r
+  \r
+  return (VOID *) Buffer;\r
+}\r
+\r
+\r
index 8c3c1e73f87ec77288bf8a2bf0ef2085f20eeae3..e4923679c836631db2d4b6752ac80895f91dc35c 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
   <MsaHeader>\r
     <ModuleName>PeiPcdLib</ModuleName>\r
 <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
   <MsaHeader>\r
     <ModuleName>PeiPcdLib</ModuleName>\r
@@ -8,11 +8,11 @@
     <Abstract>PCD Library Instance implemented with PCD PPI.</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
     <Abstract>PCD Library Instance implemented with PCD PPI.</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
-    <License>All rights reserved. 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
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+    <License>All rights reserved. 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
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
@@ -34,6 +34,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>PeiServicesTablePointerLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>PeiServicesTablePointerLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiPcdLib.c</Filename>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiPcdLib.c</Filename>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
   </PackageDependencies>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
   </PackageDependencies>\r
+  <PPIs>\r
+    <Ppi Usage="ALWAYS_CONSUMED">\r
+      <PpiCName>PcdPpi</PpiCName>\r
+    </Ppi>\r
+  </PPIs>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   </Externs>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+</ModuleSurfaceArea>\r
index 6686de9f1d8592387800cd5f09a849b3d09bc549..c576363074cb561279ce13ec688d7d514ec8b9df 100644 (file)
@@ -23,7 +23,6 @@ import java.io.FileReader;
 import java.io.IOException;\r
 import java.math.BigInteger;\r
 import java.util.ArrayList;\r
 import java.io.IOException;\r
 import java.math.BigInteger;\r
 import java.util.ArrayList;\r
-import java.util.Collections;\r
 import java.util.Comparator;\r
 import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.Comparator;\r
 import java.util.HashMap;\r
 import java.util.Iterator;\r
@@ -36,22 +35,14 @@ import java.util.regex.Pattern;
 \r
 import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
 \r
 import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
-import org.tianocore.DynamicPcdBuildDefinitionsDocument;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;\r
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData;\r
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;\r
 import org.tianocore.FrameworkModulesDocument;\r
 import org.tianocore.FrameworkModulesDocument;\r
-import org.tianocore.PcdDeclarationsDocument;\r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
 import org.tianocore.PcdBuildDefinitionDocument;\r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
 import org.tianocore.PcdBuildDefinitionDocument;\r
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
 import org.tianocore.ModuleSADocument;\r
 import org.tianocore.ModuleSADocument;\r
-import org.tianocore.ModuleSADocument.ModuleSA;\r
-import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.global.GlobalData;\r
 import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.global.GlobalData;\r
-import org.tianocore.build.global.SurfaceAreaQuery;\r
 import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.pcd.action.ActionMessage;\r
 import org.tianocore.build.pcd.entity.DynamicTokenValue;\r
 import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.pcd.action.ActionMessage;\r
 import org.tianocore.build.pcd.entity.DynamicTokenValue;\r
@@ -60,8 +51,16 @@ import org.tianocore.build.pcd.entity.SkuInstance;
 import org.tianocore.build.pcd.entity.Token;\r
 import org.tianocore.build.pcd.entity.UsageInstance;\r
 import org.tianocore.build.pcd.exception.EntityException;\r
 import org.tianocore.build.pcd.entity.Token;\r
 import org.tianocore.build.pcd.entity.UsageInstance;\r
 import org.tianocore.build.pcd.exception.EntityException;\r
-import org.tianocore.logger.EdkLog;\r
-import org.tianocore.ModuleTypeDef;\r
+\r
+/**\r
+    CStructTypeDeclaration   \r
+    \r
+    This class is used to store the declaration string, such as\r
+    "UINT32 PcdPlatformFlashBaseAddress", of \r
+    each memember in the C structure, which is a standard C language\r
+    feature used to implement a simple and efficient database for\r
+    dynamic(ex) type PCD entry.\r
+**/\r
 \r
 class CStructTypeDeclaration {\r
     String key;\r
 \r
 class CStructTypeDeclaration {\r
     String key;\r
@@ -77,6 +76,12 @@ class CStructTypeDeclaration {
     }\r
 }\r
 \r
     }\r
 }\r
 \r
+/**\r
+    StringTable   \r
+    \r
+    This class is used to store the String in a PCD database.\r
+    \r
+**/\r
 class StringTable {\r
     private ArrayList<String>   al; \r
     private ArrayList<String>   alComments;\r
 class StringTable {\r
     private ArrayList<String>   al; \r
     private ArrayList<String>   alComments;\r
@@ -101,15 +106,11 @@ class StringTable {
         return len == 0 ? 1 : len;\r
     }\r
 \r
         return len == 0 ? 1 : len;\r
     }\r
 \r
-    public int getTableLen () {\r
-        return al.size() == 0 ? 1 : al.size();\r
-    }\r
-\r
     public String getExistanceMacro () {\r
         return String.format(PcdDatabase.StringTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
     \r
     public String getExistanceMacro () {\r
         return String.format(PcdDatabase.StringTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
     \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable) {\r
         final String stringTable = "StringTable";\r
         final String tab         = "\t";\r
         final String newLine     = "\r\n";\r
         final String stringTable = "StringTable";\r
         final String tab         = "\t";\r
         final String newLine     = "\r\n";\r
@@ -154,11 +155,15 @@ class StringTable {
                     stringTableName = String.format("%s_%d", stringTable, i);\r
                     cDeclCode += tab;\r
                 }\r
                     stringTableName = String.format("%s_%d", stringTable, i);\r
                     cDeclCode += tab;\r
                 }\r
-                cDeclCode += String.format("%-20s%s[%d]; /* %s */", "UINT16", stringTableName, str.length() + 1, alComments.get(i)) + newLine;\r
+                cDeclCode += String.format("%-20s%s[%d]; /* %s */", "UINT16", \r
+                                           stringTableName, str.length() + 1, \r
+                                           alComments.get(i)) \r
+                             + newLine;\r
                 \r
                 if (i == 0) {\r
                     cInstCode = "/* StringTable */" + newLine;\r
                 }\r
                 \r
                 if (i == 0) {\r
                     cInstCode = "/* StringTable */" + newLine;\r
                 }\r
+                \r
                 cInstCode += tab + String.format("L\"%s\" /* %s */", al.get(i), alComments.get(i));\r
                 if (i != al.size() - 1) {\r
                     cInstCode += commaNewLine;\r
                 cInstCode += tab + String.format("L\"%s\" /* %s */", al.get(i), alComments.get(i));\r
                 if (i != al.size() - 1) {\r
                     cInstCode += commaNewLine;\r
@@ -177,59 +182,6 @@ class StringTable {
         }\r
     }\r
 \r
         }\r
     }\r
 \r
-    public String getTypeDeclaration () {\r
-\r
-        String output;\r
-\r
-        final String stringTable = "StringTable";\r
-        final String tab = "\t";\r
-        final String newLine = ";\r\n";\r
-\r
-        output =  "/* StringTable */\r\n";\r
-\r
-        if (al.size() == 0) {\r
-            output += tab + String.format("UINT16 %s[1] /* StringTable is Empty */", stringTable) + newLine;\r
-        }\r
-\r
-        for (int i = 0; i < al.size(); i++) {\r
-            String str = al.get(i);\r
-\r
-            if (i == 0) {\r
-                //\r
-                // StringTable is a well-known name in the PCD DXE driver\r
-                //\r
-                output += tab + String.format("UINT16       %s[%d] /* %s */", stringTable, str.length() + 1, alComments.get(i)) + newLine;\r
-            } else {\r
-                output += tab + String.format("UINT16       %s_%d[%d] /* %s */", stringTable, i, str.length() + 1, alComments.get(i)) + newLine;\r
-            }\r
-        }\r
-\r
-        return output;\r
-\r
-    }\r
-\r
-    public ArrayList<String> getInstantiation () {\r
-        ArrayList<String> output = new ArrayList<String>();\r
-\r
-        output.add("/* StringTable */"); \r
-\r
-        if (al.size() == 0) {\r
-            output.add("{ 0 }");\r
-        } else {\r
-            String str;\r
-\r
-            for (int i = 0; i < al.size(); i++) {\r
-                str = String.format("L\"%s\" /* %s */", al.get(i), alComments.get(i));\r
-                if (i != al.size() - 1) {\r
-                    str += ",";\r
-                }\r
-                output.add(str);\r
-            }\r
-        }\r
-\r
-        return output;\r
-    }\r
-\r
     public int add (String inputStr, Token token) {\r
         int i;\r
         int pos;\r
     public int add (String inputStr, Token token) {\r
         int i;\r
         int pos;\r
@@ -254,7 +206,6 @@ class StringTable {
                 return pos;\r
             }\r
             pos = s.length() + 1;\r
                 return pos;\r
             }\r
             pos = s.length() + 1;\r
-            \r
         }\r
         \r
         i = len;\r
         }\r
         \r
         i = len;\r
@@ -269,6 +220,13 @@ class StringTable {
     }\r
 }\r
 \r
     }\r
 }\r
 \r
+/**\r
+    SizeTable   \r
+    \r
+    This class is used to store the Size information for\r
+    POINTER TYPE PCD entry in a PCD database.\r
+\r
+**/\r
 class SizeTable {\r
     private ArrayList<Integer>  al;\r
     private ArrayList<String>   alComments;\r
 class SizeTable {\r
     private ArrayList<Integer>  al;\r
     private ArrayList<String>   alComments;\r
@@ -282,7 +240,7 @@ class SizeTable {
         len = 0;\r
     }\r
 \r
         len = 0;\r
     }\r
 \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
         final String name = "SizeTable";\r
         \r
         CStructTypeDeclaration decl;\r
         final String name = "SizeTable";\r
         \r
         CStructTypeDeclaration decl;\r
@@ -302,11 +260,7 @@ class SizeTable {
         instTable.put(name, cCode);\r
     }\r
 \r
         instTable.put(name, cCode);\r
     }\r
 \r
-    public String getTypeDeclaration () {\r
-        return String.format(PcdDatabase.SizeTableDeclaration, phase);\r
-    }\r
-\r
-    public ArrayList<String> getInstantiation () {\r
+    private ArrayList<String> getInstantiation () {\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* SizeTable */");\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* SizeTable */");\r
@@ -348,6 +302,11 @@ class SizeTable {
 \r
 }\r
 \r
 \r
 }\r
 \r
+/**\r
+    GuidTable   \r
+    \r
+    This class is used to store the GUIDs in a PCD database.\r
+**/\r
 class GuidTable {\r
     private ArrayList<UUID> al;\r
     private ArrayList<String> alComments;\r
 class GuidTable {\r
     private ArrayList<UUID> al;\r
     private ArrayList<String> alComments;\r
@@ -375,7 +334,7 @@ class GuidTable {
         return String.format(PcdDatabase.GuidTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
         return String.format(PcdDatabase.GuidTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
         final String name = "GuidTable";\r
         \r
         CStructTypeDeclaration decl;\r
         final String name = "GuidTable";\r
         \r
         CStructTypeDeclaration decl;\r
@@ -395,10 +354,6 @@ class GuidTable {
         instTable.put(name, cCode);\r
     }\r
 \r
         instTable.put(name, cCode);\r
     }\r
 \r
-    public String getTypeDeclaration () {\r
-        return String.format(PcdDatabase.GuidTableDeclaration, phase);\r
-    }\r
-\r
     private String getUuidCString (UUID uuid) {\r
         String[]  guidStrArray;\r
 \r
     private String getUuidCString (UUID uuid) {\r
         String[]  guidStrArray;\r
 \r
@@ -419,7 +374,7 @@ class GuidTable {
                                         );\r
     }\r
 \r
                                         );\r
     }\r
 \r
-    public ArrayList<String> getInstantiation () {\r
+    private ArrayList<String> getInstantiation () {\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* GuidTable */");\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* GuidTable */");\r
@@ -466,12 +421,14 @@ class GuidTable {
         return len - 1;\r
     }\r
 \r
         return len - 1;\r
     }\r
 \r
-    public int getTableLen () {\r
-        return al.size() == 0 ? 0 : al.size();\r
-    }\r
-\r
 }\r
 \r
 }\r
 \r
+/**\r
+    SkuIdTable   \r
+    \r
+    This class is used to store the SKU IDs in a PCD database.\r
+\r
+**/\r
 class SkuIdTable {\r
     private ArrayList<Integer[]> al;\r
     private ArrayList<String>    alComment;\r
 class SkuIdTable {\r
     private ArrayList<Integer[]> al;\r
     private ArrayList<String>    alComment;\r
@@ -497,7 +454,7 @@ class SkuIdTable {
         return String.format(PcdDatabase.SkuTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
         return String.format(PcdDatabase.SkuTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
         final String name = "SkuIdTable";\r
         \r
         CStructTypeDeclaration decl;\r
         final String name = "SkuIdTable";\r
         \r
         CStructTypeDeclaration decl;\r
@@ -533,11 +490,7 @@ class SkuIdTable {
 \r
     }\r
 \r
 \r
     }\r
 \r
-    public String getTypeDeclaration () {\r
-        return String.format(PcdDatabase.SkuIdTableDeclaration, phase);\r
-    }\r
-\r
-    public ArrayList<String> getInstantiation () {\r
+    private ArrayList<String> getInstantiation () {\r
         ArrayList<String> Output = new ArrayList<String> ();\r
 \r
         Output.add("/* SkuIdTable */");\r
         ArrayList<String> Output = new ArrayList<String> ();\r
 \r
         Output.add("/* SkuIdTable */");\r
@@ -617,10 +570,6 @@ class SkuIdTable {
         return index;\r
     }\r
 \r
         return index;\r
     }\r
 \r
-    public int getTableLen () {\r
-        return al.size() == 0 ? 1 : al.size();\r
-    }\r
-\r
 }\r
 \r
 class LocalTokenNumberTable {\r
 }\r
 \r
 class LocalTokenNumberTable {\r
@@ -650,7 +599,7 @@ class LocalTokenNumberTable {
         return String.format(PcdDatabase.DatabaseExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
         return String.format(PcdDatabase.DatabaseExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
         final String name = "LocalTokenNumberTable";\r
         \r
         CStructTypeDeclaration decl;\r
         final String name = "LocalTokenNumberTable";\r
         \r
         CStructTypeDeclaration decl;\r
@@ -669,11 +618,7 @@ class LocalTokenNumberTable {
         instTable.put(name, cCode);\r
     }\r
 \r
         instTable.put(name, cCode);\r
     }\r
 \r
-    public String getTypeDeclaration () {\r
-        return String.format(PcdDatabase.LocalTokenNumberTableDeclaration, phase);\r
-    }\r
-\r
-    public ArrayList<String> getInstantiation () {\r
+    private ArrayList<String> getInstantiation () {\r
         ArrayList<String> output = new ArrayList<String>();\r
 \r
         output.add("/* LocalTokenNumberTable */");\r
         ArrayList<String> output = new ArrayList<String>();\r
 \r
         output.add("/* LocalTokenNumberTable */");\r
@@ -735,8 +680,22 @@ class LocalTokenNumberTable {
     }\r
 }\r
 \r
     }\r
 }\r
 \r
+/**\r
+    ExMapTable   \r
+    \r
+    This class is used to store the table of mapping information\r
+    between DynamicEX ID pair(Guid, TokenNumber) and\r
+    the local token number assigned by PcdDatabase class.\r
+**/\r
 class ExMapTable {\r
 \r
 class ExMapTable {\r
 \r
+    /**\r
+        ExTriplet   \r
+        \r
+        This class is used to store the mapping information\r
+        between DynamicEX ID pair(Guid, TokenNumber) and\r
+        the local token number assigned by PcdDatabase class.\r
+    **/\r
     class ExTriplet {\r
         public Integer guidTableIdx;\r
         public Long exTokenNumber;\r
     class ExTriplet {\r
         public Integer guidTableIdx;\r
         public Long exTokenNumber;\r
@@ -772,7 +731,7 @@ class ExMapTable {
         return String.format(PcdDatabase.ExMapTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
         return String.format(PcdDatabase.ExMapTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");\r
     }\r
 \r
-    public void genCodeNew (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
+    public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {\r
         final String exMapTableName = "ExMapTable";\r
         \r
         sortTable();\r
         final String exMapTableName = "ExMapTable";\r
         \r
         sortTable();\r
@@ -794,11 +753,7 @@ class ExMapTable {
         instTable.put(exMapTableName, cCode);\r
     }\r
     \r
         instTable.put(exMapTableName, cCode);\r
     }\r
     \r
-    public String getTypeDeclaration () {\r
-        return String.format(PcdDatabase.ExMapTableDeclaration, phase);\r
-    }\r
-\r
-    public ArrayList<String> getInstantiation () {\r
+    private ArrayList<String> getInstantiation () {\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* ExMapTable */");\r
         ArrayList<String> Output = new ArrayList<String>();\r
 \r
         Output.add("/* ExMapTable */");\r
@@ -843,7 +798,7 @@ class ExMapTable {
         return index;\r
     }\r
 \r
         return index;\r
     }\r
 \r
-    public int getTableLen () {\r
+    private int getTableLen () {\r
         return al.size() == 0 ? 1 : al.size();\r
     }\r
 \r
         return al.size() == 0 ? 1 : al.size();\r
     }\r
 \r
@@ -857,12 +812,15 @@ class ExMapTable {
     class ExTripletComp implements Comparator<ExTriplet> {\r
         public int compare (ExTriplet a, ExTriplet b) {\r
             if (a.guidTableIdx == b.guidTableIdx ) {\r
     class ExTripletComp implements Comparator<ExTriplet> {\r
         public int compare (ExTriplet a, ExTriplet b) {\r
             if (a.guidTableIdx == b.guidTableIdx ) {\r
+                //\r
+                // exTokenNumber is long, we can't use simple substraction.\r
+                //\r
                 if (a.exTokenNumber > b.exTokenNumber) {\r
                     return 1;\r
                 if (a.exTokenNumber > b.exTokenNumber) {\r
                     return 1;\r
-                } else if (a.exTokenNumber > b.exTokenNumber) {\r
-                    return 1;\r
-                } else {\r
+                } else if (a.exTokenNumber == b.exTokenNumber) {\r
                     return 0;\r
                     return 0;\r
+                } else {\r
+                    return -1;\r
                 }\r
             }\r
             \r
                 }\r
             }\r
             \r
@@ -876,6 +834,12 @@ class ExMapTable {
     }\r
 }\r
 \r
     }\r
 }\r
 \r
+/**\r
+    PcdDatabase   \r
+    \r
+    This class is used to generate C code for Autogen.h and Autogen.c of\r
+    a PCD service DXE driver and PCD service PEIM.\r
+**/\r
 class PcdDatabase {\r
 \r
     private final static int    SkuHeadAlignmentSize             = 4;\r
 class PcdDatabase {\r
 \r
     private final static int    SkuHeadAlignmentSize             = 4;\r
@@ -941,14 +905,21 @@ class PcdDatabase {
     private String hString;\r
     private String cString;\r
 \r
     private String hString;\r
     private String cString;\r
 \r
-\r
-    class AlignmentSizeComp implements Comparator<Token> {\r
-        public int compare (Token a, Token b) {\r
-            return getAlignmentSize(b) \r
-                    - getAlignmentSize(a);\r
-        }\r
-    }\r
-    \r
+    /**\r
+        Constructor for PcdDatabase class. \r
+        \r
+        <p>We have two PCD dynamic(ex) database for the Framework implementation. One\r
+        for PEI phase and the other for DXE phase.  </p>\r
+        \r
+        @param alTokens A ArrayList of Dynamic(EX) PCD entry.\r
+        @param exePhase The phase to generate PCD database for: valid input\r
+                        is "PEI" or "DXE".\r
+        @param startLen The starting Local Token Number for the PCD database. For\r
+                        PEI phase, the starting Local Token Number starts from 0.\r
+                        For DXE phase, the starting Local Token Number starts\r
+                        from the total number of PCD entry of PEI phase.\r
+        @return void\r
+    **/\r
     public PcdDatabase (ArrayList<Token> alTokens, String exePhase, int startLen) {\r
        phase = exePhase;\r
 \r
     public PcdDatabase (ArrayList<Token> alTokens, String exePhase, int startLen) {\r
        phase = exePhase;\r
 \r
@@ -959,6 +930,11 @@ class PcdDatabase {
        sizeTable = new SizeTable(phase);\r
        exMapTable = new ExMapTable(phase); \r
 \r
        sizeTable = new SizeTable(phase);\r
        exMapTable = new ExMapTable(phase); \r
 \r
+       //\r
+       // Local token number 0 is reserved for INVALID_TOKEN_NUMBER.\r
+       // So we will increment 1 for the startLen passed from the \r
+       // constructor.\r
+       //\r
        assignedTokenNumber = startLen + 1;\r
        this.alTokens = alTokens;\r
     }\r
        assignedTokenNumber = startLen + 1;\r
        this.alTokens = alTokens;\r
     }\r
@@ -976,19 +952,6 @@ class PcdDatabase {
         return;\r
     }\r
 \r
         return;\r
     }\r
 \r
-    private void getTwoGroupsOfTokens (ArrayList<Token> alTokens, List<Token> initTokens, List<Token> uninitTokens) {\r
-        for (int i = 0; i < alTokens.size(); i++) {\r
-            Token t = (Token)alTokens.get(i);\r
-            if (t.hasDefaultValue()) {\r
-                initTokens.add(t);\r
-            } else {\r
-                uninitTokens.add(t);\r
-            }\r
-        }\r
-\r
-        return;\r
-    }\r
-\r
     private int getDataTypeAlignmentSize (Token token) {\r
         switch (token.datumType) {\r
         case UINT8:\r
     private int getDataTypeAlignmentSize (Token token) {\r
         switch (token.datumType) {\r
         case UINT8:\r
@@ -1093,7 +1056,7 @@ class PcdDatabase {
 \r
     }\r
 \r
 \r
     }\r
 \r
-    private void ProcessTokensNew (List<Token> tokens, \r
+    private void ProcessTokens (List<Token> tokens, \r
                                    ArrayList<CStructTypeDeclaration> cStructDeclList,\r
                                    HashMap<String, String> cStructInstTable,\r
                                    String phase\r
                                    ArrayList<CStructTypeDeclaration> cStructDeclList,\r
                                    HashMap<String, String> cStructInstTable,\r
                                    String phase\r
@@ -1123,7 +1086,7 @@ class PcdDatabase {
 \r
     }\r
     \r
 \r
     }\r
     \r
-    public void genCodeNew () throws EntityException {\r
+    public void genCode () throws EntityException {\r
         \r
         ArrayList<CStructTypeDeclaration> cStructDeclList = new ArrayList<CStructTypeDeclaration>();\r
         HashMap<String, String> cStructInstTable = new HashMap<String, String>();\r
         \r
         ArrayList<CStructTypeDeclaration> cStructDeclList = new ArrayList<CStructTypeDeclaration>();\r
         HashMap<String, String> cStructInstTable = new HashMap<String, String>();\r
@@ -1141,15 +1104,15 @@ class PcdDatabase {
         // EX type token number starts from the last Non-EX PCD entry and\r
         // grows continously upwards.\r
         //\r
         // EX type token number starts from the last Non-EX PCD entry and\r
         // grows continously upwards.\r
         //\r
-        ProcessTokensNew (nexTokens, cStructDeclList, cStructInstTable, phase);\r
-        ProcessTokensNew (exTokens, cStructDeclList, cStructInstTable, phase);\r
+        ProcessTokens (nexTokens, cStructDeclList, cStructInstTable, phase);\r
+        ProcessTokens (exTokens, cStructDeclList, cStructInstTable, phase);\r
         \r
         \r
-        stringTable.genCodeNew(cStructDeclList, cStructInstTable);\r
-        skuIdTable.genCodeNew(cStructDeclList, cStructInstTable, phase);\r
-        exMapTable.genCodeNew(cStructDeclList, cStructInstTable, phase);\r
-        localTokenNumberTable.genCodeNew(cStructDeclList, cStructInstTable, phase);\r
-        sizeTable.genCodeNew(cStructDeclList, cStructInstTable, phase);\r
-        guidTable.genCodeNew(cStructDeclList, cStructInstTable, phase);\r
+        stringTable.genCode(cStructDeclList, cStructInstTable);\r
+        skuIdTable.genCode(cStructDeclList, cStructInstTable, phase);\r
+        exMapTable.genCode(cStructDeclList, cStructInstTable, phase);\r
+        localTokenNumberTable.genCode(cStructDeclList, cStructInstTable, phase);\r
+        sizeTable.genCode(cStructDeclList, cStructInstTable, phase);\r
+        guidTable.genCode(cStructDeclList, cStructInstTable, phase);\r
         \r
         hString = genCMacroCode ();\r
         \r
         \r
         hString = genCMacroCode ();\r
         \r
@@ -1285,159 +1248,6 @@ class PcdDatabase {
         return result;\r
     }\r
 \r
         return result;\r
     }\r
 \r
-     public void genCode () \r
-        throws EntityException {\r
-\r
-        final String newLine                        = "\r\n";\r
-        final String declNewLine                    = ";\r\n";\r
-        final String tab                            = "\t";\r
-        final String commaNewLine                   = ", \r\n";\r
-\r
-        int i;\r
-        ArrayList<String> decla;\r
-        ArrayList<String> inst;\r
-\r
-        String macroStr   = "";\r
-        String initDeclStr = "";\r
-        String initInstStr = "";\r
-        String uninitDeclStr = "";\r
-\r
-        List<Token> initTokens = new ArrayList<Token> ();\r
-        List<Token> uninitTokens = new ArrayList<Token> ();\r
-        \r
-        HashMap <String, ArrayList<String>> initCode = new HashMap<String, ArrayList<String>> ();\r
-        HashMap <String, ArrayList<String>> uninitCode = new HashMap<String, ArrayList<String>> ();\r
-\r
-        getTwoGroupsOfTokens (alTokens, initTokens, uninitTokens);\r
-\r
-        //\r
-        // Generate Structure Declaration for PcdTokens without Default Value\r
-        // PEI_PCD_DATABASE_INIT\r
-        //\r
-        java.util.Comparator<Token> comparator = new AlignmentSizeComp();\r
-        java.util.Collections.sort(initTokens, comparator);\r
-        initCode = processTokens(initTokens);\r
-\r
-        //\r
-        // Generate Structure Declaration for PcdTokens without Default Value\r
-        // PEI_PCD_DATABASE_UNINIT\r
-        //\r
-        java.util.Collections.sort(uninitTokens, comparator);\r
-        uninitCode = processTokens(uninitTokens);\r
-\r
-        //\r
-        // Generate size info Macro for all Tables\r
-        //\r
-        macroStr += guidTable.getSizeMacro();\r
-        macroStr += stringTable.getSizeMacro();\r
-        macroStr += skuIdTable.getSizeMacro();\r
-        macroStr += localTokenNumberTable.getSizeMacro();\r
-        macroStr += exMapTable.getSizeMacro();\r
-\r
-        //\r
-        // Generate existance info Macro for all Tables\r
-        //\r
-        macroStr += guidTable.getExistanceMacro();\r
-        macroStr += stringTable.getExistanceMacro();\r
-        macroStr += skuIdTable.getExistanceMacro();\r
-        macroStr += localTokenNumberTable.getExistanceMacro();\r
-        macroStr += exMapTable.getExistanceMacro();\r
-\r
-        //\r
-        // Generate Structure Declaration for PcdTokens with Default Value\r
-        // for example PEI_PCD_DATABASE_INIT\r
-        //\r
-        initDeclStr += "typedef struct {" + newLine;\r
-            {\r
-                initDeclStr += tab + exMapTable.getTypeDeclaration();\r
-                initDeclStr += tab + guidTable.getTypeDeclaration();\r
-                initDeclStr += tab + localTokenNumberTable.getTypeDeclaration();\r
-                initDeclStr += tab + stringTable.getTypeDeclaration();\r
-                initDeclStr += tab + sizeTable.getTypeDeclaration();\r
-                initDeclStr += tab + skuIdTable.getTypeDeclaration();\r
-                if (phase.equalsIgnoreCase("PEI")) {\r
-                    initDeclStr += tab + "SKU_ID            SystemSkuId;" + newLine;\r
-                }\r
-\r
-                decla = initCode.get(new String("Declaration"));\r
-                for (i = 0; i < decla.size(); i++)  {\r
-                    initDeclStr += tab + decla.get(i) + declNewLine;\r
-                }\r
-\r
-                //\r
-                // Generate Structure Declaration for PcdToken with SkuEnabled\r
-                //\r
-                decla = initCode.get("DeclarationForSku");\r
-\r
-                for (i = 0; i < decla.size(); i++) {\r
-                    initDeclStr += tab + decla.get(i) + declNewLine;\r
-                }\r
-            }\r
-        initDeclStr += String.format("} %s_PCD_DATABASE_INIT;\r\n\r\n", phase);\r
-\r
-        //\r
-        // Generate MACRO for structure intialization of PCDTokens with Default Value\r
-        // The sequence must match the sequence of declaration of the memembers in the structure\r
-        String tmp = String.format("%s_PCD_DATABASE_INIT g%sPcdDbInit = { ", phase.toUpperCase(), phase.toUpperCase());\r
-        initInstStr +=  tmp + newLine;\r
-        initInstStr += tab + genInstantiationStr(exMapTable.getInstantiation()) + commaNewLine;\r
-        initInstStr += tab + genInstantiationStr(guidTable.getInstantiation()) + commaNewLine;\r
-        initInstStr += tab + genInstantiationStr(localTokenNumberTable.getInstantiation()) + commaNewLine; \r
-        initInstStr += tab + genInstantiationStr(stringTable.getInstantiation()) + commaNewLine;\r
-        initInstStr += tab + genInstantiationStr(sizeTable.getInstantiation()) + commaNewLine;\r
-        initInstStr += tab + genInstantiationStr(skuIdTable.getInstantiation()) + commaNewLine;\r
-        //\r
-        // For SystemSkuId\r
-        //\r
-        if (phase.equalsIgnoreCase("PEI")) {\r
-            initInstStr += tab + "0" + tab + "/* SystemSkuId */" + commaNewLine;\r
-        }\r
-\r
-        inst = initCode.get("Instantiation");\r
-        for (i = 0; i < inst.size(); i++) {\r
-            initInstStr += tab + inst.get(i) + commaNewLine;\r
-        }\r
-\r
-        inst = initCode.get("InstantiationForSku");\r
-        for (i = 0; i < inst.size(); i++) {\r
-            initInstStr += tab + inst.get(i);\r
-            if (i != inst.size() - 1) {\r
-                initInstStr += commaNewLine;\r
-            }\r
-        }\r
-\r
-        initInstStr += "};";\r
-\r
-        uninitDeclStr += "typedef struct {" + newLine;\r
-            {\r
-                decla = uninitCode.get("Declaration");\r
-                if (decla.size() == 0) {\r
-                    uninitDeclStr += "UINT8 dummy /* The UINT struct is empty */" + declNewLine;\r
-                } else {\r
-    \r
-                    for (i = 0; i < decla.size(); i++) {\r
-                        uninitDeclStr += tab + decla.get(i) + declNewLine;\r
-                    }\r
-    \r
-                    decla = uninitCode.get("DeclarationForSku");\r
-    \r
-                    for (i = 0; i < decla.size(); i++) {\r
-                        uninitDeclStr += tab + decla.get(i) + declNewLine;\r
-                    }\r
-                }\r
-            }\r
-        uninitDeclStr += String.format("} %s_PCD_DATABASE_UNINIT;\r\n\r\n", phase);\r
-\r
-        cString = initInstStr + newLine;\r
-        hString = macroStr      + newLine  \r
-              + initDeclStr   + newLine\r
-              + uninitDeclStr + newLine\r
-              + newLine;\r
-        \r
-        hString += String.format("#define PCD_%s_SERVICE_DRIVER_VERSION                        %d", phase, version);\r
-\r
-    }\r
-\r
     public static String genInstantiationStr (ArrayList<String> alStr) {\r
         String str = "";\r
         for (int i = 0; i< alStr.size(); i++) {\r
     public static String genInstantiationStr (ArrayList<String> alStr) {\r
         String str = "";\r
         for (int i = 0; i< alStr.size(); i++) {\r
@@ -1453,70 +1263,6 @@ class PcdDatabase {
         return str;\r
     }\r
 \r
         return str;\r
     }\r
 \r
-    private HashMap<String, ArrayList<String>> processTokens (List<Token> alToken) \r
-        throws EntityException {\r
-\r
-        HashMap <String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>();\r
-\r
-        ArrayList<String> decl = new ArrayList<String>();\r
-        ArrayList<String> declForSkuEnableType = new ArrayList<String>();\r
-        ArrayList<String> inst = new ArrayList<String>();\r
-        ArrayList<String> instForSkuEnableType = new ArrayList<String>();\r
-\r
-        for (int index = 0; index < alToken.size(); index++) {\r
-            Token token = alToken.get(index);\r
-\r
-            if (token.isSkuEnable()) {\r
-                //\r
-                // BugBug: Schema only support Data type now\r
-                //\r
-                int tableIdx;\r
-\r
-                tableIdx = skuIdTable.add(token);\r
-\r
-                decl.add(getSkuEnabledTypeDeclaration(token));\r
-                if (token.hasDefaultValue()) {\r
-                    inst.add(getSkuEnabledTypeInstantiaion(token, tableIdx)); \r
-                }\r
-\r
-                declForSkuEnableType.add(getDataTypeDeclarationForSkuEnabled(token));\r
-                if (token.hasDefaultValue()) {\r
-                    instForSkuEnableType.add(getDataTypeInstantiationForSkuEnabled(token));\r
-                }\r
-\r
-            } else {\r
-                if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.HII_TYPE) {\r
-                    decl.add(getVariableEnableTypeDeclaration(token));\r
-                    inst.add(getVariableEnableInstantiation(token));\r
-                } else if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.VPD_TYPE) {\r
-                    decl.add(getVpdEnableTypeDeclaration(token));\r
-                    inst.add(getVpdEnableTypeInstantiation(token));\r
-                } else if (token.isUnicodeStringType()) {\r
-                    decl.add(getStringTypeDeclaration(token));\r
-                    inst.add(getStringTypeInstantiation(stringTable.add(token.getStringTypeString(), token), token));\r
-                }\r
-                else {\r
-                    decl.add(getDataTypeDeclaration(token));\r
-                    if (token.hasDefaultValue()) {\r
-                        inst.add(getDataTypeInstantiation(token));\r
-                    }\r
-                }\r
-            }\r
-\r
-            sizeTable.add(token);\r
-            localTokenNumberTable.add(token);\r
-            token.tokenNumber = assignedTokenNumber++;\r
-\r
-        }\r
-\r
-        map.put("Declaration",  decl);\r
-        map.put("DeclarationForSku", declForSkuEnableType);\r
-        map.put("Instantiation", inst);\r
-        map.put("InstantiationForSku", instForSkuEnableType);\r
-\r
-        return map;\r
-    }\r
-\r
     private String getSkuEnabledTypeDeclaration (Token token) {\r
         return String.format("%-20s%s;\r\n", "SKU_HEAD", token.getPrimaryKeyString());\r
     }\r
     private String getSkuEnabledTypeDeclaration (Token token) {\r
         return String.format("%-20s%s;\r\n", "SKU_HEAD", token.getPrimaryKeyString());\r
     }\r
@@ -1527,60 +1273,10 @@ class PcdDatabase {
         return String.format("{ %s, %d } /* SKU_ENABLED: %s */", offsetof, SkuTableIdx, token.getPrimaryKeyString());\r
     }\r
 \r
         return String.format("{ %s, %d } /* SKU_ENABLED: %s */", offsetof, SkuTableIdx, token.getPrimaryKeyString());\r
     }\r
 \r
-    private String getDataTypeDeclarationForSkuEnabled (Token token) {\r
-        String typeStr = "";\r
-\r
-        if (token.datumType == Token.DATUM_TYPE.UINT8) {\r
-            typeStr = "UINT8 %s_%s[%d];\r\n";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT16) {\r
-            typeStr = "UINT16 %s_%s[%d];\r\n";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT32) {\r
-            typeStr = "UINT32 %s_%s[%d];\r\n";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT64) {\r
-            typeStr = "UINT64 %s_%s[%d];\r\n";\r
-        } else if (token.datumType == Token.DATUM_TYPE.BOOLEAN) {\r
-            typeStr = "BOOLEAN %s_%s[%d];\r\n";\r
-        } else if (token.datumType == Token.DATUM_TYPE.POINTER) {\r
-            return String.format("UINT8 %s_%s[%d];\r\n", token.getPrimaryKeyString(), "SkuDataTable", token.datumSize * token.skuData.size());\r
-        } \r
-\r
-        return String.format(typeStr, token.getPrimaryKeyString(), "SkuDataTable", token.skuData.size());\r
-\r
-    }\r
-\r
-    private String getDataTypeInstantiationForSkuEnabled (Token token) {\r
-        String str = "";\r
-\r
-        if (token.datumType == Token.DATUM_TYPE.POINTER) {\r
-            return String.format("UINT8 %s_%s[%d]", token.getPrimaryKeyString(), "SkuDataTable", token.datumSize * token.skuData.size());\r
-        } else {\r
-            str = "{ ";\r
-            for (int idx = 0; idx < token.skuData.size(); idx++) {\r
-                str += token.skuData.get(idx).toString();\r
-                if (idx != token.skuData.size() - 1) {\r
-                    str += ", ";\r
-                }\r
-            }\r
-            str += "}";\r
-\r
-            return str;\r
-        }\r
-\r
-    }\r
-\r
-    private String getDataTypeInstantiationForVariableDefault_new (Token token, String cName, int skuId) {\r
+    private String getDataTypeInstantiationForVariableDefault (Token token, String cName, int skuId) {\r
         return String.format("%s /* %s */", token.skuData.get(skuId).value.hiiDefaultValue, cName);\r
     }\r
 \r
         return String.format("%s /* %s */", token.skuData.get(skuId).value.hiiDefaultValue, cName);\r
     }\r
 \r
-    private String getDataTypeInstantiation (Token token) {\r
-\r
-        if (token.datumType == Token.DATUM_TYPE.POINTER) {\r
-            return String.format("%s /* %s */", token.getDefaultSku().value, token.getPrimaryKeyString());\r
-        } else {\r
-            return String.format("%s /* %s */", token.getDefaultSku().value, token.getPrimaryKeyString());\r
-        }\r
-    }\r
-\r
     private String getCType (Token t) \r
         throws EntityException {\r
         \r
     private String getCType (Token t) \r
         throws EntityException {\r
         \r
@@ -1640,7 +1336,7 @@ class PcdDatabase {
         }\r
     }\r
     \r
         }\r
     }\r
     \r
-    private String getDataTypeDeclarationForVariableDefault_new (Token token, String cName, int skuId) \r
+    private String getDataTypeDeclarationForVariableDefault (Token token, String cName, int skuId) \r
     throws EntityException {\r
 \r
         String typeStr;\r
     throws EntityException {\r
 \r
         String typeStr;\r
@@ -1682,32 +1378,6 @@ class PcdDatabase {
         return String.format("%-20s%s;\r\n", typeStr, cName);\r
     }\r
     \r
         return String.format("%-20s%s;\r\n", typeStr, cName);\r
     }\r
     \r
-    private String getDataTypeDeclaration (Token token) {\r
-\r
-        String typeStr = "";\r
-\r
-        if (token.datumType == Token.DATUM_TYPE.UINT8) {\r
-            typeStr = "UINT8";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT16) {\r
-            typeStr = "UINT16";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT32) {\r
-            typeStr = "UINT32";\r
-        } else if (token.datumType == Token.DATUM_TYPE.UINT64) {\r
-            typeStr = "UINT64";\r
-        } else if (token.datumType == Token.DATUM_TYPE.BOOLEAN) {\r
-            typeStr = "BOOLEAN";\r
-        } else if (token.datumType == Token.DATUM_TYPE.POINTER) {\r
-            return String.format("UINT8 %s[%d]", token.getPrimaryKeyString(), token.datumSize);\r
-        } else {\r
-        }\r
-\r
-        return String.format("%s    %s", typeStr, token.getPrimaryKeyString());\r
-    }\r
-\r
-    private String getVpdEnableTypeDeclaration (Token token) {\r
-        return String.format("VPD_HEAD %s", token.getPrimaryKeyString());\r
-    }\r
-    \r
     private String getTypeInstantiation (Token t, ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) throws EntityException {\r
       \r
         int     i;\r
     private String getTypeInstantiation (Token t, ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) throws EntityException {\r
       \r
         int     i;\r
@@ -1741,11 +1411,11 @@ class PcdDatabase {
                 //\r
                 CStructTypeDeclaration decl = new CStructTypeDeclaration (variableDefaultName,\r
                                                         getHiiPtrTypeAlignmentSize(t),\r
                 //\r
                 CStructTypeDeclaration decl = new CStructTypeDeclaration (variableDefaultName,\r
                                                         getHiiPtrTypeAlignmentSize(t),\r
-                                                        getDataTypeDeclarationForVariableDefault_new(t, variableDefaultName, i),\r
+                                                        getDataTypeDeclarationForVariableDefault(t, variableDefaultName, i),\r
                                                         true\r
                                                         ); \r
                 declaList.add(decl);\r
                                                         true\r
                                                         ); \r
                 declaList.add(decl);\r
-                instTable.put(variableDefaultName, getDataTypeInstantiationForVariableDefault_new (t, variableDefaultName, i));\r
+                instTable.put(variableDefaultName, getDataTypeInstantiationForVariableDefault (t, variableDefaultName, i));\r
             } else if (t.isVpdEnable()) {\r
                     /* typedef  struct {\r
                         UINT32  Offset;\r
             } else if (t.isVpdEnable()) {\r
                     /* typedef  struct {\r
                         UINT32  Offset;\r
@@ -1776,40 +1446,6 @@ class PcdDatabase {
         return s;\r
     }\r
     \r
         return s;\r
     }\r
     \r
-    private String getVpdEnableTypeInstantiation (Token token) {\r
-        return String.format("{ %s } /* %s */", token.getDefaultSku().vpdOffset,\r
-                                                token.getPrimaryKeyString());\r
-    }\r
-\r
-    private String getStringTypeDeclaration (Token token) {\r
-        return String.format("UINT16  %s", token.getPrimaryKeyString());\r
-    }\r
-\r
-    private String getStringTypeInstantiation (int StringTableIdx, Token token) {\r
-        return String.format ("%d /* %s */", StringTableIdx,\r
-                                             token.getPrimaryKeyString()); \r
-    }\r
-\r
-\r
-    private String getVariableEnableTypeDeclaration (Token token) {\r
-      return String.format("VARIABLE_HEAD  %s", token.getPrimaryKeyString());\r
-    }\r
-\r
-    private String getVariableEnableInstantiation (Token token) \r
-        throws EntityException {\r
-        //\r
-        // Need scott fix\r
-        // \r
-        return String.format("{ %d, %d, %s } /* %s */", guidTable.add(token.getDefaultSku().variableGuid, token.getPrimaryKeyString()),\r
-                                                        stringTable.add(token.getDefaultSku().getStringOfVariableName(), token),\r
-                                                        token.getDefaultSku().variableOffset, \r
-                                                        token.getPrimaryKeyString());\r
-    }\r
-\r
-    public int getTotalTokenNumber () {\r
-        return sizeTable.getTableLen();\r
-    }\r
-\r
     public static String getPcdDatabaseCommonDefinitions () \r
         throws EntityException {\r
 \r
     public static String getPcdDatabaseCommonDefinitions () \r
         throws EntityException {\r
 \r
@@ -2034,7 +1670,7 @@ public class CollectPCDAction {
 \r
         dbManager.getTwoPhaseDynamicRecordArray(alPei, alDxe);\r
         PcdDatabase pcdPeiDatabase = new PcdDatabase (alPei, "PEI", 0);\r
 \r
         dbManager.getTwoPhaseDynamicRecordArray(alPei, alDxe);\r
         PcdDatabase pcdPeiDatabase = new PcdDatabase (alPei, "PEI", 0);\r
-        pcdPeiDatabase.genCodeNew();\r
+        pcdPeiDatabase.genCode();\r
         MemoryDatabaseManager.PcdPeimHString        = PcdCommonHeaderString + pcdPeiDatabase.getHString()\r
                                             + PcdDatabase.getPcdPeiDatabaseDefinitions();\r
         MemoryDatabaseManager.PcdPeimCString        = pcdPeiDatabase.getCString();\r
         MemoryDatabaseManager.PcdPeimHString        = PcdCommonHeaderString + pcdPeiDatabase.getHString()\r
                                             + PcdDatabase.getPcdPeiDatabaseDefinitions();\r
         MemoryDatabaseManager.PcdPeimCString        = pcdPeiDatabase.getCString();\r
@@ -2043,7 +1679,7 @@ public class CollectPCDAction {
                                                       "DXE",\r
                                                       alPei.size()\r
                                                       );\r
                                                       "DXE",\r
                                                       alPei.size()\r
                                                       );\r
-        pcdDxeDatabase.genCodeNew();\r
+        pcdDxeDatabase.genCode();\r
         MemoryDatabaseManager.PcdDxeHString   = MemoryDatabaseManager.PcdPeimHString + pcdDxeDatabase.getHString()\r
                                       + PcdDatabase.getPcdDxeDatabaseDefinitions();\r
         MemoryDatabaseManager.PcdDxeCString   = pcdDxeDatabase.getCString();\r
         MemoryDatabaseManager.PcdDxeHString   = MemoryDatabaseManager.PcdPeimHString + pcdDxeDatabase.getHString()\r
                                       + PcdDatabase.getPcdDxeDatabaseDefinitions();\r
         MemoryDatabaseManager.PcdDxeCString   = pcdDxeDatabase.getCString();\r
@@ -2106,8 +1742,6 @@ public class CollectPCDAction {
         List<PcdBuildDefinition.PcdData>    pcdBuildDataArray = new ArrayList<PcdBuildDefinition.PcdData>();\r
         PcdBuildDefinition.PcdData          pcdBuildData      = null;\r
         Token                               token             = null;\r
         List<PcdBuildDefinition.PcdData>    pcdBuildDataArray = new ArrayList<PcdBuildDefinition.PcdData>();\r
         PcdBuildDefinition.PcdData          pcdBuildData      = null;\r
         Token                               token             = null;\r
-        SkuInstance                         skuInstance       = null;\r
-        int                                 skuIndex          = 0;\r
         List<ModuleInfo>                    modules           = null;\r
         String                              primaryKey        = null;\r
         String                              exceptionString   = null;\r
         List<ModuleInfo>                    modules           = null;\r
         String                              primaryKey        = null;\r
         String                              exceptionString   = null;\r