]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/entity/MemoryDatabaseManager.java
1, Fix EDKT141
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / entity / MemoryDatabaseManager.java
index 2e29106323e22d13798b59462021160ccb14029d..636be3adaf201289e7dbf59f45519fa1ec7c0a3d 100644 (file)
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.UUID;\r
 \r
+import org.tianocore.build.id.ModuleIdentification;\r
 import org.tianocore.build.pcd.exception.EntityException;\r
 \r
 /** Database hold all PCD information comes from SPD, MSA, FPD file in memory.\r
@@ -38,14 +39,20 @@ public class MemoryDatabaseManager {
     /// context of building libary.\r
     /// \r
     public static List<UsageInstance> UsageInstanceContext = null;\r
+\r
     ///\r
-    /// \r
+    /// Current module name, if now is buiding library, this value indicate this library\r
+    /// is for building what module.\r
     /// \r
     public static String CurrentModuleName                 = null;\r
-    public static String PcdPeimHString       = "";\r
-    public static String PcdPeimCString       = "";\r
-    public static String PcdDxeHString        = "";\r
-    public static String PcdDxeCString        = "";\r
+\r
+    ///\r
+    /// String for PCD PEIM and DXE autogen file\r
+    /// \r
+    public static String PcdPeimHString                    = "";\r
+    public static String PcdPeimCString                    = "";\r
+    public static String PcdDxeHString                     = "";\r
+    public static String PcdDxeCString                     = "";\r
 \r
     /**\r
       Constructure function\r
@@ -151,7 +158,7 @@ public class MemoryDatabaseManager {
           The output array is sorted based on descending order of the size of alignment for each feilds.\r
 \r
       @return the token record array contained all PCD token referenced in PEI phase.\r
-     * @throws EntityException \r
+      @throws EntityException\r
     **/\r
     public void getTwoPhaseDynamicRecordArray(ArrayList<Token> pei, ArrayList<Token> dxe) \r
         throws EntityException {\r
@@ -204,7 +211,7 @@ public class MemoryDatabaseManager {
                         // We only support Dynamice(EX) type for PEI and DXE phase.\r
                         // If it is not referenced in either PEI or DXE, throw exception now.\r
                         //\r
-                        throw new EntityException("Dynamic(EX) PCD Entries are referenced in module that is not in PEI phase nor in DXE phase.");\r
+                        throw new EntityException("[PCD tool Internal Error] Dynamic(EX) PCD Entries are referenced in module that is not in PEI phase nor in DXE phase.");\r
                     }\r
                 }\r
             }\r
@@ -217,23 +224,15 @@ public class MemoryDatabaseManager {
       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
+      @param moduleId  the id of module.\r
+      @param arch      the architecture\r
       \r
       @return  all usage instance for this module in memory database.\r
     **/\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
+    public List<UsageInstance> getUsageInstanceArrayByModuleName(ModuleIdentification  moduleId,\r
+                                                                 String                arch) {\r
+\r
+        String primaryKey = UsageInstance.getPrimaryKey(moduleId, arch);\r
 \r
         return getUsageInstanceArrayByKeyString(primaryKey);\r
     }\r