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
/// 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
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
}\r
\r
if (!found) {\r
- //\r
- // 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
+ if (token.isDynamicPCD && token.consumers.size() == 0) {\r
+ dxe.add(token);\r
+ } else {\r
+ //\r
+ // 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("[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
}\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
+ @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