PCD tools update:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 4 Jun 2006 10:00:41 +0000 (10:00 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 4 Jun 2006 10:00:41 +0000 (10:00 +0000)
1) CollectPCDAction will get all PCD information from FPD file but *not* search SPD and MSA file.
2) ALL PcdBuildDeclaration in FPD file has been moved from common <PcdBuildDeclaration> to seperated module's <PcdBuildDeclaration>. Common <PcdBuildDeclaration> was removed from FPD file.
3) The platform information for Dyanmic and DynamicEx type PCD should be record into <PcdDynamicBuildDeclaration> now.

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

15 files changed:
EdkModulePkg/EdkModulePkg-All-Archs.fpd
EdkModulePkg/EdkModulePkg.fpd
EdkNt32Pkg/Nt32.fpd
MdePkg/MdePkg-All-Archs.fpd
MdePkg/MdePkg.fpd
Tools/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
Tools/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
Tools/Source/GenBuild/org/tianocore/build/pcd/action/ShowPCDDatabaseAction.java
Tools/Source/GenBuild/org/tianocore/build/pcd/entity/MemoryDatabaseManager.java
Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java
Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
Tools/Source/GenBuild/org/tianocore/build/pcd/exception/EntityException.java
Tools/Source/GenBuild/org/tianocore/build/pcd/ui/PCDDatabaseFrame.java

index 4dcf324..dd4b712 100644 (file)
       </ModuleSA>      \r
 \r
       <!-- IPF -->\r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="HelloWorld" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="HelloWorld" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="Partition" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="Partition" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>\r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="English" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="English" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DiskIo" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DiskIo" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DiskIoPartition" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DiskIoPartition" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="SecurityStub" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="SecurityStub" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DxeMain" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DxeMain" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiMain" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiMain" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DxeIpl" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DxeIpl" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="GraphicsConsole" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="GraphicsConsole" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="Runtime" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="Runtime" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>        \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="MonotonicCounter" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="MonotonicCounter" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>        \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="Variable" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="Variable" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>        \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="EmuVariable" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="EmuVariable" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="StatusCode" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="StatusCode" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiBaseMemoryTestInit" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiBaseMemoryTestInit" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PcdPeim" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PcdPeim" >\r
         <PcdBuildDeclarations>\r
             <PcdBuildData ItemType="FIXED_AT_BUILD">\r
               <C_Name>PcdMaxPeiPcdCallBackNumberPerPcdEntry</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="PeiVariable" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="PeiVariable" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="WatchDogTimer" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="WatchDogTimer" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="FtwLite" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="FtwLite" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
           </PcdBuildData>           \r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DebugPort" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DebugPort" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
         </PcdBuildDeclarations>\r
       </ModuleSA>      \r
       <!--\r
-      <ModuleSA Arch="X64" FvBinding="NULL" ModuleName="DebugSupport" >\r
+      <ModuleSA Arch="IPF" FvBinding="NULL" ModuleName="DebugSupport" >\r
         <PcdBuildDeclarations>\r
           <PcdBuildData ItemType="FIXED_AT_BUILD">\r
             <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
       </ModuleSA>      \r
     </OTHER_COMPONENTS>\r
   </FrameworkModules>\r
-  <PcdBuildDeclarations>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>            \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0f</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x07</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>            \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-  </PcdBuildDeclarations>\r
   <BuildOptions>\r
     <OutputDirectory IntermediateDirectories="UNIFIED"/>\r
   </BuildOptions>\r
index b95aa39..02f7e35 100644 (file)
       </ModuleSA>      \r
     </OTHER_COMPONENTS>\r
   </FrameworkModules>\r
-  <PcdBuildDeclarations>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-            <TokenSpaceGuid>f1a9de0d-f005-45c4-bdb5-5ec0fb468316</TokenSpaceGuid>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <TokenSpaceGuid>f1a9de0d-f005-45c4-bdb5-5ec0fb468316</TokenSpaceGuid>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <TokenSpaceGuid>f1a9de0d-f005-45c4-bdb5-5ec0fb468316</TokenSpaceGuid>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <TokenSpaceGuid>f1a9de0d-f005-45c4-bdb5-5ec0fb468316</TokenSpaceGuid>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <TokenSpaceGuid>866baf87-e00c-4dc6-9733-1e23af2115ee</TokenSpaceGuid>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>            \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0f</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>      \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x07</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>            \r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>      \r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaxPeiPcdCallBackNumberPerPcdEntry</C_Name>\r
-      <Token>0x0001000f</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <DefaultValue>0x08</DefaultValue>\r
-    </PcdBuildData>           \r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-     <C_Name>PcdVpdBaseAddress</C_Name>\r
-        <Token>0x00010010</Token>\r
-        <DatumType>UINT32</DatumType>\r
-        <HiiEnable>false</HiiEnable>\r
-        <VpdEnable>false</VpdEnable>\r
-        <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-        <SkuEnable>false</SkuEnable>\r
-        <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-        <MaxSku>0</MaxSku>\r
-        <SkuId>0</SkuId>\r
-        <DatumSize>4</DatumSize>\r
-        <VariableGuid>0</VariableGuid>\r
-        <VariableName>L""</VariableName>\r
-        <DataOffset>0</DataOffset>\r
-        <DefaultValue>0x10000000</DefaultValue>\r
-    </PcdBuildData>           \r
-  </PcdBuildDeclarations>\r
   <BuildOptions>\r
     <OutputDirectory IntermediateDirectories="UNIFIED"/>\r
   </BuildOptions>\r
index e0bd613..0f944c4 100644 (file)
       </ModuleSA>\r
     </DXE_DRIVERS>\r
   </FrameworkModules>\r
-  <PcdBuildDeclarations>\r
-    <!-- <Filename>PcdInfo.xml</Filename> -->\r
-    <!--   you can also specify individual elements here, not just a file name. -->\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x1f</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x07</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtPhysicalDisk</C_Name>\r
-      <Token>0x00001000</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>24</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"FW;40960;512"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtVirtualDisk</C_Name>\r
-      <Token>0x00001001</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>24</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"FW;40960;512"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtSerialPort</C_Name>\r
-      <Token>0x00001002</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>20</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"COM1!COM2"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtUga</C_Name>\r
-      <Token>0x00001003</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>50</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"UGA Window 1!UGA Window 2"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtFileSystem</C_Name>\r
-      <Token>0x00001004</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>120</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L".!C:\\D\\work\\Remodel\\mdk\\EdkShellBinPkg\\bin\\ia32\\Apps"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtMemorySize</C_Name>\r
-      <Token>0x00001005</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>10</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"64!64"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdWinNtMemorySizeForSecMain</C_Name>\r
-      <Token>0x00001005</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>10</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"64!64"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdWinNtBootMode</C_Name>\r
-      <Token>0x00001006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtCpuModel</C_Name>\r
-      <Token>0x00001007</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>48</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"Intel(R) Processor Model"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtCpuSpeed</C_Name>\r
-      <Token>0x00001008</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>8</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"3000"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdWinNtFirmwareVolume</C_Name>\r
-      <Token>0x00001009</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>44</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"..\\..\\Fv\\Fv_Recovery.fd"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtConsole</C_Name>\r
-      <Token>0x0000100a</Token>\r
-      <DatumType>VOID*</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>50</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>L"Bus Driver Console Window"</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdRothmanTest</C_Name>\r
-      <Token>0x0000100b</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>true</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0B3ADA4F-AE56-4c24-8DEA-F03B7558AE50</VariableGuid>\r
-      <VariableName>RothmanVariable</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdWinNtBinaryPatch1</C_Name>\r
-      <Token>0x0001000b</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x1234</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdWinNtBinaryPatch2</C_Name>\r
-      <Token>0x0001000c</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x5678</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FEATURE_FLAG">\r
-      <C_Name>PcdWinNtFeatureFlag1</C_Name>\r
-      <Token>0x0001000d</Token>\r
-      <DatumType>BOOLEAN</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x1</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdWinNtDynamicUINT32</C_Name>\r
-      <Token>0x0001000e</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaxPeiPcdCallBackNumberPerPcdEntry</C_Name>\r
-      <Token>0x0001000f</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x8</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdVpdBaseAddress</C_Name>\r
-      <Token>0x00010010</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdTestDynamicUint8</C_Name>\r
-      <Token>0x00011000</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x1</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdTestDynamicUint16</C_Name>\r
-      <Token>0x00011001</Token>\r
-      <DatumType>UINT16</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>2</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x1234</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdTestDynamicUint32</C_Name>\r
-      <Token>0x00011002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>NoDefault</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdTestDynamicUint64</C_Name>\r
-      <Token>0x00011003</Token>\r
-      <DatumType>UINT64</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>8</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>NoDefault</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="DYNAMIC">\r
-      <C_Name>PcdTestDynamicBoolean</C_Name>\r
-      <Token>0x00011004</Token>\r
-      <DatumType>BOOLEAN</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0x00</MaxSku>\r
-      <SkuId>0x00</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>NoDefault</DefaultValue>\r
-    </PcdBuildData>\r
-  </PcdBuildDeclarations>\r
   <PcdDynamicBuildDeclarations>\r
     <PcdBuildData ItemType="DYNAMIC">\r
       <C_Name>PcdWinNtMemorySize</C_Name>\r
index 2be9874..392c239 100644 (file)
       \r
     </OTHER_COMPONENTS>  \r
   </FrameworkModules>\r
-  <PcdBuildDeclarations>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPciExpressBaseAddress</C_Name>\r
-      <Token>0x0000000A</Token>\r
-      <DatumType>UINT64</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xE0000000</DefaultValue>\r
-    </PcdBuildData>\r
-  </PcdBuildDeclarations>\r
   <BuildOptions>\r
     <OutputDirectory IntermediateDirectories="UNIFIED"/>\r
   </BuildOptions>\r
index d19cd89..e514d44 100644 (file)
       </ModuleSA>        \r
     </OTHER_COMPONENTS>  \r
   </FrameworkModules>\r
-  <PcdBuildDeclarations>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>1</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0x0</DefaultValue>\r
-    </PcdBuildData>\r
-    <PcdBuildData ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPciExpressBaseAddress</C_Name>\r
-      <Token>0x0000000A</Token>\r
-      <DatumType>UINT64</DatumType>\r
-      <HiiEnable>false</HiiEnable>\r
-      <VpdEnable>false</VpdEnable>\r
-      <AlternateNameSpaceEnable>false</AlternateNameSpaceEnable>\r
-      <SkuEnable>false</SkuEnable>\r
-      <SkuDataArrayEnable>false</SkuDataArrayEnable>\r
-      <MaxSku>0</MaxSku>\r
-      <SkuId>0</SkuId>\r
-      <DatumSize>4</DatumSize>\r
-      <VariableGuid>0</VariableGuid>\r
-      <VariableName>L""</VariableName>\r
-      <DataOffset>0</DataOffset>\r
-      <GuidOffset>0</GuidOffset>\r
-      <DefaultValue>0xE0000000</DefaultValue>\r
-    </PcdBuildData>\r
-  </PcdBuildDeclarations>\r
   <BuildOptions>\r
     <OutputDirectory IntermediateDirectories="UNIFIED"/>\r
   </BuildOptions>\r
index f1e9c5b..62bb4c6 100644 (file)
@@ -408,8 +408,14 @@ public class AutoGen {
         // isPCDEmulatedDriver parameter will be removed.\r
         //\r
         try {\r
-            this.myPcdAutogen = new PCDAutoGenAction(baseName, \r
-                                                     baseName.equalsIgnoreCase("PcdEmulatorPeim"));\r
+            this.myPcdAutogen = new PCDAutoGenAction(baseName,\r
+                                                     null,\r
+                                                     null,\r
+                                                     null,\r
+                                                     this.arch,\r
+                                                     null,\r
+                                                     baseName.equalsIgnoreCase("PcdEmulatorPeim"),\r
+                                                     false);\r
             this.myPcdAutogen.execute();\r
         } catch (Exception e) {\r
             throw new BuildException("PCD Autogen failed:" + e.getMessage());\r
@@ -543,8 +549,14 @@ public class AutoGen {
         // isPCDEmulatedDriver parameter will be removed.\r
         //\r
         try {\r
-            this.myPcdAutogen = new PCDAutoGenAction(baseName, baseName\r
-                    .equalsIgnoreCase("PcdEmulatorPeim"));\r
+            this.myPcdAutogen = new PCDAutoGenAction(baseName, \r
+                                                     null,\r
+                                                     null,\r
+                                                     null,\r
+                                                     this.arch,\r
+                                                     null,\r
+                                                     baseName.equalsIgnoreCase("PcdEmulatorPeim"), \r
+                                                     true);\r
             this.myPcdAutogen.execute();\r
         } catch (Exception e) {\r
             throw new BuildException(e.getMessage());\r
index 1de29ea..1e3de2a 100644 (file)
@@ -785,12 +785,6 @@ public class FpdParserTask extends Task {
     public void collectPCDInformation() {\r
       CollectPCDAction collectAction = new CollectPCDAction ();\r
       //\r
-      // Set memory database log file path. It should be put into same directory with FPD file. \r
-      //\r
-      GlobalData.getPCDMemoryDBManager().setLogFileName(\r
-                   fpdFilename.getPath() + ".PCDMemroyDatabaseLog.txt"\r
-                   );\r
-      //\r
       // Collect all PCD information from FPD to MSA, and get help information from SPD.\r
       // These all information will be stored into memory database for future usage such \r
       // as autogen.\r
@@ -802,7 +796,7 @@ public class FpdParserTask extends Task {
           ActionMessage.MAX_MESSAGE_LEVEL\r
           );\r
       } catch (Exception exp) {\r
-        throw new BuildException (exp.getMessage());\r
+        throw new BuildException (String.format("Fail to do PCD preprocess from FPD file,  the cause is %s", exp.getMessage()));\r
       }\r
     }\r
 }\r
index 1eb060b..4001558 100644 (file)
@@ -31,11 +31,16 @@ import java.util.UUID;
 \r
 import org.apache.xmlbeans.XmlException;\r
 import org.apache.xmlbeans.XmlObject;\r
+import org.tianocore.FrameworkModulesDocument;\r
 import org.tianocore.FrameworkPlatformDescriptionDocument;\r
+import org.tianocore.FrameworkPlatformDescriptionDocument.FrameworkPlatformDescription;\r
 import org.tianocore.ModuleSADocument;\r
+import org.tianocore.ModuleSADocument.ModuleSA;\r
 import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.PcdBuildDeclarationsDocument.PcdBuildDeclarations.PcdBuildData;\r
+import org.tianocore.PcdBuildDeclarationsDocument.PcdBuildDeclarations.PcdBuildData.SkuData;\r
 import org.tianocore.PcdDefinitionsDocument.PcdDefinitions;\r
+import org.tianocore.PcdDynamicBuildDeclarationsDocument.PcdDynamicBuildDeclarations;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.global.GlobalData;\r
 import org.tianocore.build.global.SurfaceAreaQuery;\r
@@ -706,7 +711,7 @@ class PcdDatabase {
 \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 = alTokens.get(i);\r
+            Token t = (Token)alTokens.get(i);\r
             if (t.hasDefaultValue()) {\r
                 initTokens.add(t);\r
             } else {\r
@@ -970,7 +975,7 @@ class PcdDatabase {
 \r
             sizeTable.add(token);\r
             localTokenNumberTable.add(token);\r
-            token.assignedtokenNumber = assignedTokenNumber++;\r
+            token.tokenNumber = assignedTokenNumber++;\r
 \r
         }\r
 \r
@@ -1109,7 +1114,6 @@ class PcdDatabase {
                                  "Conf" + File.separator +\r
                                  "Pcd" + File.separator +\r
                                  "PcdDatabaseCommonDefinitions.sample");\r
-            System.out.println(GlobalData.getWorkspacePath());\r
             FileReader reader = new FileReader(file);\r
             BufferedReader  in = new BufferedReader(reader);\r
             String str;\r
@@ -1171,6 +1175,16 @@ class PcdDatabase {
 \r
 }\r
 \r
+class ModuleInfo {\r
+    public ModuleSADocument.ModuleSA module;\r
+    public UsageInstance.MODULE_TYPE type;\r
+\r
+    public ModuleInfo (ModuleSADocument.ModuleSA module, UsageInstance.MODULE_TYPE type) {\r
+        this.module = module;\r
+        this.type   = type;\r
+    }\r
+}\r
+\r
 /** This action class is to collect PCD information from MSA, SPD, FPD xml file.\r
     This class will be used for wizard and build tools, So it can *not* inherit\r
     from buildAction or UIAction.\r
@@ -1188,6 +1202,9 @@ public class CollectPCDAction {
     /// Message level for CollectPCDAction.\r
     private int                   originalMessageLevel;\r
 \r
+    /// Cache the fpd docment instance for private usage.\r
+    private FrameworkPlatformDescriptionDocument fpdDocInstance;\r
+\r
     /**\r
       Set WorkspacePath parameter for this action class.\r
 \r
@@ -1243,103 +1260,34 @@ public class CollectPCDAction {
       Core execution function for this action class.\r
      \r
       This function work flows will be:\r
-      1) Get all token's platform information from FPD, and create token object into memory database.\r
-      2) Get all token's module information from MSA, and create usage instance for every module's PCD entry.\r
-      3) Get all token's inherited information from MSA's library, and create usage instance \r
-         for module who consume this library and create usage instance for library for building.\r
-      4) Collect token's package information from SPD, update these information for token in memory\r
-         database.\r
-      5) Generate 3 strings for a) All modules using Dynamic(Ex) PCD entry. (Token Number)\r
-                                b) PEI PCD Database (C Structure) for PCD Service PEIM\r
-                                c) DXE PCD Database (C structure) for PCD Service DXE\r
+      1) Collect and prepocess PCD information from FPD file, all PCD\r
+      information will be stored into memory database.\r
+      2) Generate 3 strings for\r
+        a) All modules using Dynamic(Ex) PCD entry.(Token Number)\r
+        b) PEI PCDDatabase (C Structure) for PCD Service PEIM.\r
+        c) DXE PCD Database (C structure) for PCD Service DXE.\r
                                 \r
       \r
       @throws  EntityException Exception indicate failed to execute this action.\r
       \r
     **/\r
     private void execute() throws EntityException {\r
-        FrameworkPlatformDescriptionDocument fpdDoc               = null;\r
-        Object[][]                           modulePCDArray       = null;\r
-        Map<String, XmlObject>               docMap               = null;\r
-        ModuleSADocument.ModuleSA[]          moduleSAs            = null;\r
-        UsageInstance                        usageInstance        = null;\r
-        String                               packageName          = null;\r
-        String                               packageFullPath      = null;\r
-        int                                  index                = 0;\r
-        int                                  libraryIndex         = 0;\r
-        int                                  pcdArrayIndex        = 0;\r
-        List<String>                         listLibraryInstance  = null;\r
-        String                               componentTypeStr     = null;\r
+        //\r
+        // Get memoryDatabaseManager instance from GlobalData.\r
+        // The memoryDatabaseManager should be initialized for whatever build\r
+        // tools or wizard tools\r
+        //\r
+        if((dbManager = GlobalData.getPCDMemoryDBManager()) == null) {\r
+            throw new EntityException("The instance of PCD memory database manager is null");\r
+        }\r
 \r
         //\r
         // Collect all PCD information defined in FPD file.\r
         // Evenry token defind in FPD will be created as an token into \r
         // memory database.\r
         //\r
-        fpdDoc = createTokenInDBFromFPD();\r
-\r
-        //\r
-        // Searching MSA and SPD document. \r
-        // The information of MSA will be used to create usage instance into database.\r
-        // The information of SPD will be used to update the token information in database.\r
-        //\r
-\r
-        HashMap<String, XmlObject> map = new HashMap<String, XmlObject>();\r
-        map.put("FrameworkPlatformDescription", fpdDoc);\r
-        SurfaceAreaQuery.setDoc(map);    \r
-\r
-        moduleSAs = SurfaceAreaQuery.getFpdModules();\r
-        for(index = 0; index < moduleSAs.length; index ++) {\r
-            //\r
-            // Get module document and use SurfaceAreaQuery to get PCD information\r
-            //\r
-            docMap = GlobalData.getDoc(moduleSAs[index].getModuleName());\r
-            SurfaceAreaQuery.setDoc(docMap);\r
-            modulePCDArray    = SurfaceAreaQuery.getModulePCDTokenArray();\r
-            componentTypeStr  = SurfaceAreaQuery.getComponentType();\r
-            packageName       = \r
-                GlobalData.getPackageNameForModule(moduleSAs[index].getModuleName());\r
-            packageFullPath   = this.workspacePath + File.separator    +\r
-                                GlobalData.getPackagePath(packageName) +\r
-                                packageName + ".spd";\r
-\r
-            if(modulePCDArray != null) {\r
-                //\r
-                // If current MSA contains <PCDs> information, then create usage\r
-                // instance for PCD information from MSA\r
-                //\r
-                for(pcdArrayIndex = 0; pcdArrayIndex < modulePCDArray.length; \r
-                     pcdArrayIndex ++) {\r
-                    usageInstance = \r
-                        createUsageInstanceFromMSA(moduleSAs[index].getModuleName(),\r
-                                                   modulePCDArray[pcdArrayIndex]);\r
-\r
-                    if(usageInstance == null) {\r
-                        continue;\r
-                    }\r
-                    //\r
-                    // Get remaining PCD information from the package which this module belongs to\r
-                    //\r
-                    updateTokenBySPD(usageInstance, packageFullPath);\r
-                }\r
-            }\r
+        createTokenInDBFromFPD();\r
 \r
-            //\r
-            // Get inherit PCD information which inherit from library instance of this module.\r
-            //\r
-            listLibraryInstance = \r
-                SurfaceAreaQuery.getLibraryInstance(moduleSAs[index].getArch().toString(),\r
-                                                    CommonDefinition.AlwaysConsumed);\r
-            if(listLibraryInstance != null) {\r
-                for(libraryIndex = 0; libraryIndex < listLibraryInstance.size(); \r
-                     libraryIndex ++) {\r
-                    inheritPCDFromLibraryInstance(listLibraryInstance.get(libraryIndex),\r
-                                                  moduleSAs[index].getModuleName(),\r
-                                                  packageName,\r
-                                                  componentTypeStr);\r
-                }\r
-            }\r
-        }\r
         \r
         //\r
         // Call Private function genPcdDatabaseSourceCode (void); ComponentTypeBsDriver\r
@@ -1356,9 +1304,8 @@ public class CollectPCDAction {
       @throws EntityException  If the token does *not* exist in memory database.\r
 \r
     **/\r
-\r
-    private void genPcdDatabaseSourceCode     ()\r
-      throws EntityException {\r
+    private void genPcdDatabaseSourceCode()\r
+        throws EntityException {\r
         String PcdCommonHeaderString = PcdDatabase.getPcdDatabaseCommonDefinitions ();\r
 \r
         ArrayList<Token> alPei = new ArrayList<Token> ();\r
@@ -1382,424 +1329,488 @@ public class CollectPCDAction {
     }\r
 \r
     /**\r
-      This function will collect inherit PCD information from library for a module.\r
-     \r
-      This function will create two usage instance for inherited PCD token, one is \r
-      for module and another is for library.\r
-      For module, if it inherited a PCD token from library, this PCD token's value \r
-      should be instanced in module level, and belongs to module.\r
-      For library, it also need a usage instance for build.\r
+      Get component array from FPD.\r
       \r
-      @param libraryName         The name of library instance.\r
-      @param moduleName          The name of module.\r
-      @param packageName         The name of package while module belongs to.\r
-      @param parentcomponentType The component type of module.\r
+      This function maybe provided by some Global class.\r
       \r
-      @throws EntityException  If the token does *not* exist in memory database.\r
+      @return List<ModuleInfo> the component array.\r
       \r
-    **/\r
-    private void inheritPCDFromLibraryInstance(String libraryName,\r
-                                               String moduleName,\r
-                                               String packageName,\r
-                                               String parentcomponentType) \r
+     */\r
+    private List<ModuleInfo> getComponentsFromFPD() \r
         throws EntityException {\r
-        Map<String, XmlObject>  docMap            = null;\r
-        String                  primaryKeyString  = null;\r
-        Object[][]              libPcdDataArray   = null;\r
-        UUID                    nullUUID          = new UUID(0,0);\r
-        UUID                    platformUUID      = nullUUID;\r
-        UUID                    tokenSpaceGuid    = null;\r
-        int                     tokenIndex        = 0;\r
-        Token                   token             = null;\r
-        Token.PCD_TYPE          pcdType           = Token.PCD_TYPE.UNKNOWN;\r
-        UsageInstance           usageInstance     = null;\r
-        String                  packageFullPath   = null;\r
+        HashMap<String, XmlObject>  map         = new HashMap<String, XmlObject>();\r
+        List<ModuleInfo>            allModules  = new ArrayList<ModuleInfo>();\r
+        ModuleInfo                  current     = null;\r
+        int                         index       = 0;\r
+        org.tianocore.Components    components  = null;\r
+        FrameworkModulesDocument.FrameworkModules fModules = null;\r
+        java.util.List<ModuleSADocument.ModuleSA> modules  = null;\r
+        \r
 \r
-        //\r
-        // Query PCD information from library's document.\r
-        //\r
-        docMap          = GlobalData.getDoc(libraryName);\r
-        SurfaceAreaQuery.setDoc(docMap);\r
-        libPcdDataArray = SurfaceAreaQuery.getModulePCDTokenArray();\r
+        if (fpdDocInstance == null) {\r
+            try {\r
+                fpdDocInstance = (FrameworkPlatformDescriptionDocument)XmlObject.Factory.parse(new File(fpdFilePath));\r
+            } catch(IOException ioE) {\r
+                throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());\r
+            } catch(XmlException xmlE) {\r
+                throw new EntityException("Can't parse the FPD xml fle:" + fpdFilePath + "\n" + xmlE.getMessage());\r
+            }\r
 \r
-        if(libPcdDataArray == null) {\r
-            return;\r
         }\r
 \r
-        for(tokenIndex = 0; tokenIndex < libPcdDataArray.length; tokenIndex ++) {\r
-            tokenSpaceGuid =((UUID)libPcdDataArray[tokenIndex][2] == null) ? \r
-                             nullUUID :(UUID)libPcdDataArray[tokenIndex][2];\r
-\r
-            //\r
-            // Get token from memory database. The token must be created from FPD already.\r
-            //\r
-            primaryKeyString = Token.getPrimaryKeyString((String)libPcdDataArray[tokenIndex][0],\r
-                                                         tokenSpaceGuid,\r
-                                                         platformUUID\r
-                                                         );\r
-\r
-            if(dbManager.isTokenInDatabase(primaryKeyString)) {\r
-                token = dbManager.getTokenByKey(primaryKeyString);\r
-            } else {\r
-                throw new EntityException("The PCD token " + primaryKeyString + \r
-                                          " defined in module " + moduleName + \r
-                                          " does not exist in FPD file!");\r
-            }      \r
-\r
-            //\r
-            // Create usage instance for module.\r
-            //\r
-            pcdType = Token.getpcdTypeFromString((String)libPcdDataArray[tokenIndex][1]);\r
-            usageInstance = new UsageInstance(token,\r
-                                              Token.PCD_USAGE.ALWAYS_CONSUMED,\r
-                                              pcdType,\r
-                                              CommonDefinition.getComponentType(parentcomponentType),\r
-                                              libPcdDataArray[tokenIndex][3],\r
-                                              null,\r
-                                             (String) libPcdDataArray[tokenIndex][5],\r
-                                              "",\r
-                                              moduleName,\r
-                                              packageName,\r
-                                              true);\r
-            if(Token.PCD_USAGE.UNKNOWN == token.isUsageInstanceExist(moduleName)) {\r
-                token.addUsageInstance(usageInstance);\r
+        //\r
+        // Check whether FPD contians <FramworkModules>\r
+        // \r
+        fModules = fpdDocInstance.getFrameworkPlatformDescription().getFrameworkModules();\r
+        if (fModules == null) {\r
+            return null;\r
+        }\r
 \r
-                packageFullPath = this.workspacePath + File.separator    +\r
-                                  GlobalData.getPackagePath(packageName) +\r
-                                  packageName + ".spd";\r
-                updateTokenBySPD(usageInstance, packageFullPath);\r
+        //\r
+        // BUGBUG: The following is work around code, the final component type should be get from\r
+        // GlobalData class.\r
+        // \r
+        components = fModules.getSEC();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.SEC));\r
             }\r
+        }\r
 \r
-            //\r
-            // We need create second usage instance for inherited case, which\r
-            // add library as an usage instance, because when build a module, and \r
-            // if module inherited from base library, then build process will build\r
-            // library at first. \r
-            //\r
-            if(Token.PCD_USAGE.UNKNOWN == token.isUsageInstanceExist(libraryName)) {\r
-                packageName   = GlobalData.getPackageNameForModule(libraryName);\r
-                usageInstance = new UsageInstance(token,\r
-                                                  Token.PCD_USAGE.ALWAYS_CONSUMED,\r
-                                                  pcdType,\r
-                                                  CommonDefinition.ComponentTypeLibrary,\r
-                                                  libPcdDataArray[tokenIndex][3],\r
-                                                  null,\r
-                                                 (String)libPcdDataArray[tokenIndex][5],\r
-                                                  "",\r
-                                                  libraryName,\r
-                                                  packageName,\r
-                                                  false);\r
-                token.addUsageInstance(usageInstance);\r
+        components = fModules.getPEICORE();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.PEI_CORE));\r
             }\r
         }\r
-    }\r
 \r
-    /**\r
-      Create usage instance for PCD token defined in MSA document\r
-\r
-      A PCD token maybe used by many modules, and every module is one of usage\r
-      instance of this token. For ALWAY_CONSUMED, SOMETIMES_CONSUMED, it is \r
-      consumer type usage instance of this token, and for ALWAYS_PRODUCED, \r
-      SOMETIMES_PRODUCED, it is produce type usage instance.\r
-     \r
-      @param moduleName      The name of module \r
-      @param tokenInfoInMsa  The PCD token information array retrieved from MSA.\r
-      \r
-      @return UsageInstance  The usage instance created in memroy database.\r
-      \r
-      @throws EntityException  If token did not exist in database yet.\r
-      \r
-    **/\r
-    private UsageInstance createUsageInstanceFromMSA(String   moduleName,\r
-                                                     Object[] tokenInfoInMsa) \r
-        throws EntityException {\r
-        String          packageName         = null;\r
-        UsageInstance   usageInstance       = null;\r
-        UUID            tokenSpaceGuid      = null;\r
-        UUID            nullUUID            = new UUID(0,0);\r
-        String          primaryKeyString    = null;\r
-        UUID            platformTokenSpace  = nullUUID;\r
-        Token           token               = null;\r
-        Token.PCD_TYPE  pcdType             = Token.PCD_TYPE.UNKNOWN;\r
-        Token.PCD_USAGE pcdUsage            = Token.PCD_USAGE.UNKNOWN;\r
-\r
-        tokenSpaceGuid =((UUID)tokenInfoInMsa[2] == null) ? nullUUID :(UUID)tokenInfoInMsa[2];\r
-\r
-        primaryKeyString = Token.getPrimaryKeyString((String)tokenInfoInMsa[0],\r
-                                                     tokenSpaceGuid,\r
-                                                     platformTokenSpace);\r
-\r
-        //\r
-        // Get token object from memory database firstly.\r
-        //\r
-        if(dbManager.isTokenInDatabase(primaryKeyString)) {\r
-            token = dbManager.getTokenByKey(primaryKeyString);\r
-        } else {\r
-            throw new EntityException("The PCD token " + primaryKeyString + " defined in module " + \r
-                                      moduleName + " does not exist in FPD file!" );\r
+        components = fModules.getPEIM();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.PEIM));\r
+            }\r
         }\r
-        pcdType     = Token.getpcdTypeFromString((String)tokenInfoInMsa[1]);\r
-        pcdUsage    = Token.getUsageFromString((String)tokenInfoInMsa[4]);\r
-\r
-        packageName = GlobalData.getPackageNameForModule(moduleName);\r
 \r
-        if(Token.PCD_USAGE.UNKNOWN != token.isUsageInstanceExist(moduleName)) {\r
-            //\r
-            // BUGBUG: It is legal that same base name exist in one FPD file. In furture\r
-            //         we should use "Guid, Version, Package" and "Arch" to differ a module.\r
-            //         So currently, warning should be disabled.\r
-            //\r
-            //ActionMessage.warning(this,\r
-            //                      "In module " + moduleName + " exist more than one PCD token " + token.cName\r
-            //                      );\r
-            return null;\r
+        components = fModules.getDXECORE();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.DXE_CORE));\r
+            }\r
         }\r
 \r
-        //\r
-        // BUGBUG: following code could be enabled at current schema. Because \r
-        //         current schema does not provide usage information.\r
-        // \r
-        // For FEATRURE_FLAG, FIXED_AT_BUILD, PATCH_IN_MODULE type PCD token, his \r
-        // usage is always ALWAYS_CONSUMED\r
-        //\r
-        //if((pcdType != Token.PCD_TYPE.DYNAMIC) &&\r
-        //   (pcdType != Token.PCD_TYPE.DYNAMIC_EX)) {\r
-        pcdUsage = Token.PCD_USAGE.ALWAYS_CONSUMED;\r
-        //}\r
-\r
-        usageInstance = new UsageInstance(token,\r
-                                          pcdUsage,\r
-                                          pcdType,\r
-                                          CommonDefinition.getComponentType(SurfaceAreaQuery.getComponentType()),\r
-                                          tokenInfoInMsa[3],\r
-                                          null,\r
-                                         (String) tokenInfoInMsa[5],\r
-                                          "",\r
-                                          moduleName,\r
-                                          packageName,\r
-                                          false);\r
-\r
-        //\r
-        // Use default value defined in MSA to update datum of token,\r
-        // if datum of token does not defined in FPD file.\r
-        //\r
-        if((token.datum == null) &&(tokenInfoInMsa[3] != null)) {\r
-            token.datum = tokenInfoInMsa[3];\r
+        components = fModules.getDXEDRIVERS();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.DXE_DRIVERS));\r
+            }\r
         }\r
 \r
-        token.addUsageInstance(usageInstance);\r
-\r
-        return usageInstance;\r
+        components = fModules.getOTHERCOMPONENTS();\r
+        if (components != null) {\r
+            modules = components.getModuleSAList();\r
+            for (index = 0; index < modules.size(); index ++) {\r
+                allModules.add(new ModuleInfo(modules.get(index), UsageInstance.MODULE_TYPE.OTHER_COMPONENTS));\r
+            }\r
+        }\r
+        \r
+        return allModules;\r
     }\r
 \r
     /**\r
       Create token instance object into memory database, the token information\r
       comes for FPD file. Normally, FPD file will contain all token platform \r
       informations.\r
-     \r
-      This fucntion should be executed at firsly before others collection work\r
-      such as searching token information from MSA, SPD.\r
       \r
       @return FrameworkPlatformDescriptionDocument   The FPD document instance for furture usage.\r
       \r
       @throws EntityException                        Failed to parse FPD xml file.\r
       \r
     **/\r
-    private FrameworkPlatformDescriptionDocument createTokenInDBFromFPD() \r
+    private void createTokenInDBFromFPD() \r
         throws EntityException {\r
-        XmlObject                            doc               = null;\r
-        FrameworkPlatformDescriptionDocument fpdDoc            = null;\r
-        int                                  index             = 0;\r
-        List<PcdBuildData>                   pcdBuildDataArray = new ArrayList<PcdBuildData>();\r
-        PcdBuildData                         pcdBuildData      = null;\r
-        Token                                token             = null;\r
-        UUID                                 nullUUID          = new UUID(0,0);\r
-        UUID                                 platformTokenSpace= nullUUID;\r
-        List                                 skuDataArray      = new ArrayList();\r
-        SkuInstance                          skuInstance       = null;\r
-        int                                  skuIndex          = 0;\r
+        int                                 index             = 0;\r
+        int                                 index2            = 0;\r
+        int                                 pcdIndex          = 0;\r
+        List<PcdBuildData>                  pcdBuildDataArray = new ArrayList<PcdBuildData>();\r
+        PcdBuildData                        pcdBuildData      = null;\r
+        Token                               token             = null;\r
+        UUID                                nullUUID          = new UUID(0,0);\r
+        UUID                                platformTokenSpace= nullUUID;\r
+        SkuInstance                         skuInstance       = null;\r
+        int                                 skuIndex          = 0;\r
+        List<ModuleInfo>                    modules           = null;\r
+        String                              primaryKey        = null;\r
+        PcdBuildData.SkuData[]              skuDataArray      = null;\r
+        String                              exceptionString   = null;\r
+        UsageInstance                       usageInstance     = null;\r
+        String                              primaryKey1       = null;\r
+        String                              primaryKey2       = null;\r
+        boolean                             isDuplicate       = false;\r
+        java.util.List<java.lang.String>    tokenGuidStringArray = null;\r
 \r
         //\r
-        // Get all tokens from FPD file and create token into database.\r
+        // Get all <ModuleSA> from FPD file.\r
         // \r
+        modules = getComponentsFromFPD();\r
 \r
-        try {\r
-            doc = XmlObject.Factory.parse(new File(fpdFilePath));\r
-        } catch(IOException ioE) {\r
-            throw new EntityException("Can't find the FPD xml fle:" + fpdFilePath);\r
-        } catch(XmlException xmlE) {\r
-            throw new EntityException("Can't parse the FPD xml fle:" + fpdFilePath);\r
+        if (modules == null) {\r
+            throw new EntityException("No modules in FPD file, Please check whether there are elements in <FrameworkModules> in FPD file!");\r
         }\r
 \r
         //\r
-        // Get memoryDatabaseManager instance from GlobalData.\r
-        //\r
-        if((dbManager = GlobalData.getPCDMemoryDBManager()) == null) {\r
-            throw new EntityException("The instance of PCD memory database manager is null");\r
-        }\r
-\r
-        dbManager = new MemoryDatabaseManager();\r
+        // Loop all modules to process <PcdBuildDeclarations> for each module.\r
+        // \r
+        for (index = 0; index < modules.size(); index ++) {\r
+            isDuplicate =  false;\r
+            for (index2 = 0; index2 < index; index2 ++) {\r
+                //\r
+                // BUGBUG: For transition schema, we can *not* get module's version from \r
+                // <ModuleSAs>, It is work around code.\r
+                // \r
+                primaryKey1 = UsageInstance.getPrimaryKey(modules.get(index).module.getModuleName(), \r
+                                                          translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),\r
+                                                          modules.get(index).module.getPackageName(), \r
+                                                          translateSchemaStringToUUID(modules.get(index).module.getPackageGuid()), \r
+                                                          modules.get(index).module.getArch().toString(),\r
+                                                          null);\r
+                primaryKey2 = UsageInstance.getPrimaryKey(modules.get(index2).module.getModuleName(), \r
+                                                          translateSchemaStringToUUID(modules.get(index2).module.getModuleGuid()), \r
+                                                          modules.get(index2).module.getPackageName(), \r
+                                                          translateSchemaStringToUUID(modules.get(index2).module.getPackageGuid()), \r
+                                                          modules.get(index2).module.getArch().toString(), \r
+                                                          null);\r
+                if (primaryKey1.equalsIgnoreCase(primaryKey2)) {\r
+                    isDuplicate = true;\r
+                    break;\r
+                }\r
+            }\r
 \r
-        if(!(doc instanceof FrameworkPlatformDescriptionDocument)) {\r
-            throw new EntityException("File " + fpdFilePath + \r
-                                       " is not a FrameworkPlatformDescriptionDocument");\r
-        }\r
+            if (isDuplicate) {\r
+                continue;\r
+            }\r
 \r
-        fpdDoc =(FrameworkPlatformDescriptionDocument)doc;\r
+            if (modules.get(index).module.getPcdBuildDeclarations() == null) {\r
+                continue;\r
+            }\r
+            pcdBuildDataArray = modules.get(index).module.getPcdBuildDeclarations().getPcdBuildDataList();\r
+            if (pcdBuildDataArray == null) {\r
+                continue;\r
+            }\r
+            if (pcdBuildDataArray.size() == 0) {\r
+                continue;\r
+            }\r
 \r
-        //\r
-        // Add all tokens in FPD into Memory Database.\r
-        //\r
-        pcdBuildDataArray = \r
-            fpdDoc.getFrameworkPlatformDescription().getPcdBuildDeclarations().getPcdBuildDataList();\r
-        for(index = 0; \r
-             index < fpdDoc.getFrameworkPlatformDescription().getPcdBuildDeclarations().sizeOfPcdBuildDataArray(); \r
-             index ++) {\r
-            pcdBuildData = pcdBuildDataArray.get(index);\r
-            token        = new Token(pcdBuildData.getCName(), new UUID(0, 0), new UUID(0, 0));\r
-            //\r
-            // BUGBUG: in FPD, <defaultValue> should be defined as <Value>\r
             //\r
-            token.datum        = pcdBuildData.getDefaultValue();\r
-            token.tokenNumber  = Integer.decode(pcdBuildData.getToken().getStringValue());\r
-            token.hiiEnabled   = pcdBuildData.getHiiEnable();\r
-            token.variableGuid = Token.getGUIDFromSchemaObject(pcdBuildData.getVariableGuid());\r
-            token.variableName = pcdBuildData.getVariableName();\r
-            token.variableOffset = Integer.decode(pcdBuildData.getDataOffset());\r
-            token.skuEnabled   = pcdBuildData.getSkuEnable();\r
-            token.maxSkuCount  = Integer.decode(pcdBuildData.getMaxSku());\r
-            token.skuId        = Integer.decode(pcdBuildData.getSkuId());\r
-            token.skuDataArrayEnabled  = pcdBuildData.getSkuDataArrayEnable();\r
-            token.assignedtokenNumber  = Integer.decode(pcdBuildData.getToken().getStringValue());\r
-            skuDataArray               = pcdBuildData.getSkuDataArray1();\r
-            token.datumType    = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());\r
-            token.datumSize    = pcdBuildData.getDatumSize();\r
-\r
-            if(skuDataArray != null) {\r
-                for(skuIndex = 0; skuIndex < skuDataArray.size(); skuIndex ++) {\r
+            // Loop all Pcd entry for a module and add it into memory database.\r
+            // \r
+            for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex ++) {\r
+                pcdBuildData = pcdBuildDataArray.get(pcdIndex);\r
+                primaryKey   = Token.getPrimaryKeyString(pcdBuildData.getCName(),\r
+                                                         translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));\r
+\r
+\r
+                if (dbManager.isTokenInDatabase(primaryKey)) {\r
+                    //\r
+                    // If the token is already exist in database, do some necessary checking\r
+                    // and add a usage instance into this token in database\r
+                    // \r
+                    token = dbManager.getTokenByKey(primaryKey);\r
+\r
                     //\r
-                    // BUGBUG: Now in current schema, The value is defined as String type, \r
-                    // it is not correct, the type should be same as the datumType\r
+                    // Checking for DatumSize\r
+                    // \r
+                    if (token.datumSize != pcdBuildData.getDatumSize()) {\r
+                        exceptionString = String.format("The datum size of PCD entry %s is %d, which is different with %d defined in before!",\r
+                                                        pcdBuildData.getCName(),  pcdBuildData.getDatumSize(), token.datumSize);\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
+\r
                     //\r
-                    skuInstance = new SkuInstance(((PcdBuildData.SkuData)skuDataArray.get(skuIndex)).getId(),\r
-                                                  ((PcdBuildData.SkuData)skuDataArray.get(skuIndex)).getValue());\r
-                    token.skuData.add(skuInstance);\r
+                    // checking for DatumType\r
+                    // \r
+                    if (token.datumType != Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString())) {\r
+                        exceptionString = String.format("The datum type of PCD entry %s is %s, which is different with  %s defined in before!",\r
+                                                        pcdBuildData.getCName(), \r
+                                                        pcdBuildData.getDatumType().toString(), \r
+                                                        Token.getStringOfdatumType(token.datumType));\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
+                } else {\r
+                    //\r
+                    // If the token is not in database, create a new token instance and add\r
+                    // a usage instance into this token in database.\r
+                    // \r
+                    token = new Token(pcdBuildData.getCName(), \r
+                                      translateSchemaStringToUUID(pcdBuildData.getTokenSpaceGuid()));\r
+\r
+                    token.datum         = pcdBuildData.getDefaultValue();\r
+                    token.pcdType       = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());\r
+                    token.datumType     = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());\r
+                    token.datumSize     = pcdBuildData.getDatumSize();\r
+                    token.skuId         = Integer.decode(pcdBuildData.getSkuId());\r
+\r
+                    if (pcdBuildData.getToken() == null) {\r
+                        exceptionString = String.format("In FPD file, No <TokenNumber> defined for PCD entry %s in module %s",\r
+                                                        token.cName,\r
+                                                        modules.get(index).module.getModuleName());\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
+                    token.tokenNumber = Integer.decode(pcdBuildData.getToken().getStringValue());\r
+\r
+                    if ((token.pcdType == Token.PCD_TYPE.DYNAMIC) ||\r
+                        (token.pcdType == Token.PCD_TYPE.DYNAMIC_EX)) {\r
+                        updateDynamicInformation(modules.get(index).module.getModuleName(),  token);\r
+                    }\r
+\r
+                    dbManager.addTokenToDatabase(primaryKey, token);\r
                 }\r
-            }\r
 \r
-            if(dbManager.isTokenInDatabase(Token.getPrimaryKeyString(token.cName, \r
-                                                                      token.tokenSpaceName, \r
-                                                                      platformTokenSpace))) {\r
-                //\r
-                // If found duplicate token, Should tool be hold?\r
                 //\r
-                ActionMessage.warning(this, \r
-                                       "Token " + token.cName + " exists in token database");\r
-                continue;\r
+                // Create an usage instance for this token\r
+                // \r
+                usageInstance = new UsageInstance(token, \r
+                                                  Token.getpcdTypeFromString(pcdBuildData.getItemType().toString()),\r
+                                                  modules.get(index).module.getModuleName(), \r
+                                                  translateSchemaStringToUUID(modules.get(index).module.getModuleGuid()),\r
+                                                  modules.get(index).module.getPackageName(),\r
+                                                  translateSchemaStringToUUID(modules.get(index).module.getPackageGuid()),\r
+                                                  modules.get(index).type, \r
+                                                  Token.getpcdTypeFromString(pcdBuildData.getItemType().toString()),\r
+                                                  modules.get(index).module.getArch().toString(), \r
+                                                  null,\r
+                                                  pcdBuildData.getDefaultValue());\r
+                token.addUsageInstance(usageInstance);\r
             }\r
-            token.pcdType = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());\r
-            dbManager.addTokenToDatabase(Token.getPrimaryKeyString(token.cName, \r
-                                                                   token.tokenSpaceName, \r
-                                                                   platformTokenSpace), \r
-                                         token);\r
         }\r
-\r
-        return fpdDoc;\r
     }\r
 \r
     /**\r
-      Update PCD token in memory database by help information in SPD.\r
-\r
-      After create token from FPD and create usage instance from MSA, we should collect\r
-      PCD package level information from SPD and update token information in memory \r
-      database.\r
-      \r
-      @param usageInstance   The usage instance defined in MSA and want to search in SPD.\r
-      @param packageFullPath The SPD file path.\r
-      \r
-      @throws EntityException Failed to parse SPD xml file.\r
-      \r
+       Update dynamic information for PCD entry.\r
+       \r
+       Dynamic information is retrieved from <PcdDynamicBuildDeclarations> in\r
+       FPD file.\r
+       \r
+       @param moduleName\r
+       @param token\r
+       \r
+       @return Token\r
     **/\r
-    private void updateTokenBySPD(UsageInstance  usageInstance,\r
-                                  String         packageFullPath) \r
+    private Token updateDynamicInformation(String moduleName, Token token) \r
         throws EntityException {\r
-        PackageSurfaceAreaDocument      pkgDoc          = null;\r
-        PcdDefinitions                  pcdDefinitions  = null;\r
-        List<PcdDefinitions.PcdEntry>   pcdEntryArray   = new ArrayList<PcdDefinitions.PcdEntry>();\r
-        int                             index           = 0;\r
-        boolean                         isFoundInSpd    = false;\r
-        Token.DATUM_TYPE                datumType       = Token.DATUM_TYPE.UNKNOWN;\r
+        PcdDynamicBuildDeclarations                pcdDynamicBuildDescriptions = null;\r
+        \r
+        boolean                                    isFound                     = false;            \r
+        int                                        index                       = 0;\r
+        String                                     primaryKey                  = null;\r
+        SkuInstance                                skuInstance                 = null;\r
+        int                                        skuIndex                    = 0;\r
+        String                                     exceptionString             = null;\r
+        PcdDynamicBuildDeclarations.PcdBuildData.SkuData[] skuDataArray             = null;\r
+        List<PcdDynamicBuildDeclarations.PcdBuildData>     pcdDynamicBuildDataArray = null;\r
 \r
-        try {\r
-            pkgDoc =(PackageSurfaceAreaDocument)XmlObject.Factory.parse(new File(packageFullPath));\r
-        } catch(IOException ioE) {\r
-            throw new EntityException("Can't find the FPD xml fle:" + packageFullPath);\r
-        } catch(XmlException xmlE) {\r
-            throw new EntityException("Can't parse the FPD xml fle:" + packageFullPath);\r
-        }\r
-        pcdDefinitions = pkgDoc.getPackageSurfaceArea().getPcdDefinitions();\r
-        //\r
-        // It is illege for SPD file does not contains any PCD information.\r
         //\r
-        if (pcdDefinitions == null) {\r
-            return;\r
+        // If FPD document is not be opened, open and initialize it.\r
+        // \r
+        if (fpdDocInstance == null) {\r
+            try {\r
+                fpdDocInstance = (FrameworkPlatformDescriptionDocument)XmlObject.Factory.parse(new File(fpdFilePath));\r
+            } catch(IOException ioE) {\r
+                throw new EntityException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());\r
+            } catch(XmlException xmlE) {\r
+                throw new EntityException("Can't parse the FPD xml fle:" + fpdFilePath + "\n" + xmlE.getMessage());\r
+            }\r
         }\r
 \r
-        pcdEntryArray = pcdDefinitions.getPcdEntryList();\r
-        if (pcdEntryArray == null) {\r
-            return;\r
+        pcdDynamicBuildDescriptions = fpdDocInstance.getFrameworkPlatformDescription().getPcdDynamicBuildDeclarations();\r
+        if (pcdDynamicBuildDescriptions == null) {\r
+            throw new EntityException(String.format("There are no <PcdDynamicBuildDescriptions> in FPD file but contains Dynamic type "+\r
+                                                    "PCD entry %s in module %s!",\r
+                                                    token.cName,\r
+                                                    moduleName));\r
         }\r
-        for(index = 0; index < pcdEntryArray.size(); index ++) {\r
-            if(pcdEntryArray.get(index).getCName().equalsIgnoreCase(\r
-                usageInstance.parentToken.cName)) {\r
-                isFoundInSpd = true;\r
-                //\r
-                // From SPD file , we can get following information.\r
-                //  Token:        Token number defined in package level.\r
-                //  PcdItemType:  This item does not single one. It means all supported item type.\r
-                //  datumType:    UINT8, UNIT16, UNIT32, UINT64, VOID*, BOOLEAN \r
-                //  datumSize:    The size of default value or maxmine size.\r
-                //  defaultValue: This value is defined in package level.\r
-                //  HelpText:     The help text is provided in package level.\r
+\r
+        pcdDynamicBuildDataArray    = pcdDynamicBuildDescriptions.getPcdBuildDataList();\r
+        if (pcdDynamicBuildDataArray == null) {\r
+            throw new EntityException(String.format("There are no PcdDynamicBuildData in <PcdDynamicBuildDeclaration> section but contains Dynamic type"+\r
+                                                    "PCD entry %s in module %s.!",\r
+                                                    token.cName,\r
+                                                    moduleName));\r
+        }\r
+\r
+        isFound = false;\r
+        for (index = 0; index < pcdDynamicBuildDataArray.size(); index ++) {\r
+            if (pcdDynamicBuildDataArray.get(index).getTokenSpaceGuidList().size() != 0) {\r
+                primaryKey = Token.getPrimaryKeyString(pcdDynamicBuildDataArray.get(index).getCName(), \r
+                                                       translateSchemaStringToUUID(pcdDynamicBuildDataArray.get(index).getTokenSpaceGuidList().get(0)));\r
+            } else {\r
+                primaryKey = Token.getPrimaryKeyString(pcdDynamicBuildDataArray.get(index).getCName(), \r
+                                                       translateSchemaStringToUUID(null));\r
+            }\r
+\r
+            if (primaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {\r
+                isFound = true;\r
+\r
                 //\r
+                // For Hii related value\r
+                // \r
+                token.hiiEnabled    = pcdDynamicBuildDataArray.get(index).getHiiEnable();\r
+                if (token.hiiEnabled) {\r
+                    token.variableGuid      = Token.getGUIDFromSchemaObject(pcdDynamicBuildDataArray.get(index).getVariableGuid());\r
+                    if (token.variableGuid == null) {\r
+                        throw new EntityException(String.format("In <PcdDynamicBuildDeclarations> for PCD entry %s, HiiEnable is true" +\r
+                                                                "but no <VariableGuid> is found! Please fix the FPD file!",\r
+                                                                token.cName));\r
 \r
-                usageInstance.parentToken.tokenNumber = Integer.decode(pcdEntryArray.get(index).getToken());\r
-\r
-                if(pcdEntryArray.get(index).getDatumType() != null) {\r
-                    datumType = Token.getdatumTypeFromString(\r
-                        pcdEntryArray.get(index).getDatumType().toString());\r
-                    if(usageInstance.parentToken.datumType == Token.DATUM_TYPE.UNKNOWN) {\r
-                        usageInstance.parentToken.datumType = datumType;\r
-                    } else {\r
-                        if(datumType != usageInstance.parentToken.datumType) {\r
-                            throw new EntityException("Different datum types are defined for Token :" + \r
-                                                      usageInstance.parentToken.cName);\r
-                        }\r
+                    }\r
+                    token.variableName      = pcdDynamicBuildDataArray.get(index).getVariableName();\r
+                    if (token.variableName == null) {\r
+                        throw new EntityException(String.format("In <PcdDynamicBuildDeclarations> for PCD entry %s, HiiEnable is true" +\r
+                                                                "but no <VariableName> is found! Please fix the FPD file!",\r
+                                                                token.cName));\r
                     }\r
 \r
-                } else {\r
-                    throw new EntityException("The datum type for token " + usageInstance.parentToken.cName + \r
-                                              " is not defind in SPD file " + packageFullPath);\r
+                    if (pcdDynamicBuildDataArray.get(index).getDataOffset() == null) {\r
+                        throw new EntityException(String.format("In <PcdDynamicBuildDeclarations> for PCD entry %s, HiiEnable is true" +\r
+                                                                "but no <DataOffset> is found! Please fix the FPD file!",\r
+                                                                token.cName));\r
+                    }\r
+                    token.variableOffset    = Integer.decode(pcdDynamicBuildDataArray.get(index).getDataOffset());\r
                 }\r
 \r
-                usageInstance.defaultValueInSPD = pcdEntryArray.get(index).getDefaultValue();\r
-                usageInstance.helpTextInSPD     = "Help Text in SPD";\r
-\r
                 //\r
-                // If token's datum is not valid, it indicate that datum is not provided\r
-                // in FPD and defaultValue is not provided in MSA, then use defaultValue\r
-                // in SPD as the datum of token.\r
+                // For Vpd related value\r
+                // \r
+                token.vpdEnabled    = pcdDynamicBuildDataArray.get(index).getVpdEnable();\r
+                if (token.vpdEnabled) {\r
+                    if (pcdDynamicBuildDataArray.get(index).getDataOffset() == null) {\r
+                        throw new EntityException(String.format("In <PcdDynamicBuildDeclarations> for PCD entry %s, VpdEnable is true" +\r
+                                                                "but no <DataOffset> is found! Please fix the FPD file!",\r
+                                                                token.cName));\r
+                    }\r
+                    token.vpdOffset         = Integer.decode(pcdDynamicBuildDataArray.get(index).getDataOffset());\r
+                }\r
+\r
                 //\r
-                if(usageInstance.parentToken.datum == null) {\r
-                    if(pcdEntryArray.get(index).getDefaultValue() != null) {\r
-                        usageInstance.parentToken.datum = pcdEntryArray.get(index).getDefaultValue();\r
-                    } else {\r
-                        throw new EntityException("FPD does not provide datum for token " + usageInstance.parentToken.cName +\r
-                                                  ", MSA and SPD also does not provide <defaultValue> for this token!");\r
+                // For SkuData\r
+                // \r
+                token.skuEnabled    = pcdDynamicBuildDataArray.get(index).getSkuEnable();\r
+                if (token.skuEnabled) {\r
+                    skuDataArray      = (PcdDynamicBuildDeclarations.PcdBuildData.SkuData[])pcdDynamicBuildDataArray.get(index).getSkuDataList().toArray();\r
+                    token.maxSkuCount = Integer.decode(pcdDynamicBuildDataArray.get(index).getMaxSku());\r
+                    if (skuDataArray == null) {\r
+                        exceptionString = String.format("In FPD file, the <SkuEnable> is true for PCD entry %s in module %s, But no any sku data.",\r
+                                                        token.cName, moduleName);\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
+                    if (token.maxSkuCount != pcdDynamicBuildDataArray.get(index).sizeOfSkuDataArray()) {\r
+                        exceptionString = String.format("In FPD file, <MaxSku> is not equal to the size of <SkuDataArray> for PCD entry %s in module %s",\r
+                                                        token.cName, moduleName);\r
+                        throw new EntityException(exceptionString);\r
+                    }\r
+\r
+                    for (skuIndex = 0; skuIndex < pcdDynamicBuildDataArray.get(index).sizeOfSkuDataArray(); skuIndex ++) {\r
+                        skuInstance = new SkuInstance(skuDataArray[skuIndex].getId(),\r
+                                                      skuDataArray[skuIndex].getValue());\r
+                        token.skuData.add(skuInstance);\r
                     }\r
                 }\r
+                break;\r
             }\r
         }\r
+        if (!isFound) {\r
+            exceptionString = String.format("In FPD file, No dynamic PCD data for PCD entry %s in module %s",\r
+                                            token.cName,\r
+                                            moduleName);\r
+            throw new EntityException(exceptionString);\r
+        }\r
+\r
+        return token;\r
+    }\r
+\r
+    /**\r
+       Translate the schema string to UUID instance.\r
+       \r
+       In schema, the string of UUID is defined as following two types string:\r
+        1) GuidArrayType: pattern = 0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},(\r
+        )*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})?\r
+       \r
+        2) GuidNamingConvention: pattern =\r
+        [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\r
+       \r
+       This function will convert string and create uuid instance.\r
+       \r
+       @param uuidString    UUID string in XML file\r
+       \r
+       @return UUID         UUID instance\r
+    **/\r
+    private UUID translateSchemaStringToUUID(String uuidString) \r
+        throws EntityException {\r
+        String      temp;\r
+        String[]    splitStringArray;\r
+        int         index;\r
+        int         chIndex;\r
+        int         chLen;\r
+\r
+        if (uuidString == null) {\r
+            return null;\r
+        }\r
+\r
+        if (uuidString.length() == 0) {\r
+            return null;\r
+        }\r
+\r
+        //\r
+        // If the UUID schema string is GuidArrayType type then need translate \r
+        // to GuidNamingConvention type at first.\r
+        // \r
+        if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) {\r
+            splitStringArray = uuidString.split("," );\r
+            if (splitStringArray.length != 11) {\r
+                throw new EntityException ("Wrong format for UUID string: " + uuidString);\r
+            }\r
+\r
+            //\r
+            // Remove blank space from these string and remove header string "0x"\r
+            // \r
+            for (index = 0; index < 11; index ++) {\r
+                splitStringArray[index] = splitStringArray[index].trim();\r
+                splitStringArray[index] = splitStringArray[index].substring(2, splitStringArray[index].length());\r
+            }\r
+\r
+            //\r
+            // Add heading '0' to normalize the string length\r
+            // \r
+            for (index = 3; index < 11; index ++) {\r
+                chLen = splitStringArray[index].length();\r
+                for (chIndex = 0; chIndex < 2 - chLen; chIndex ++) {\r
+                    splitStringArray[index] = "0" + splitStringArray[index];\r
+                }\r
+            }\r
+\r
+            //\r
+            // construct the final GuidNamingConvention string\r
+            // \r
+            temp = String.format("%s-%s-%s-%s%s-%s%s%s%s%s%s",\r
+                                 splitStringArray[0],\r
+                                 splitStringArray[1],\r
+                                 splitStringArray[2],\r
+                                 splitStringArray[3],\r
+                                 splitStringArray[4],\r
+                                 splitStringArray[5],\r
+                                 splitStringArray[6],\r
+                                 splitStringArray[7],\r
+                                 splitStringArray[8],\r
+                                 splitStringArray[9],\r
+                                 splitStringArray[10]);\r
+            uuidString = temp;\r
+        }\r
+\r
+        return UUID.fromString(uuidString);\r
     }\r
 \r
     /**\r
@@ -1837,11 +1848,11 @@ public class CollectPCDAction {
     **/\r
     public static void main(String argv[]) throws EntityException {\r
         CollectPCDAction ca = new CollectPCDAction();\r
-        ca.setWorkspacePath("G:/mdk");\r
-        ca.setFPDFilePath("G:/mdk/EdkNt32Pkg/build/Nt32.fpd");\r
+        ca.setWorkspacePath("M:/ForPcd/edk2");\r
+        ca.setFPDFilePath("M:/ForPcd/edk2/EdkNt32Pkg/Nt32.fpd");\r
         ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);\r
         GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
-                            "G:/mdk");\r
+                            "M:/ForPcd/edk2");\r
         ca.execute();\r
     }\r
 }\r
index 63698b1..04e585b 100644 (file)
@@ -18,6 +18,7 @@ package org.tianocore.build.pcd.action;
 \r
 import java.io.File;\r
 import java.util.List;\r
+import java.util.UUID;\r
 \r
 import org.tianocore.build.global.GlobalData;\r
 import org.tianocore.build.pcd.entity.MemoryDatabaseManager;\r
@@ -39,11 +40,35 @@ public class PCDAutoGenAction extends BuildAction {
     ///\r
     private String                moduleName;\r
     ///\r
+    /// The Guid of module which is analyzed currently.\r
+    /// \r
+    private UUID                  moduleGuid;\r
+    ///\r
+    /// The name of package whose module is analysized currently.\r
+    /// \r
+    private String                packageName;\r
+    ///\r
+    /// The Guid of package whose module is analyszed curretnly.\r
+    /// \r
+    private UUID                  packageGuid;\r
+    ///\r
+    /// The arch of current module\r
+    /// \r
+    private String                arch;\r
+    ///\r
+    /// The version of current module\r
+    /// \r
+    private String                version;\r
+    ///\r
     /// Wheter current module is PCD emulated driver. It is only for \r
     /// emulated PCD driver and will be kept until PCD IMAGE tool ready.\r
     ///\r
     private boolean               isEmulatedPCDDriver;\r
     ///\r
+    /// Whether current autogen is for building library used by current module.\r
+    /// \r
+    private boolean               isBuildUsedLibrary;\r
+    ///\r
     /// The generated string for header file.\r
     ///\r
     private String                hAutoGenString;\r
@@ -61,6 +86,26 @@ public class PCDAutoGenAction extends BuildAction {
         this.moduleName = moduleName;\r
     }\r
 \r
+    public void setModuleGuid(UUID moduleGuid) {\r
+        this.moduleGuid = moduleGuid;\r
+    }\r
+\r
+    public void setPackageName(String packageName) {\r
+        this.packageName = packageName;\r
+    }\r
+\r
+    public void setPackageGuid(UUID packageGuid) {\r
+        this.packageGuid = packageGuid;\r
+    }\r
+\r
+    public void setArch(String arch) {\r
+        this.arch = arch;\r
+    }\r
+\r
+    public void setVersion(String version) {\r
+        this.version = version;\r
+    }\r
+\r
     /**\r
       Set parameter isEmulatedPCDDriver\r
   \r
@@ -70,6 +115,10 @@ public class PCDAutoGenAction extends BuildAction {
         this.isEmulatedPCDDriver = isEmulatedPCDDriver;\r
     }\r
 \r
+    public void setIsBuildUsedLibrary(boolean isBuildUsedLibrary) {\r
+        this.isBuildUsedLibrary = isBuildUsedLibrary;\r
+    }\r
+\r
     /**\r
       Get the output of generated string for header file.\r
   \r
@@ -96,10 +145,26 @@ public class PCDAutoGenAction extends BuildAction {
       @param moduleName            Parameter of this action class.\r
       @param isEmulatedPCDDriver   Parameter of this action class.\r
     **/\r
-    public PCDAutoGenAction(String moduleName, boolean isEmulatedPCDDriver) {\r
-        dbManager = null;\r
+    public PCDAutoGenAction(String  moduleName, \r
+                            UUID    moduleGuid, \r
+                            String  packageName,\r
+                            UUID    packageGuid,\r
+                            String  arch,\r
+                            String  version,\r
+                            boolean isEmulatedPCDDriver, \r
+                            boolean isBuildUsedLibrary) {\r
+        dbManager       = null;\r
+        hAutoGenString  = "";\r
+        cAutoGenString  = "";\r
+\r
         setIsEmulatedPCDDriver(isEmulatedPCDDriver);\r
         setModuleName(moduleName);\r
+        setModuleGuid(moduleGuid);\r
+        setPackageName(packageName);\r
+        setPackageGuid(packageGuid);\r
+        setArch(arch);\r
+        setVersion(version);\r
+        setIsBuildUsedLibrary(isBuildUsedLibrary);\r
     }\r
 \r
     /**\r
@@ -130,7 +195,6 @@ public class PCDAutoGenAction extends BuildAction {
     void performAction() throws BuildActionException {\r
         ActionMessage.debug(this, \r
                             "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");\r
-                            \r
         //\r
         // Check the PCD memory database manager is valid.\r
         //\r
@@ -141,20 +205,15 @@ public class PCDAutoGenAction extends BuildAction {
         dbManager = GlobalData.getPCDMemoryDBManager();\r
 \r
         if(dbManager.getDBSize() == 0) {\r
-           return; \r
+            return;\r
         }\r
 \r
         ActionMessage.debug(this,\r
                             "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens");\r
 \r
-        hAutoGenString = "";\r
-        cAutoGenString = "";\r
 \r
-        if(isEmulatedPCDDriver) {\r
-            generateAutogenForPCDEmulatedDriver();\r
-        } else {\r
-            generateAutogenForModule();\r
-        }\r
+\r
+        generateAutogenForModule();\r
     }\r
 \r
     /**\r
@@ -168,7 +227,30 @@ public class PCDAutoGenAction extends BuildAction {
         int                   index;\r
         List<UsageInstance>   usageInstanceArray;\r
 \r
-        usageInstanceArray  = dbManager.getUsageInstanceArrayByModuleName(moduleName);\r
+        if (!isBuildUsedLibrary) {\r
+            usageInstanceArray  = dbManager.getUsageInstanceArrayByModuleName(moduleName,\r
+                                                                              moduleGuid,\r
+                                                                              packageName,\r
+                                                                              packageGuid,\r
+                                                                              arch,\r
+                                                                              version);\r
+            dbManager.UsageInstanceContext = usageInstanceArray;\r
+            dbManager.CurrentModuleName    = moduleName; \r
+        } else {\r
+            usageInstanceArray = dbManager.UsageInstanceContext;\r
+            //\r
+            // For building MDE package, although all module are library, but PCD entries of \r
+            // these library should be used to autogen.\r
+            // \r
+            if (usageInstanceArray == null) {\r
+                usageInstanceArray  = dbManager.getUsageInstanceArrayByModuleName(moduleName,\r
+                                                                                  moduleGuid,\r
+                                                                                  packageName,\r
+                                                                                  packageGuid,\r
+                                                                                  arch,\r
+                                                                                  version);\r
+            }\r
+        }\r
 \r
         if(usageInstanceArray.size() != 0) {\r
             //\r
@@ -182,7 +264,7 @@ public class PCDAutoGenAction extends BuildAction {
                                 "Module " + moduleName + "'s PCD [" + Integer.toHexString(index) + \r
                                 "]: " + usageInstanceArray.get(index).parentToken.cName);\r
             try {\r
-                usageInstanceArray.get(index).generateAutoGen();\r
+                usageInstanceArray.get(index).generateAutoGen(isBuildUsedLibrary);\r
                 hAutoGenString += usageInstanceArray.get(index).getHAutogenStr() + "\r\n";\r
                 cAutoGenString += usageInstanceArray.get(index).getCAutogenStr() + "\r\n";\r
             } catch(EntityException exp) {\r
@@ -190,6 +272,10 @@ public class PCDAutoGenAction extends BuildAction {
             }\r
         }\r
 \r
+        //\r
+        // Work around code, In furture following code should be modified that get \r
+        // these information from Uplevel Autogen tools.\r
+        // \r
         if (moduleName.equalsIgnoreCase("PcdPeim")) {\r
             hAutoGenString += dbManager.PcdPeimHString;\r
             cAutoGenString += dbManager.PcdPeimCString;\r
@@ -206,64 +292,6 @@ public class PCDAutoGenAction extends BuildAction {
                             );\r
     }\r
 \r
-    /**\r
-      Generate all PCD autogen string and the emulated PCD IMAGE array for emulated driver.\r
-      \r
-      Currently, we should generated all PCD information(maybe all dynamic) as array \r
-      in Pei emulated driver for simulating PCD runtime database. \r
-      \r
-    **/\r
-    private void generateAutogenForPCDEmulatedDriver() {\r
-        int           index;\r
-        Token[]       tokenArray;\r
-        UsageInstance usageInstance;\r
-\r
-        //\r
-        // Add "#include 'PcdLib.h'" for Header file\r
-        //\r
-        hAutoGenString = "#include <MdePkg/Include/Library/PcdLib.h>\r\n";\r
-\r
-        tokenArray = dbManager.getRecordArray();\r
-        for(index = 0; index < tokenArray.length; index ++) {\r
-            //\r
-            // Get one consumer instance and generate autogen for this token.\r
-            //\r
-            if(tokenArray[index].consumers != null ) {\r
-                if(tokenArray[index].consumers.size() != 0) {\r
-                    usageInstance = tokenArray[index].consumers.get(0);\r
-                    try {\r
-                        usageInstance.generateAutoGen();\r
-                    } catch(EntityException exp) {\r
-                        throw new BuildActionException(exp.getMessage());\r
-                    }\r
-    \r
-                    hAutoGenString += usageInstance.getHAutogenStr();\r
-                    cAutoGenString += usageInstance.getCAutogenStr();\r
-    \r
-                    hAutoGenString += "\r\n";\r
-                    cAutoGenString += "\r\n";\r
-                } else {\r
-                    //\r
-                    // If the PCD does *not* usded by any module, also generate \r
-                    // it into autogen.h/autogen.c in Pcd driver according the\r
-                    // information in FPD file.\r
-                    //\r
-                    generateUnReferencePcdAutogenString(tokenArray[index]);\r
-                }\r
-            }\r
-        }\r
-\r
-        generatePCDEmulatedArray(tokenArray);\r
-\r
-        ActionMessage.debug(this,\r
-                             "PCD emulated driver's header: \r\n" + hAutoGenString + "\r\n"\r
-                            );\r
-        ActionMessage.debug(this,\r
-                             "PCD emulated driver's C code: \r\n" + cAutoGenString + "\r\n"\r
-                            );\r
-\r
-    }\r
-\r
     /**\r
       Generate unreference token definition string for PCD emulated string. \r
       \r
@@ -369,157 +397,6 @@ public class PCDAutoGenAction extends BuildAction {
         cAutoGenString += "\r\n";\r
     }\r
         \r
-    /**\r
-      Generate PCDEmulated array in PCDEmulated driver for emulated runtime database.\r
-      \r
-      @param tokenArray  All PCD token in memory database.\r
-      \r
-      @throws BuildActionException  Unknown PCD_TYPE\r
-    **/\r
-    private void generatePCDEmulatedArray(Token[] tokenArray)\r
-        throws BuildActionException {\r
-        int       index;\r
-        Token     token;\r
-        String[]  guidStrArray;\r
-        String    value;\r
-\r
-        //\r
-        // The value of String type of PCD entry maybe use byte array but not string direcly\r
-        // such as {0x1, 0x2, 0x3}, and define PCD1_STRING_Value as L"string define here"\r
-        // For this case, we should generate a string array to C output and use the address\r
-        // of generated string array.\r
-        //\r
-        for(index = 0; index < tokenArray.length; index ++) {\r
-            token = tokenArray[index];\r
-\r
-            value = token.datum.toString();\r
-            if(token.datumType == Token.DATUM_TYPE.POINTER) {\r
-                if(!((value.charAt(0) == 'L' && value.charAt(1) == '"') ||(value.charAt(0) == '"'))) {\r
-                    cAutoGenString += String.format("UINT8 _mPcdArray%08x[] = %s;\r\n", \r
-                                                     index, \r
-                                                     value\r
-                                                     );\r
-                }\r
-            }\r
-        }\r
-\r
-        //\r
-        // Output emulated PCD entry array\r
-        //\r
-        cAutoGenString += "\r\nEMULATED_PCD_ENTRY gEmulatedPcdEntry[] = {\r\n";\r
-\r
-        for(index = 0; index < tokenArray.length; index ++) {\r
-            token = tokenArray[index];\r
-\r
-            if(index != 0) {\r
-                cAutoGenString += ",\r\n";\r
-            }\r
-\r
-            //\r
-            // Print Start "{" for a Token item in array\r
-            //\r
-            cAutoGenString += "  {\r\n";\r
-\r
-            //\r
-            // Print Token Name\r
-            //\r
-            cAutoGenString += String.format("    _PCD_TOKEN_%s,\r\n", token.cName);\r
-\r
-            //\r
-            // Print Hii information\r
-            //\r
-            if(token.hiiEnabled) {\r
-                cAutoGenString += String.format("    TRUE,\r\n");\r
-            } else {\r
-                cAutoGenString += String.format("    FALSE,\r\n");\r
-            }\r
-\r
-            //\r
-            // Print sku information\r
-            //\r
-            if(token.skuEnabled) {\r
-                cAutoGenString += String.format("    TRUE,\r\n");\r
-            } else {\r
-                cAutoGenString += String.format("    FALSE,\r\n");\r
-            }\r
-\r
-            //\r
-            // Print maxSkuCount\r
-            //\r
-            cAutoGenString += String.format("    %d,\r\n", token.maxSkuCount);\r
-\r
-            cAutoGenString += String.format("    %d,\r\n", token.skuId);\r
-\r
-            if(token.variableGuid == null) {\r
-                cAutoGenString += "    { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },\r\n";\r
-            } else {\r
-                guidStrArray =(token.variableGuid.toString()).split("-");\r
-\r
-                cAutoGenString += String.format("    { 0x%s, 0x%s, 0x%s, { 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s } },\r\n",\r
-                                                 guidStrArray[0],\r
-                                                 guidStrArray[1],\r
-                                                 guidStrArray[2],\r
-                                                (guidStrArray[3].substring(0, 2)),\r
-                                                (guidStrArray[3].substring(2, 4)),\r
-                                                (guidStrArray[4].substring(0, 2)),\r
-                                                (guidStrArray[4].substring(2, 4)),\r
-                                                (guidStrArray[4].substring(4, 6)),\r
-                                                (guidStrArray[4].substring(6, 8)),\r
-                                                (guidStrArray[4].substring(8, 10)),\r
-                                                (guidStrArray[4].substring(10, 12))\r
-                                                );\r
-\r
-            }\r
-\r
-            value = token.datum.toString();\r
-            if(token.datumType == Token.DATUM_TYPE.POINTER) {\r
-                if((value.charAt(0) == 'L' && value.charAt(1) == '"') || value.charAt(0) == '"') {\r
-                    cAutoGenString += String.format("    sizeof(_PCD_VALUE_%s),\r\n", token.cName);\r
-                    cAutoGenString += String.format("    0, %s, %s,\r\n", token.variableName, value);\r
-                } else {\r
-                    cAutoGenString += String.format("    sizeof(_mPcdArray%08x),\r\n", index);\r
-                    cAutoGenString += String.format("    0, &_mPcdArray%08x, %s,\r\n", index, token.variableName);\r
-                }\r
-            } else {\r
-                switch(token.datumType) {\r
-                case UINT8:\r
-                    cAutoGenString += "    1,\r\n";\r
-                    break;\r
-                case UINT16:\r
-                    cAutoGenString += "    2,\r\n";\r
-                    break;\r
-                case UINT32:\r
-                    cAutoGenString += "    4,\r\n";\r
-                    break;\r
-                case UINT64:\r
-                    cAutoGenString += "    8,\r\n";\r
-                    break;\r
-                case BOOLEAN:\r
-                    cAutoGenString += "    1,\r\n";\r
-                    break;\r
-                default:\r
-                    throw new BuildActionException("Unknown datum size");\r
-                }\r
-                cAutoGenString += String.format("    %s, %s, NULL,\r\n", value, token.variableName);\r
-            }\r
-\r
-            //\r
-            // Print end "}" for a token item in array\r
-            //\r
-            cAutoGenString += "  }";\r
-        }\r
-\r
-        cAutoGenString += "\r\n};\r\n";\r
-        cAutoGenString += "\r\n";\r
-        cAutoGenString += "UINTN\r\n";\r
-        cAutoGenString += "GetPcdDataBaseSize(\r\n";\r
-        cAutoGenString += "  VOID\r\n";\r
-        cAutoGenString += "  )\r\n";\r
-        cAutoGenString += "{\r\n";\r
-        cAutoGenString += "  return sizeof(gEmulatedPcdEntry);\r\n";\r
-        cAutoGenString += "}\r\n";\r
-    }\r
-\r
     /**\r
       Test case function\r
 \r
@@ -527,8 +404,8 @@ public class PCDAutoGenAction extends BuildAction {
     **/\r
     public static void main(String argv[]) {\r
 \r
-        String WorkSpace = "X:/edk2";\r
-        String logFilePath = WorkSpace  + "/EdkNt32Pkg/Nt32.fpd";\r
+        String WorkSpace = "M:/ForPcd/edk2";\r
+        String logFilePath = WorkSpace  + "/MdePkg/MdePkg.fpd";\r
 \r
         //\r
         // At first, CollectPCDAction should be invoked to collect\r
@@ -538,8 +415,6 @@ public class PCDAutoGenAction extends BuildAction {
         GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
                             WorkSpace);\r
 \r
-        GlobalData.getPCDMemoryDBManager().setLogFileName(logFilePath + ".PCDMemroyDatabaseLog.txt");\r
-\r
         try {\r
             collectionAction.perform(WorkSpace, \r
                                      logFilePath,\r
@@ -551,7 +426,13 @@ public class PCDAutoGenAction extends BuildAction {
         //\r
         // Then execute the PCDAuotoGenAction to get generated Autogen.h and Autogen.c\r
         //\r
-        PCDAutoGenAction autogenAction = new PCDAutoGenAction("PcdDxe",\r
+        PCDAutoGenAction autogenAction = new PCDAutoGenAction("BaseLib",\r
+                                                              null,\r
+                                                              null,\r
+                                                              null,\r
+                                                              null,\r
+                                                              null,\r
+                                                              false,\r
                                                               false\r
                                                               );\r
         autogenAction.execute();\r
index cd67dd4..8af8123 100644 (file)
@@ -93,7 +93,6 @@ public class ShowPCDDatabaseAction extends UIAction {
         //\r
         GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
                             workspacePath);\r
-        GlobalData.getPCDMemoryDBManager().setLogFileName(fpdFilePath + ".PCDMemroyDatabaseLog.txt");\r
 \r
         //\r
         // Collect PCD information.\r
@@ -123,8 +122,10 @@ public class ShowPCDDatabaseAction extends UIAction {
     **/\r
     public static void main(String[] argv) throws UIException {\r
         ShowPCDDatabaseAction showAction = new ShowPCDDatabaseAction();\r
-        showAction.setWorkspacePath(argv[0]);\r
-        showAction.setFPDFilePath(argv[1]);\r
+        //showAction.setWorkspacePath(argv[0]);\r
+        //showAction.setFPDFilePath(argv[1]);\r
+        showAction.setWorkspacePath("M:/tianocore/edk2/trunk/edk2");\r
+        showAction.setFPDFilePath("EdkNt32Pkg/Nt32.fpd");\r
         showAction.execute();\r
     }\r
 }\r
index 0acdad0..b03cdde 100644 (file)
@@ -26,8 +26,8 @@ import java.util.HashMap;
 import java.util.Hashtable;\r
 import java.util.List;\r
 import java.util.Map;\r
+import java.util.UUID;\r
 \r
-import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.pcd.action.ActionMessage;\r
 \r
 /** Database hold all PCD information comes from SPD, MSA, FPD file in memory.\r
@@ -37,12 +37,18 @@ public class MemoryDatabaseManager {
     ///  Memory database. The string "cName + SpaceNameGuid" is primary key.\r
     ///  memory database is in global scope, and it will be used for others PCD tools.\r
     ///\r
-    private static Map<String, Token>  memoryDatabase = null;\r
+    private static Map<String, Token>  memoryDatabase       = null;\r
+\r
     ///\r
-    /// The log file name for dumping memory database.\r
+    /// Before build a module, the used libary will be build firstly, the PCD of these\r
+    /// libarry is inheritted by the module, so stored module's PCD information as PCD\r
+    /// context of building libary.\r
+    /// \r
+    public static List<UsageInstance> UsageInstanceContext = null;\r
     ///\r
-    private static String              logFileName    = null;\r
-\r
+    /// \r
+    /// \r
+    public static String CurrentModuleName                 = null;\r
     public static String PcdPeimHString       = "";\r
     public static String PcdPeimCString       = "";\r
     public static String PcdDxeHString        = "";\r
@@ -60,22 +66,6 @@ public class MemoryDatabaseManager {
         }\r
     }\r
 \r
-    /**\r
-      Get the log file name.\r
-    **/\r
-    public String getLogFileName() {\r
-        return logFileName;\r
-    }\r
-\r
-    /**\r
-      Set parameter log file name.\r
-  \r
-      @param fileName log file name parameter.\r
-    **/\r
-    public void setLogFileName(String fileName) {\r
-        logFileName = fileName;\r
-    }\r
-\r
     /**\r
       Judege whether token exists in memory database\r
       \r
@@ -143,8 +133,12 @@ public class MemoryDatabaseManager {
         return tokenArray;\r
     }\r
 \r
-\r
-    private ArrayList<Token> getDynamicRecordArray() {\r
+    /**\r
+       Get record array only contains DYNAMIC or DYNAMIC_EX type PCD.\r
+       \r
+       @return ArrayList\r
+     */\r
+    private ArrayList getDynamicRecordArray() {\r
         Token[]     tokenArray  =   getRecordArray();\r
         int         index       =   0;\r
         int         count       =   0;\r
@@ -170,40 +164,28 @@ public class MemoryDatabaseManager {
     public void getTwoPhaseDynamicRecordArray(ArrayList<Token> pei, ArrayList<Token> dxe) {\r
         int                     usageInstanceIndex  =   0;\r
         int                     index               =   0;\r
-        ArrayList<Token>        tokenArrayList      =   getDynamicRecordArray();\r
-        List<UsageInstance>     usageInstanceArray  =   null;\r
+        ArrayList               tokenArrayList      =   getDynamicRecordArray();\r
+        Object[]                usageInstanceArray  =   null;\r
         UsageInstance           usageInstance       =   null;\r
 \r
+        //pei = new ArrayList<Token>();\r
+        //dxe = new ArrayList<Token>();\r
+\r
         for (index = 0; index < tokenArrayList.size(); index++) {\r
             boolean found   =   false;\r
             Token       token = (Token) tokenArrayList.get(index);\r
-            if (token.producers != null) {\r
-                usageInstanceArray = token.producers;\r
-                for (usageInstanceIndex = 0; usageInstanceIndex < usageInstanceArray.size(); usageInstanceIndex++) {\r
-                    usageInstance = (UsageInstance) usageInstanceArray.get(usageInstanceIndex);\r
-                    if (CommonDefinition.isPeiPhaseComponent(usageInstance.componentType)) {\r
+            if (token.consumers != null) {\r
+                usageInstanceArray = token.consumers.entrySet().toArray();\r
+                for (usageInstanceIndex = 0; usageInstanceIndex < token.consumers.size(); usageInstanceIndex ++) {\r
+                    usageInstance =(UsageInstance) (((Map.Entry)usageInstanceArray[usageInstanceIndex]).getValue());\r
+                    if (usageInstance.isPeiPhaseComponent()) {\r
                         pei.add(token);\r
                         found = true;\r
                         break;\r
                     }\r
                 }\r
-\r
-            }\r
-            if (!found) {\r
-                if (token.consumers != null) {\r
-                    usageInstanceArray = token.consumers;\r
-                    for (usageInstanceIndex = 0; usageInstanceIndex < usageInstanceArray.size(); usageInstanceIndex ++) {\r
-                        usageInstance =(UsageInstance) usageInstanceArray.get(usageInstanceIndex);\r
-                        if (CommonDefinition.isPeiPhaseComponent(usageInstance.componentType)) {\r
-                            pei.add(token);\r
-                            found = true;\r
-                            break;\r
-                        }\r
-                    }\r
-                }\r
             }\r
 \r
-            //\r
             // If no PEI components reference the PCD entry, we insert it to DXE list\r
             //\r
             if (!found) {\r
@@ -215,17 +197,40 @@ public class MemoryDatabaseManager {
     }\r
 \r
     /**\r
-      Get all PCD record for a module according to module's name.\r
+      Get all PCD record for a module according to module's name, module's GUID,\r
+      package name, package GUID, arch, version information.\r
      \r
       @param moduleName  the name of module.\r
       \r
       @return  all usage instance for this module in memory database.\r
     **/\r
-    public List<UsageInstance> getUsageInstanceArrayByModuleName(String moduleName) {\r
+    public List<UsageInstance> getUsageInstanceArrayByModuleName(String moduleName,\r
+                                                                 UUID   moduleGuid,\r
+                                                                 String packageName,\r
+                                                                 UUID   packageGuid,\r
+                                                                 String arch,\r
+                                                                 String version) {\r
+\r
+        String primaryKey = UsageInstance.getPrimaryKey(moduleName, \r
+                                                        moduleGuid,\r
+                                                        packageName,\r
+                                                        packageGuid,\r
+                                                        arch,\r
+                                                        version);\r
+\r
+        return getUsageInstanceArrayByKeyString(primaryKey);\r
+    }\r
+\r
+    /**\r
+       Get all PCD token for a usage instance according to primary key.\r
+       \r
+       @param primaryKey    the primary key of usage instance.\r
+       \r
+       @return List<UsageInstance>\r
+     */\r
+    public List<UsageInstance> getUsageInstanceArrayByKeyString(String primaryKey) {\r
         Token[]               tokenArray          = null;\r
         int                   recordIndex         = 0; \r
-        int                   usageInstanceIndex  = 0;\r
-        List<UsageInstance>   usageInstanceArray  = null;\r
         UsageInstance         usageInstance       = null;\r
         List<UsageInstance>   returnArray         = new ArrayList<UsageInstance>();\r
 \r
@@ -235,31 +240,14 @@ public class MemoryDatabaseManager {
         // Loop to find all PCD record related to current module\r
         //\r
         for (recordIndex = 0; recordIndex < getDBSize(); recordIndex ++) {\r
-            if (tokenArray[recordIndex].producers != null) {\r
-                usageInstanceArray = tokenArray[recordIndex].producers;\r
-                for (usageInstanceIndex = 0; usageInstanceIndex < usageInstanceArray.size(); usageInstanceIndex ++) {\r
-                    usageInstance =(UsageInstance) usageInstanceArray.get(usageInstanceIndex);\r
-                    if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                        returnArray.add(usageInstance);\r
-                    }\r
-                }\r
-            }\r
-\r
-            if (tokenArray[recordIndex].consumers != null) {\r
-                usageInstanceArray = tokenArray[recordIndex].consumers;\r
-                for (usageInstanceIndex = 0; usageInstanceIndex < usageInstanceArray.size(); usageInstanceIndex ++) {\r
-                    usageInstance =(UsageInstance) usageInstanceArray.get(usageInstanceIndex);\r
-                    if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                        returnArray.add(usageInstance);\r
-                    }\r
+            if (tokenArray[recordIndex].consumers.size() != 0) {\r
+                usageInstance = tokenArray[recordIndex].consumers.get(primaryKey);\r
+                if (usageInstance != null) {\r
+                    returnArray.add(usageInstance);\r
                 }\r
             }\r
         }\r
 \r
-        if (returnArray.size() == 0) {\r
-            ActionMessage.warning(this, "Can *not* find any usage instance for " + moduleName + " !");\r
-        }\r
-\r
         return returnArray;\r
     }\r
 \r
@@ -274,112 +262,31 @@ public class MemoryDatabaseManager {
         int                       usageIndex    = 0;\r
         int                       moduleIndex   = 0;\r
         Token[]                   tokenArray    = null;\r
+        Object[]                  usageInstanceArray = null;\r
         List<String>              moduleNames   = new ArrayList<String>();\r
         UsageInstance             usageInstance = null;\r
         boolean                   bFound        = false;\r
 \r
-        tokenArray = this.getRecordArray();\r
-        //\r
-        // Find all producer usage instance for retrieving module's name\r
-        //\r
-        for (indexToken = 0; indexToken < getDBSize(); indexToken ++) {\r
-            for (usageIndex = 0; usageIndex < tokenArray[indexToken].producers.size(); usageIndex ++) {\r
-                usageInstance = tokenArray[indexToken].producers.get(usageIndex);\r
-                bFound        = false;\r
-                for (moduleIndex = 0; moduleIndex < moduleNames.size(); moduleIndex ++) {\r
-                    if (moduleNames.get(moduleIndex).equalsIgnoreCase(usageInstance.moduleName)) {\r
-                        bFound = true;\r
-                        break;\r
-                    }\r
-                }\r
-                if (!bFound) {\r
-                    moduleNames.add(usageInstance.moduleName);\r
-                }\r
-            }\r
-        }\r
-\r
+        tokenArray = getRecordArray();\r
         //\r
         // Find all consumer usage instance for retrieving module's name\r
         //\r
         for (indexToken = 0; indexToken < getDBSize(); indexToken ++) {\r
+            usageInstanceArray = tokenArray[indexToken].consumers.entrySet().toArray();\r
             for (usageIndex = 0; usageIndex < tokenArray[indexToken].consumers.size(); usageIndex ++) {\r
-                usageInstance = tokenArray[indexToken].consumers.get(usageIndex);\r
+                usageInstance = (UsageInstance)((Map.Entry)usageInstanceArray[usageIndex]).getValue();\r
                 bFound        = false;\r
                 for (moduleIndex = 0; moduleIndex < moduleNames.size(); moduleIndex ++) {\r
-                    if (moduleNames.get(moduleIndex).equalsIgnoreCase(usageInstance.moduleName)) {\r
+                    if (moduleNames.get(moduleIndex).equalsIgnoreCase(usageInstance.getPrimaryKey())) {\r
                         bFound = true;\r
                         break;\r
                     }\r
                 }\r
                 if (!bFound) {\r
-                    moduleNames.add(usageInstance.moduleName);\r
+                    moduleNames.add(usageInstance.getPrimaryKey());\r
                 }\r
             }\r
         }\r
         return moduleNames;\r
     }\r
-\r
-    /**\r
-      Dump all PCD record into file for reviewing.\r
-    **/\r
-    public void DumpAllRecords() {\r
-        BufferedWriter    bWriter           = null;\r
-        Object[]          tokenArray        = null;\r
-        Map.Entry         entry             = null;\r
-        Token             token             = null;\r
-        int               index             = 0;\r
-        int               usageIndex        = 0;\r
-        UsageInstance     usageInstance     = null;\r
-        String            inheritString     = null;\r
-        String            componentTypeName = null;\r
-\r
-        try {\r
-            bWriter = new BufferedWriter(new FileWriter(new File(logFileName)));\r
-            tokenArray = memoryDatabase.entrySet().toArray();\r
-            for (index = 0; index < memoryDatabase.size(); index ++) {\r
-                entry =(Map.Entry) tokenArray [index];\r
-                token =(Token) entry.getValue();\r
-                bWriter.write("****** token [" + Integer.toString(index) + "] ******\r\n");\r
-                bWriter.write(" cName:" + token.cName + "\r\n");\r
-                for (usageIndex = 0; usageIndex < token.producers.size(); usageIndex ++) {\r
-                    usageInstance     =(UsageInstance)token.producers.get(usageIndex);\r
-                    componentTypeName = CommonDefinition.getComponentTypeString(usageInstance.componentType);\r
-\r
-                    if (usageInstance.isInherit) {\r
-                        inheritString = "Inherit";\r
-                    } else {\r
-                        inheritString = "";\r
-                    }\r
-                    bWriter.write(String.format("   (Producer)#%d: %s:%s  Package:%s  %s\r\n",\r
-                                                usageIndex,\r
-                                                componentTypeName,\r
-                                                usageInstance.moduleName,\r
-                                                usageInstance.packageName,\r
-                                                inheritString\r
-                                               )\r
-                                 );\r
-                }\r
-                for (usageIndex = 0; usageIndex < token.consumers.size(); usageIndex ++) {\r
-                    usageInstance     =(UsageInstance)token.consumers.get(usageIndex);\r
-                    componentTypeName = CommonDefinition.getComponentTypeString(usageInstance.componentType);\r
-                    if (usageInstance.isInherit) {\r
-                        inheritString = "Inherit";\r
-                    } else {\r
-                        inheritString = "";\r
-                    }\r
-                    bWriter.write(String.format("   (Consumer)#%d: %s:%s  Package:%s  %s\r\n",\r
-                                                usageIndex,\r
-                                                componentTypeName,\r
-                                                usageInstance.moduleName,\r
-                                                usageInstance.packageName,\r
-                                                inheritString\r
-                                               )\r
-                                 );\r
-                }\r
-            }\r
-            bWriter.close();\r
-        } catch (IOException exp) {\r
-            ActionMessage.warning(this, "Failed to open database log file: " + logFileName);\r
-        }\r
-    }\r
 }\r
index 5931b8b..3136864 100644 (file)
@@ -18,8 +18,11 @@ package org.tianocore.build.pcd.entity;
 import java.util.ArrayList;\r
 import java.util.List;\r
 import java.util.UUID;\r
+import java.util.Map;\r
+import java.util.HashMap;\r
 \r
 import org.tianocore.build.pcd.action.ActionMessage;\r
+import org.tianocore.build.pcd.exception.EntityException;\r
 \r
 /** This class is to descript a PCD token object. The information of a token mainly \r
     comes from MSA, SPD and setting produced by platform developer. \r
@@ -66,30 +69,11 @@ public class Token {
     ///\r
     public int              tokenNumber;\r
 \r
-    ///\r
-    /// The token space name assigned by platform. For Non-DynamicEx driver this value is same.\r
-    /// assignedtokenSpaceName is defined in FPD.\r
-    ///\r
-    public UUID             assignedtokenSpaceName;\r
-\r
-    ///\r
-    /// The token number assigned by platform. The number indiect the offset of this token in platform\r
-    /// token space.\r
-    /// AssgiendtokenNumber is defined in FPD.\r
-    ///\r
-    public int              assignedtokenNumber;\r
-\r
     ///\r
     /// pcdType is the PCD item type defined by platform developer.\r
     ///\r
     public PCD_TYPE         pcdType;\r
 \r
-    ///\r
-    /// PCDtype is set by platform developer. It is final PCD type of this token.\r
-    /// SupportedPcdType is defined in SPD.\r
-    ///\r
-    public PCD_TYPE[]       supportedpcdType;\r
-\r
     ///\r
     /// datumSize is to descript the fix size or max size for this token. \r
     /// datumSize is defined in SPD.\r
@@ -102,13 +86,6 @@ public class Token {
     ///\r
     public DATUM_TYPE       datumType;\r
 \r
-    ///\r
-    /// Isplatform is to descript whether this token is defined in platform level.\r
-    /// If token is belong to platform level. The value can be different for every\r
-    /// module. All are determined by platform developer.\r
-    ///\r
-    public boolean          isPlatform;\r
-\r
     ///\r
     /// hiiEnabled is to indicate whether the token support Hii functionality.\r
     /// hiiEnabled is defined in FPD.\r
@@ -140,11 +117,6 @@ public class Token {
     ///\r
     public boolean          skuEnabled;\r
 \r
-    ///\r
-    /// skuDataArrayEnabled is to indicate wheter use the skuData array or default value.\r
-    ///\r
-    public boolean          skuDataArrayEnabled;\r
-\r
     ///\r
     /// skuData contains all value for SkuNumber of token.\r
     /// skuData is defined in FPD.\r
@@ -169,12 +141,6 @@ public class Token {
     ///\r
     public Object           datum;\r
 \r
-    ///\r
-    /// Default value of this token.\r
-    /// This default value is defined in SPD level.\r
-    ///\r
-    public Object           defaultValue;\r
-\r
     ///\r
     /// BUGBUG: fix comment\r
     /// vpdEnabled is defined in FPD.\r
@@ -187,55 +153,33 @@ public class Token {
     ///\r
     public long             vpdOffset;\r
 \r
-    ///\r
-    /// producers array record all module private information who produce this PCD token.\r
-    ///\r
-    public List<UsageInstance>  producers;\r
-\r
     ///\r
     /// consumers array record all module private information who consume this PCD token.\r
     ///\r
-    public List<UsageInstance>  consumers;\r
+    public Map<String, UsageInstance>  consumers;\r
 \r
-    /**\r
-      Constructure function.\r
-     \r
-      Initialize the value of token.\r
-     \r
-      @param cName                   The cName of this token\r
-      @param tokenSpaceName          The tokenSpaceName of this token, it is a GUID.\r
-      @param assignedtokenSpaceName  The assignedtokenSpaceName of this token, it is a GUID.\r
-      \r
-    **/ \r
-    public Token(String cName, UUID tokenSpaceName, UUID assignedtokenSpaceName) {\r
+    public Token(String cName, UUID tokenSpaceName) {\r
         UUID    nullUUID = new UUID(0, 0);\r
 \r
         this.cName                  = cName;\r
-        this.tokenSpaceName         =(tokenSpaceName == null) ? nullUUID : tokenSpaceName;\r
-        this.assignedtokenSpaceName =(assignedtokenSpaceName == null) ? nullUUID : assignedtokenSpaceName;\r
+        this.tokenSpaceName         = (tokenSpaceName == null) ? nullUUID : tokenSpaceName;\r
         this.tokenNumber            = 0;\r
-        this.assignedtokenNumber    = 0;\r
         this.pcdType                = PCD_TYPE.UNKNOWN;\r
-        this.supportedpcdType       = null;\r
-        this.isPlatform             = false;\r
         this.datumType              = DATUM_TYPE.UNKNOWN;\r
         this.datumSize              = -1;\r
-        this.defaultValue           = null;\r
         this.datum                  = null;\r
         this.hiiEnabled             = false;\r
         this.variableGuid           = null;\r
         this.variableName           = "";\r
         this.variableOffset         = -1;\r
         this.skuEnabled             = false;\r
-        this.skuDataArrayEnabled    = false;\r
         this.skuId                  = -1;\r
         this.maxSkuCount            = -1;\r
         this.skuData                = new ArrayList<SkuInstance>();\r
         this.vpdEnabled             = false;\r
         this.vpdOffset              = -1;\r
 \r
-        this.producers              = new ArrayList<UsageInstance>();\r
-        this.consumers              = new ArrayList<UsageInstance>();\r
+        this.consumers              = new HashMap<String, UsageInstance>();\r
     }\r
 \r
     /**\r
@@ -247,19 +191,23 @@ public class Token {
       \r
       @return  primary key for this token in token database.\r
     **/\r
-    public static String getPrimaryKeyString(String cName, UUID tokenSpaceName, \r
-                                             UUID platformtokenSpaceName) {\r
+    public static String getPrimaryKeyString(String cName, UUID tokenSpaceName) {\r
         UUID  nullUUID = new UUID(0, 0);\r
 \r
-        if (platformtokenSpaceName == nullUUID) {\r
-            return cName + "_" + tokenSpaceName.toString().replace('-', '_');\r
+        if (tokenSpaceName == null) {\r
+            return cName + "_" + nullUUID.toString().replace('-', '_');\r
         } else {\r
-            return cName + "_" + platformtokenSpaceName.toString().replace('-', '_');\r
+            return cName + "_" + tokenSpaceName.toString().replace('-', '_');\r
         }\r
     }\r
 \r
+    /**\r
+       Get the token primary key in token database.\r
+       \r
+       @return String\r
+     */\r
     public String getPrimaryKeyString () {\r
-        return cName + "_" + tokenSpaceName.toString().replace('-', '_');\r
+        return Token.getPrimaryKeyString(cName, tokenSpaceName);\r
     }\r
 \r
     /**\r
@@ -302,99 +250,52 @@ public class Token {
       @retval TRUE  - Success to add usage instance.\r
       @retval FALSE - Fail to add usage instance\r
     **/\r
-    public boolean addUsageInstance(UsageInstance usageInstance) {\r
-        if (usageInstance.usage == PCD_USAGE.UNKNOWN) {\r
-            return false;\r
+    public boolean addUsageInstance(UsageInstance usageInstance) \r
+        throws EntityException {\r
+        String exceptionStr;\r
+\r
+        if (isUsageInstanceExist(usageInstance.moduleName,\r
+                                 usageInstance.moduleGUID,\r
+                                 usageInstance.packageName,\r
+                                 usageInstance.packageGUID,\r
+                                 usageInstance.arch,\r
+                                 usageInstance.version)) {\r
+            exceptionStr = String.format("PCD %s for module %s has already exist in database, Please check all PCD build entries "+\r
+                                         "in modules PcdPeim in <ModuleSA> to make sure no duplicated definitions!",\r
+                                         usageInstance.parentToken.cName,\r
+                                         usageInstance.moduleName);\r
+            throw new EntityException(exceptionStr);\r
         }\r
 \r
-        if ((usageInstance.usage == PCD_USAGE.ALWAYS_PRODUCED) ||\r
-            (usageInstance.usage == PCD_USAGE.SOMETIMES_PRODUCED)) {\r
-            producers.add(usageInstance);\r
-        } else {\r
-            consumers.add(usageInstance);\r
-        }\r
+        consumers.put(usageInstance.getPrimaryKey(), usageInstance);\r
         return true;\r
     }\r
 \r
     /**\r
-      Judge whether exist an usage instance for this token\r
-      \r
-      @param moduleName   Use xmlFilePath as keyword to search the usage instance\r
-      \r
-      @retval PCD_USAGE - if UsageInstance exists.\r
-      @retval UNKNOWN   - if UsageInstance does not exist, return UNKONW.\r
-    **/\r
-    public PCD_USAGE isUsageInstanceExist(String moduleName) {\r
-        int           index;\r
-        UsageInstance usageInstance;\r
-\r
-        if (moduleName == null) {\r
-            ActionMessage.warning(this, "Error parameter for isUsageInstanceExist() function!");\r
-            return PCD_USAGE.UNKNOWN;\r
-        }\r
-\r
-        if (moduleName.length() == 0) {\r
-            return PCD_USAGE.UNKNOWN;\r
-        }\r
-\r
-        //\r
-        // Searching the usage instance in module's producer and consumer according to \r
-        // module's name.\r
-        //\r
-        for (index = 0; index < producers.size(); index ++) {\r
-            usageInstance =(UsageInstance)producers.get(index);\r
-            if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                return usageInstance.usage;\r
-            }\r
-        }\r
-\r
-        for (index = 0; index < consumers.size(); index ++) {\r
-            usageInstance =(UsageInstance)consumers.get(index);\r
-            if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                return usageInstance.usage;\r
-            }\r
-        }\r
-        return PCD_USAGE.UNKNOWN;\r
-    }\r
-\r
-    /**\r
-      Get usage instance according to a MSA file name\r
-      \r
-      @param moduleName   The file path string of MSA file.\r
-\r
-      @return usage instance object.\r
-    **/\r
-    public UsageInstance getUsageInstance(String moduleName) {\r
-        int           usageIndex;\r
-        UsageInstance usageInstance;\r
-\r
-        if (moduleName == null) {\r
-            ActionMessage.warning(this, "Error parameter for isUsageInstanceExist() function!");\r
-            return null;\r
-        }\r
-\r
-        if (moduleName.length() == 0) {\r
-            return null;\r
-        }\r
-\r
-        if (producers.size() != 0) {\r
-            for (usageIndex = 0; usageIndex < producers.size(); usageIndex ++) {\r
-                usageInstance =(UsageInstance)producers.get(usageIndex);\r
-                if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                    return usageInstance;\r
-                }\r
-            }\r
-        }\r
-\r
-        if (consumers.size() != 0) {\r
-            for (usageIndex = 0; usageIndex < consumers.size(); usageIndex ++) {\r
-                usageInstance =(UsageInstance)consumers.get(usageIndex);\r
-                if (usageInstance.moduleName.equalsIgnoreCase(moduleName)) {\r
-                    return usageInstance;\r
-                }\r
-            }\r
-        }\r
-        return null;\r
+       Judge whether exist an usage instance for this token\r
+       \r
+       @param moduleName    the name of module\r
+       @param moduleGuid    the GUID name of modules\r
+       @param packageName   the name of package contains this module\r
+       @param packageGuid   the GUID name of package contains this module\r
+       @param arch          the architecture string\r
+       @param version       the version string\r
+       \r
+       @return boolean      whether exist an usage instance for this token.\r
+     */\r
+    public boolean isUsageInstanceExist(String moduleName,\r
+                                        UUID   moduleGuid,\r
+                                        String packageName,\r
+                                        UUID   packageGuid,\r
+                                        String arch,\r
+                                        String version) {\r
+        String keyStr = UsageInstance.getPrimaryKey(moduleName, \r
+                                                    moduleGuid, \r
+                                                    packageName, \r
+                                                    packageGuid, \r
+                                                    arch, \r
+                                                    version);\r
+        return (consumers.get(keyStr) != null);\r
     }\r
 \r
     /**\r
index 2bd704d..90c0f63 100644 (file)
@@ -18,10 +18,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.build.pcd.entity;\r
 \r
 \r
-import org.tianocore.build.pcd.exception.EntityException;\r
-import org.tianocore.build.pcd.action.ActionMessage;\r
+import java.util.UUID;\r
 \r
 import org.tianocore.build.autogen.CommonDefinition;\r
+import org.tianocore.build.pcd.action.ActionMessage;\r
+import org.tianocore.build.pcd.exception.EntityException;\r
 \r
 /**\r
   This class indicate an usage instance for a PCD token. This instance maybe a module\r
@@ -29,50 +30,50 @@ import org.tianocore.build.autogen.CommonDefinition;
   is an usage instance for this PCD token.\r
 **/\r
 public class UsageInstance {\r
+  ///\r
+  /// The module type of usage instance.\r
+  /// \r
+  public enum MODULE_TYPE {SEC, PEI_CORE, PEIM, DXE_CORE, DXE_DRIVERS, OTHER_COMPONENTS}\r
   ///\r
   /// This parent that this usage instance belongs to.\r
   ///\r
   public Token            parentToken;\r
   ///\r
-  /// The usage of this token for platform or module.\r
-  ///\r
-  public Token.PCD_USAGE  usage;\r
-  ///\r
-  /// Whether this usage instance inherit from library\r
-  ///\r
-  public boolean          isInherit;\r
-  ///\r
-  /// The pcd type of this token for module.\r
-  ///\r
-  public Token.PCD_TYPE   modulePcdType;\r
-  ///\r
   /// The name of the module who contains this PCD.\r
   ///\r
   public String           moduleName;\r
   ///\r
+  /// The GUID of the module who contains this PCD. \r
+  /// \r
+  public UUID             moduleGUID;\r
+  ///\r
   /// The name of the package whose module contains this PCD.\r
   ///\r
   public String           packageName;\r
   ///\r
-  /// The component type for this usage instance.\r
+  /// The GUID of the package whose module contains this PCD.\r
+  /// \r
+  public UUID             packageGUID;\r
   ///\r
-  public int              componentType;\r
-  ///\r
-  /// The default value defined in MSA has high prior than defined in SPD.\r
-  ///\r
-  public Object           defaultValueInMSA;\r
+  /// The PCD type defined for module \r
+  /// \r
+  public Token.PCD_TYPE   modulePcdType;\r
   ///\r
-  /// The default value defined in SPD.\r
+  /// The arch string of module contains this PCD\r
   ///\r
-  public Object           defaultValueInSPD;\r
+  public String           arch;\r
   ///\r
-  /// Help text in MSA\r
+  /// The version of module contains this PCD\r
+  /// \r
+  public String           version;\r
   ///\r
-  public String           helpTextInMSA;\r
+  /// The module type for this usage instance.\r
   ///\r
-  /// Help text in SPD\r
+  public MODULE_TYPE      moduleType;\r
   ///\r
-  public String           helpTextInSPD;\r
+  /// The value of the PCD in this usage instance. \r
+  /// \r
+  public Object           datum;\r
   ///\r
   /// Autogen string for header file.\r
   ///\r
@@ -83,367 +84,265 @@ public class UsageInstance {
   public String           cAutogenStr;\r
 \r
   /**\r
-    Constructure function\r
-    \r
-    @param parentToken         Member variable.\r
-    @param usage               Member variable.\r
-    @param pcdType             Member variable.\r
-    @param componentType       Member variable.\r
-    @param defaultValueInMSA   Member variable.\r
-    @param defaultValueInSPD   Member variable.\r
-    @param helpTextInMSA       Member variable.\r
-    @param helpTextInSPD       Member variable.\r
-    @param moduleName          Member variable.\r
-    @param packageName         Member variable.\r
-    @param isInherit           Member variable.\r
+     Constructure function\r
+     \r
+     @param parentToken         Member variable.\r
+     @param pcdType             Member variable.\r
+     @param moduleName          Member variable.\r
+     @param moduleGUID          Member variable.\r
+     @param packageName         Member variable.\r
+     @param packageGUID         Member variable.\r
+     @param moduleType          Member variable.\r
+     @param modulePcdType       Member variable.\r
+     @param arch                Member variable.\r
+     @param version             Member variable.\r
+     @param value               Member variable.\r
   **/\r
-  public UsageInstance(\r
-    Token           parentToken,\r
-    Token.PCD_USAGE usage,\r
-    Token.PCD_TYPE  pcdType,\r
-    int             componentType,\r
-    Object          defaultValueInMSA,\r
-    Object          defaultValueInSPD,\r
-    String          helpTextInMSA,\r
-    String          helpTextInSPD,\r
-    String          moduleName,\r
-    String          packageName,\r
-    boolean         isInherit\r
-    )\r
-  {\r
-    this.parentToken       = parentToken;\r
-    this.usage             = usage;\r
-    this.modulePcdType     = pcdType;\r
-    this.componentType     = componentType;\r
-    this.defaultValueInMSA = defaultValueInMSA;\r
-    this.defaultValueInSPD = defaultValueInSPD;\r
-    this.helpTextInMSA     = helpTextInMSA;\r
-    this.helpTextInSPD     = helpTextInSPD;\r
-    this.moduleName        = moduleName;\r
-    this.packageName       = packageName;\r
-    this.isInherit         = isInherit;\r
+  public UsageInstance (Token             parentToken,\r
+                        Token.PCD_TYPE    pcdType,\r
+                        String            moduleName,\r
+                        UUID              moduleGUID,\r
+                        String            packageName,\r
+                        UUID              packageGUID,\r
+                        MODULE_TYPE       moduleType,\r
+                        Token.PCD_TYPE    modulePcdType,\r
+                        String            arch,\r
+                        String            version,\r
+                        Object            value) {\r
+      this.parentToken      = parentToken;\r
+      this.moduleName       = moduleName;\r
+      this.moduleGUID       = moduleGUID;\r
+      this.packageName      = packageName;\r
+      this.packageGUID      = packageGUID;\r
+      this.moduleType       = moduleType;\r
+      this.modulePcdType    = modulePcdType;\r
+      this.arch             = arch;\r
+      this.version          = version;\r
+      this.datum            = value;\r
+      this.modulePcdType    = pcdType;\r
   }\r
 \r
   /**\r
-    Generate autogen string for header file and C code file.\r
-    \r
-    @throws EntityException Fail to generate.\r
+     Get the primary key for usage instance array for every token.\r
+     \r
+     @param moduleName      the name of module\r
+     @param moduleGUID      the GUID name of module\r
+     @param packageName     the name of package who contains this module\r
+     @param packageGUID     the GUID name of package\r
+     @param arch            the archtecture string\r
+     @param version         the version of this module\r
+     \r
+     @return String         primary key\r
+   */\r
+  public static String getPrimaryKey(String moduleName,  \r
+                                     UUID   moduleGUID,  \r
+                                     String packageName,  \r
+                                     UUID   packageGUID,\r
+                                     String arch,\r
+                                     String version) {\r
+      //\r
+      // Because currently transition schema not require write moduleGuid, package Name, Packge GUID in\r
+      // <ModuleSA> section, So currently no expect all paramter must be valid.\r
+      return (moduleName                                                              + "_" +\r
+              ((moduleGUID  != null) ? moduleGUID.toString() : "NullModuleGuid")      + "_" +\r
+              ((packageName != null) ? packageName : "NullPackageName")               + "_" +\r
+              ((packageGUID != null) ? packageGUID.toString() : "NullPackageGuid")    + "_" +\r
+              ((arch        != null) ? arch : "NullArch")                             + "_" +\r
+              ((version     != null) ? version : "NullVersion"));\r
+  }\r
+\r
+  /**\r
+     Get primary key string for this usage instance\r
+     \r
+     @return String primary key string\r
   **/\r
-  public void generateAutoGen() throws EntityException {\r
-    Object value        = null;\r
-    int    tokenNumber  = 0;\r
+  public String getPrimaryKey() {\r
+      return UsageInstance.getPrimaryKey(moduleName, moduleGUID, packageName, packageGUID, arch, version);\r
+  }\r
 \r
-    hAutogenStr = "";\r
-    cAutogenStr = "";\r
+  /**\r
+     Judget whether current module is PEI driver\r
+     \r
+     @return boolean\r
+   */\r
+  public boolean isPeiPhaseComponent() {\r
+      if ((moduleType == MODULE_TYPE.PEI_CORE) ||\r
+          (moduleType == MODULE_TYPE.PEIM)) {\r
+          return true;\r
+      }\r
+      return false;\r
+  }\r
 \r
-    value = this.parentToken.datum;\r
+  /**\r
+     Generate autogen string for header file and C code file.\r
+     \r
+     @throws EntityException Fail to generate.\r
+     \r
+     @param isBuildUsedLibrary  whether the autogen is for library.\r
+   */\r
+  public void generateAutoGen(boolean isBuildUsedLibrary) \r
+    throws EntityException {\r
 \r
-    //\r
-    // If this pcd token's PCD_TYPE is DYNAMIC_EX, use itself token space name \r
-    // otherwices use assgined token space name from tool automatically.\r
-    //\r
-    if(parentToken.pcdType == Token.PCD_TYPE.DYNAMIC_EX) {\r
-      tokenNumber = parentToken.tokenNumber;\r
-    } else {\r
-      tokenNumber = parentToken.assignedtokenNumber;\r
-    }\r
+    hAutogenStr = "";\r
+    cAutogenStr = "";\r
 \r
     hAutogenStr += String.format("#define _PCD_TOKEN_%s   0x%016x\r\n", \r
-                                 parentToken.cName, tokenNumber);\r
-\r
+                                 parentToken.cName, parentToken.tokenNumber);\r
     switch(modulePcdType) {\r
     case FEATURE_FLAG:\r
-      //\r
-      // BUGBUG: The judegement of module PCD type and platform PCD type should not be \r
-      //         done here, but in wizard tools, But here is just following something \r
-      //         PcdEmulation driver. \r
-      //\r
-      if(parentToken.pcdType.ordinal() > Token.PCD_TYPE.FEATURE_FLAG.ordinal()) {\r
-        throw new EntityException(\r
-          String.format(\r
-            "%s:Platform PCD Type %d is not compatible with Module PCD Type %d\r\n",\r
-            parentToken.cName,\r
-            parentToken.pcdType.name(),\r
-            modulePcdType.name()\r
-            )\r
-          );\r
-      }\r
-\r
-      if(CommonDefinition.isLibraryComponent(componentType)) {\r
-          hAutogenStr += String.format(\r
-                           "extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
-                           parentToken.cName\r
-                           );\r
-          hAutogenStr += String.format(\r
-                             "#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
-                             parentToken.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
+      if(isBuildUsedLibrary) {\r
+          hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
+                                       parentToken.cName);\r
+          hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
+                                       parentToken.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
       } else {\r
-          hAutogenStr += String.format(\r
-                           "#define _PCD_VALUE_%s   %s\r\n", \r
-                           parentToken.cName, \r
-                           value.toString()\r
-                           );\r
-          hAutogenStr += String.format(\r
-                           "extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
-                           parentToken.cName\r
-                           );\r
-          cAutogenStr += String.format(\r
-                           "GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
-                           parentToken.cName,\r
-                           parentToken.cName\r
-                           );\r
-          hAutogenStr += String.format(\r
-                           "#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
-                           Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                           parentToken.cName,\r
-                           parentToken.cName\r
-                           );\r
+          hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                       parentToken.cName, \r
+                                       datum.toString());\r
+          hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
+                                       parentToken.cName);\r
+          cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
+          hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
+                                       Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
       }\r
       break;\r
     case FIXED_AT_BUILD:\r
-      //\r
-      // BUGBUG: The judegement of module PCD type and platform PCD type should not be \r
-      //         done here, but in wizard tools, But here is just following something \r
-      //         PcdEmulation driver. \r
-      //\r
-      if(parentToken.pcdType.ordinal() > Token.PCD_TYPE.FIXED_AT_BUILD.ordinal()) {\r
-        throw new EntityException(\r
-          String.format(\r
-            "%s:Platform PCD Type %d is not compatible with Module PCD Type %d\r\n",\r
-            parentToken.cName,\r
-            parentToken.pcdType.name(),\r
-            modulePcdType.name()\r
-            )\r
-          );\r
-      }\r
-\r
-      if(CommonDefinition.isLibraryComponent(componentType)) {\r
-        hAutogenStr += String.format(\r
-                         "extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
-                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
+      if(isBuildUsedLibrary) {\r
+        hAutogenStr += String.format("extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName);\r
+        hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
+                                     Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
       } else {\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_VALUE_%s   %s\r\n", \r
-                         parentToken.cName, \r
-                         value.toString()\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName\r
-                         );\r
-        cAutogenStr += String.format(\r
-                         "GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
-                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
+        hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                     parentToken.cName, \r
+                                     datum.toString());\r
+        hAutogenStr += String.format("extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName);\r
+        cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
+        hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
+                                     Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
       }\r
       break;\r
     case PATCHABLE_IN_MODULE:\r
-      //\r
-      // BUGBUG: The judegement of module PCD type and platform PCD type should not be \r
-      //         done here, but in wizard tools, But here is just following something \r
-      //         PcdEmulation driver. \r
-      //\r
-      if(parentToken.pcdType.ordinal() > Token.PCD_TYPE.PATCHABLE_IN_MODULE.ordinal()) {\r
-        throw new EntityException(\r
-          String.format(\r
-            "%s:Platform PCD Type %d is not compatible with Module PCD Type %d\r\n",\r
-            parentToken.cName,\r
-            parentToken.pcdType.name(),\r
-            modulePcdType.name()\r
-            )\r
-          );\r
-      }\r
-\r
-      if(CommonDefinition.isLibraryComponent(componentType)) {\r
-        hAutogenStr += String.format(\r
-                         "extern %s _gPcd_BinaryPatch_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
-                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
+      if(isBuildUsedLibrary) {\r
+        hAutogenStr += String.format("extern %s _gPcd_BinaryPatch_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName);\r
+        hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
+                                     Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
       } else {\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_VALUE_%s   %s\r\n", \r
-                         parentToken.cName, \r
-                         value\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "extern %s _gPcd_BinaryPatch_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName\r
-                         );\r
-        cAutogenStr += String.format(\r
-                         "GLOBAL_REMOVE_IF_UNREFERENCED %s _gPcd_BinaryPatch_%s = _PCD_VALUE_%s;\r\n",\r
-                         Token.getAutogendatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
-        hAutogenStr += String.format(\r
-                         "#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
-                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                         parentToken.cName,\r
-                         parentToken.cName\r
-                         );\r
+        hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                     parentToken.cName, \r
+                                     datum.toString());\r
+        hAutogenStr += String.format("extern %s _gPcd_BinaryPatch_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName);\r
+        cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED %s _gPcd_BinaryPatch_%s = _PCD_VALUE_%s;\r\n",\r
+                                     Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
+        hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
+                                     Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                     parentToken.cName,\r
+                                     parentToken.cName);\r
       }\r
 \r
       break;\r
     case DYNAMIC:\r
-      //\r
-      // BUGBUG: The judegement of module PCD type and platform PCD type should not be \r
-      //         done here, but in wizard tools, But here is just following something \r
-      //         PcdEmulation driver. \r
-      //\r
-      if(parentToken.pcdType.ordinal() > Token.PCD_TYPE.DYNAMIC.ordinal()) {\r
-        throw new EntityException(\r
-          String.format(\r
-            "%s:Platform PCD Type %d is not compatible with Module PCD Type %d\r\n",\r
-            parentToken.cName,\r
-            parentToken.pcdType.name(),\r
-            modulePcdType.name()\r
-            )\r
-          );\r
-      }\r
-\r
       switch(parentToken.pcdType) {\r
         case FEATURE_FLAG:\r
-          if(CommonDefinition.isLibraryComponent(componentType)) {\r
-            hAutogenStr += String.format(\r
-                             "extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
-                             parentToken.cName\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
-                             Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
+          if(isBuildUsedLibrary) {\r
+            hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
+                                         parentToken.cName);\r
+            hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
           } else {\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_VALUE_%s   %s\r\n", \r
-                             parentToken.cName, \r
-                             value\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
-                             parentToken.cName\r
-                             );\r
-            cAutogenStr += String.format(\r
-                             "const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
-                             Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
+            hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                         parentToken.cName, \r
+                                         datum.toString());\r
+            hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", \r
+                                         parentToken.cName);\r
+            cAutogenStr += String.format("const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
+            hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
           }\r
           break;\r
         case FIXED_AT_BUILD:\r
-          if(CommonDefinition.isLibraryComponent(componentType)) {\r
-            hAutogenStr += String.format(\r
-                             "extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
-                             Token.getAutogendatumTypeString(parentToken.datumType),\r
-                             parentToken.cName\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
-                             Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
+          if(isBuildUsedLibrary) {\r
+            hAutogenStr += String.format("extern const %s _gPcd_FixedAtBuild_%s;\r\n",\r
+                                         Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName);\r
+            hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_FixedAtBuild_%s\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
 \r
           } else {\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_VALUE_%s   %s\r\n", \r
-                             parentToken.cName, \r
-                             value\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "extern const %s _gPcd_FixedAtBuild_%s\r\n",\r
-                             Token.getAutogendatumTypeString(parentToken.datumType),\r
-                             parentToken.cName\r
-                             );\r
-            cAutogenStr += String.format(\r
-                             "const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
-                             Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
-            hAutogenStr += String.format(\r
-                             "#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
-                             Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                             parentToken.cName,\r
-                             parentToken.cName\r
-                             );\r
+            hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                         parentToken.cName, \r
+                                         datum.toString());\r
+            hAutogenStr += String.format("extern const %s _gPcd_FixedAtBuild_%s\r\n",\r
+                                         Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName);\r
+            cAutogenStr += String.format("const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
+            hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _PCD_VALUE_%s\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
           }\r
           break;\r
         case PATCHABLE_IN_MODULE:\r
-          hAutogenStr += String.format(\r
-                           "#define _PCD_VALUE_%s   %s\r\n", \r
-                           parentToken.cName, \r
-                           value\r
-                           );\r
-          hAutogenStr += String.format(\r
-                           "extern %s _gPcd_BinaryPatch_%s;\r\n",\r
-                           Token.getAutogendatumTypeString(parentToken.datumType),\r
-                           parentToken.cName,\r
-                           parentToken.cName\r
-                           );\r
-          cAutogenStr += String.format(\r
-                           "%s _gPcd_BinaryPatch_%s = _PCD_VALUE_%s;",\r
-                           Token.getAutogendatumTypeString(parentToken.datumType),\r
-                           parentToken.cName,\r
-                           parentToken.cName\r
-                           );\r
-          hAutogenStr += String.format(\r
-                           "#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
-                           Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                           parentToken.cName,\r
-                           parentToken.cName\r
-                           );\r
+          hAutogenStr += String.format("#define _PCD_VALUE_%s   %s\r\n", \r
+                                       parentToken.cName, \r
+                                       datum.toString());\r
+          hAutogenStr += String.format("extern %s _gPcd_BinaryPatch_%s;\r\n",\r
+                                       Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
+          cAutogenStr += String.format("%s _gPcd_BinaryPatch_%s = _PCD_VALUE_%s;",\r
+                                       Token.getAutogendatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
+          hAutogenStr += String.format("#define _PCD_MODE_%s_%s  _gPcd_BinaryPatch_%s\r\n",\r
+                                       Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       parentToken.cName);\r
           break;\r
-                       case DYNAMIC:\r
-                                       hAutogenStr += "\r\n";\r
-          hAutogenStr += String.format(\r
-                           "#define _PCD_MODE_%s_%s  LibPcdGet%s(_PCD_TOKEN_%s)\r\n",\r
-                           Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
-                           parentToken.cName,\r
-                           Token.getAutogenLibrarydatumTypeString(parentToken.datumType),\r
-                           parentToken.cName\r
-                           );\r
+      case DYNAMIC:\r
+          hAutogenStr += String.format("#define _PCD_MODE_%s_%s  LibPcdGet%s(_PCD_TOKEN_%s)\r\n",\r
+                                       Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName,\r
+                                       Token.getAutogenLibrarydatumTypeString(parentToken.datumType),\r
+                                       parentToken.cName);\r
           break;\r
-        default:\r
-         ActionMessage.log(\r
-           this, \r
-           "The PCD_TYPE setted by platform is unknown"\r
-           );\r
+      default:\r
+          throw new EntityException ("The PCD type is unknown");\r
       }\r
       break;\r
     case DYNAMIC_EX:\r
index 1e7ebfc..070c2db 100644 (file)
@@ -26,6 +26,6 @@ public class EntityException extends Exception {
       @param expStr exception message string.\r
     **/\r
     public EntityException(String expStr) {\r
-        super("[EntityException]:" + expStr);\r
+        super("[PCD EntityException]:" + expStr);\r
     }\r
 }\r
index 81eb630..661260d 100644 (file)
@@ -17,6 +17,7 @@ package org.tianocore.build.pcd.ui;
 \r
 import java.awt.*;\r
 import java.awt.event.*;\r
+import java.util.Map;\r
 \r
 import javax.swing.*;\r
 import javax.swing.tree.DefaultMutableTreeNode;\r
@@ -82,7 +83,7 @@ public class PCDDatabaseFrame extends JFrame {
     public JTree initializeTree() {\r
         Token[]                tokenArray     = null;\r
         Token                  token          = null;\r
-        DefaultMutableTreeNode root           = new DefaultMutableTreeNode(dbManager.getLogFileName());\r
+        DefaultMutableTreeNode root           = new DefaultMutableTreeNode("PCDTreeRoot");\r
         DefaultMutableTreeNode rootByPCD      = new DefaultMutableTreeNode("By PCD");\r
         DefaultMutableTreeNode rootByModule   = new DefaultMutableTreeNode("By Module");\r
         DefaultMutableTreeNode tokenNode      = null;\r
@@ -92,6 +93,7 @@ public class PCDDatabaseFrame extends JFrame {
         int                    index          = 0; \r
         int                    usageIndex     = 0;\r
         int                    moduleIndex    = 0;\r
+        Object[]               objectArray    = null;\r
         java.util.List<UsageInstance>    usageArray     = null;\r
         UsageInstance          usageInstance  = null;\r
 \r
@@ -106,17 +108,14 @@ public class PCDDatabaseFrame extends JFrame {
             ActionMessage.debug(this, token.cName);\r
             tokenNode = new DefaultMutableTreeNode(token.cName);\r
             tokenNode.add(new DefaultMutableTreeNode(String.format("TOKEN NUMBER: 0x%08x", token.tokenNumber)));\r
-            tokenNode.add(new DefaultMutableTreeNode(String.format("ASSIGNED TOKEN NUMBER: 0x%08x", token.assignedtokenNumber)));\r
             tokenNode.add(new DefaultMutableTreeNode("TOKEN SPACE NAME: " + token.tokenSpaceName.toString()));\r
-            tokenNode.add(new DefaultMutableTreeNode("ASSIGNED TOKEN SPACE NAME: " + token.assignedtokenSpaceName.toString()));\r
             tokenNode.add(new DefaultMutableTreeNode("PCD TYPE: " + Token.getStringOfpcdType(token.pcdType)));\r
             tokenNode.add(new DefaultMutableTreeNode("DATUM TYPE: " +Token.getStringOfdatumType(token.datumType)));\r
             tokenNode.add(new DefaultMutableTreeNode("DATUM: " + token.datum.toString()));\r
             tokenNode.add(new DefaultMutableTreeNode("HIIENABLE: " +(token.hiiEnabled?"true":"false")));\r
             tokenNode.add(new DefaultMutableTreeNode("VARIABLE NAME: " + token.variableName));\r
-            tokenNode.add(new DefaultMutableTreeNode("VARIABLE GUID: " + token.variableGuid.toString()));\r
+            //tokenNode.add(new DefaultMutableTreeNode("VARIABLE GUID: " + token.variableGuid.toString()));\r
             tokenNode.add(new DefaultMutableTreeNode("SKUENABLE: " +(token.skuEnabled?"true":"false")));\r
-            tokenNode.add(new DefaultMutableTreeNode("SKUDATA ARRAY ENABLE: " +(token.skuDataArrayEnabled?"true":"false")));\r
             tokenNode.add(new DefaultMutableTreeNode(String.format("SKUID: %d", token.skuId)));\r
             tokenNode.add(new DefaultMutableTreeNode(String.format("MAX SKU COUNT: %d", token.maxSkuCount)));\r
             tokenNode.add(new DefaultMutableTreeNode("VPDENABLE: " +(token.vpdEnabled?"true":"false")));\r
@@ -124,22 +123,16 @@ public class PCDDatabaseFrame extends JFrame {
             usageNode = new DefaultMutableTreeNode("PRODUCER");\r
             tokenNode.add(usageNode);\r
 \r
-            //\r
-            // Prepare producer's leaf node\r
-            //\r
-\r
-            for (usageIndex = 0; usageIndex < token.producers.size(); usageIndex ++) {\r
-                usageNode.add(new DefaultMutableTreeNode(token.producers.get(usageIndex).moduleName));\r
-            }\r
 \r
             //\r
             // Prepare consumer's leaf node\r
             //\r
             usageNode = new DefaultMutableTreeNode("CONSUMER");\r
             tokenNode.add(usageNode);\r
-\r
+            objectArray = token.consumers.entrySet().toArray();\r
             for (usageIndex = 0; usageIndex < token.consumers.size(); usageIndex ++) {\r
-                usageNode.add(new DefaultMutableTreeNode(token.consumers.get(usageIndex).moduleName));\r
+                usageInstance = (UsageInstance) ((Map.Entry)objectArray[usageIndex]).getValue();\r
+                usageNode.add(new DefaultMutableTreeNode(usageInstance.getPrimaryKey()));\r
             }\r
 \r
             rootByPCD.add(tokenNode);\r
@@ -155,14 +148,11 @@ public class PCDDatabaseFrame extends JFrame {
         }\r
         for (moduleIndex = 0; moduleIndex < moduleNames.size(); moduleIndex ++) {\r
             moduleNode = new DefaultMutableTreeNode(moduleNames.get(moduleIndex));\r
-            usageArray = dbManager.getUsageInstanceArrayByModuleName(moduleNames.get(moduleIndex));\r
+            usageArray = dbManager.getUsageInstanceArrayByKeyString(moduleNames.get(moduleIndex));\r
             for (usageIndex = 0; usageIndex < usageArray.size(); usageIndex ++) {\r
                 usageInstance = usageArray.get(usageIndex);\r
                 usageNode = new DefaultMutableTreeNode(usageInstance.parentToken.cName);\r
                 usageNode.add(new DefaultMutableTreeNode("MODULE PCD TYPE: " + Token.getStringOfpcdType(usageInstance.modulePcdType)));\r
-                usageNode.add(new DefaultMutableTreeNode("HELP TEXT: " + usageInstance.helpTextInMSA));\r
-                usageNode.add(new DefaultMutableTreeNode("IS INHERIT: " +(usageInstance.isInherit?"true":"false")));\r
-                usageNode.add(new DefaultMutableTreeNode("USAGE: " + Token.getStringOfUsage(usageInstance.usage)));\r
                 moduleNode.add(usageNode);\r
             }\r
             rootByModule.add(moduleNode);\r