]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java
Change the macro for dynamicEx type PCD and modify autogen tools to auto generate...
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / entity / UsageInstance.java
index 378f26f4b0af0fd79305c3f9b5477ca28ca586b5..40dd3b945403e14c68d93672970c892b52dc5608 100644 (file)
@@ -30,288 +30,326 @@ import org.tianocore.build.pcd.exception.EntityException;
   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
-  ///\r
-  /// This parent that this usage instance belongs to.\r
-  ///\r
-  public Token            parentToken;\r
-\r
-  ///\r
-  /// The name of the module who contains this PCD.\r
-  ///\r
-  public String           moduleName;\r
-\r
-  ///\r
-  /// The GUID of the module who contains this PCD. \r
-  /// \r
-  public UUID             moduleGUID;\r
-\r
-  ///\r
-  /// The name of the package whose module contains this PCD.\r
-  ///\r
-  public String           packageName;\r
-\r
-  ///\r
-  /// The GUID of the package whose module contains this PCD.\r
-  /// \r
-  public UUID             packageGUID;\r
-\r
-  ///\r
-  /// The PCD type defined for module \r
-  /// \r
-  public Token.PCD_TYPE   modulePcdType;\r
-\r
-  ///\r
-  /// The arch string of module contains this PCD\r
-  ///\r
-  public String           arch;\r
-\r
-  ///\r
-  /// The version of module contains this PCD\r
-  /// \r
-  public String           version;\r
-\r
-  ///\r
-  /// The module type for this usage instance.\r
-  ///\r
-  public MODULE_TYPE      moduleType;\r
-\r
-  ///\r
-  /// The value of the PCD in this usage instance. \r
-  /// \r
-  public String           datum;\r
-\r
-  ///\r
-  /// The maxDatumSize could be different for same PCD in different module\r
-  /// But this case is allow for FeatureFlag, FixedAtBuild, PatchableInModule\r
-  /// type.\r
-  /// \r
-  public int              maxDatumSize;\r
-\r
-  ///\r
-  /// Autogen string for header file.\r
-  ///\r
-  public String           hAutogenStr;\r
-\r
-  ///\r
-  /// Auotgen string for C code file.\r
-  /// \r
-  public String           cAutogenStr;\r
-\r
-  /**\r
-     Constructure function\r
-     \r
-     @param parentToken         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
-     @param maxDatumSize        Member variable.\r
-   */\r
-  public UsageInstance (Token             parentToken,\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
-                        String            value,\r
-                        int               maxDatumSize) {\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.maxDatumSize     = maxDatumSize;\r
-  }\r
-\r
-  /**\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 String getPrimaryKey() {\r
-      return UsageInstance.getPrimaryKey(moduleName, moduleGUID, packageName, packageGUID, arch, version);\r
-  }\r
-\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
-  /**\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
+    ///\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
+    ///\r
+    /// This parent that this usage instance belongs to.\r
+    ///\r
+    public Token            parentToken;\r
+\r
+    ///\r
+    /// The name of the module who contains this PCD.\r
+    ///\r
+    public String           moduleName;\r
+\r
+    ///\r
+    /// The GUID of the module who contains this PCD. \r
+    /// \r
+    public UUID             moduleGUID;\r
+\r
+    ///\r
+    /// The name of the package whose module contains this PCD.\r
+    ///\r
+    public String           packageName;\r
+\r
+    ///\r
+    /// The GUID of the package whose module contains this PCD.\r
+    /// \r
+    public UUID             packageGUID;\r
+\r
+    ///\r
+    /// The PCD type defined for module \r
+    /// \r
+    public Token.PCD_TYPE   modulePcdType;\r
+\r
+    ///\r
+    /// The arch string of module contains this PCD\r
+    ///\r
+    public String           arch;\r
+\r
+    ///\r
+    /// The version of module contains this PCD\r
+    /// \r
+    public String           version;\r
+\r
+    ///\r
+    /// The module type for this usage instance.\r
+    ///\r
+    public MODULE_TYPE      moduleType;\r
+\r
+    ///\r
+    /// The value of the PCD in this usage instance. \r
+    /// \r
+    public String           datum;\r
+\r
+    ///\r
+    /// The maxDatumSize could be different for same PCD in different module\r
+    /// But this case is allow for FeatureFlag, FixedAtBuild, PatchableInModule\r
+    /// type.\r
+    /// \r
+    public int              maxDatumSize;\r
+\r
+    ///\r
+    /// Autogen string for header file.\r
+    ///\r
+    public String           hAutogenStr;\r
+\r
+    ///\r
+    /// Auotgen string for C code file.\r
+    /// \r
+    public String           cAutogenStr;\r
+\r
+    /**\r
+       Constructure function\r
+       \r
+       @param parentToken         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
+       @param maxDatumSize        Member variable.\r
+     */\r
+    public UsageInstance (Token             parentToken,\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
+                          String            value,\r
+                          int               maxDatumSize) {\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.maxDatumSize     = maxDatumSize;\r
+    }\r
+\r
+    /**\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 String getPrimaryKey() {\r
+        return UsageInstance.getPrimaryKey(moduleName, moduleGUID, packageName, packageGUID, arch, version);\r
+    }\r
+\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
+    /**\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
+        String guidStringArray[] = null;\r
+        String guidString        = null;\r
+\r
+        hAutogenStr = "";\r
+        cAutogenStr = "";\r
+\r
+        if (this.modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {\r
+            hAutogenStr += String.format("#define _PCD_LOCAL_TOKEN_%s   0x%016x\r\n", \r
+                                         parentToken.cName, parentToken.tokenNumber);\r
+            hAutogenStr += String.format("#define _PCD_TOKEN_%s   0x%016x\r\n", \r
+                                         parentToken.cName, parentToken.dynamicExTokenNumber);\r
+        } else {\r
+            hAutogenStr += String.format("#define _PCD_TOKEN_%s   0x%016x\r\n", \r
+                                         parentToken.cName, parentToken.tokenNumber);\r
+        }\r
+\r
+        switch (modulePcdType) {\r
+        case FEATURE_FLAG:\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("#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
+            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("#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
+            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("#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
+            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
+        case DYNAMIC_EX:\r
+            guidStringArray = parentToken.tokenSpaceName.toString().split("-");\r
+            guidString      = 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
+                                            guidStringArray[0],\r
+                                            guidStringArray[1],\r
+                                            guidStringArray[2],\r
+                                            (guidStringArray[3].substring(0, 2)),\r
+                                            (guidStringArray[3].substring(2, 4)),\r
+                                            (guidStringArray[4].substring(0, 2)),\r
+                                            (guidStringArray[4].substring(2, 4)),\r
+                                            (guidStringArray[4].substring(4, 6)),\r
+                                            (guidStringArray[4].substring(6, 8)),\r
+                                            (guidStringArray[4].substring(8, 10)),\r
+                                            (guidStringArray[4].substring(10, 12)));\r
+                                            \r
+            hAutogenStr += String.format("extern EFI_GUID _gPcd_DynamicEx_TokenSpaceGuid_%s;\r\n",\r
+                                         parentToken.cName);\r
+            hAutogenStr += String.format("#define _PCD_MODE_%s_%s LibPcdGet%s(_PCD_LOCAL_TOKEN_%s)\r\n",\r
+                                         Token.GetAutogenDefinedatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         Token.getAutogenLibrarydatumTypeString(parentToken.datumType),\r
+                                         parentToken.cName,\r
+                                         parentToken.cName);\r
+\r
+            if (!isBuildUsedLibrary) {\r
+                cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID _gPcd_DynamicEx_TokenSpaceGuid_%s = %s;\r\n",\r
+                                             parentToken.cName,\r
+                                             guidString);\r
+            }\r
+            break;\r
+        }\r
+    }\r
+\r
+    /**\r
+      Get the autogen string for header file.\r
+      \r
+      @return The string of header file.\r
+    **/\r
+    public String getHAutogenStr() {\r
+        return hAutogenStr;\r
+    }\r
 \r
-    hAutogenStr = "";\r
-    cAutogenStr = "";\r
-\r
-    hAutogenStr += String.format("#define _PCD_TOKEN_%s   0x%016x\r\n", \r
-                                 parentToken.cName, parentToken.tokenNumber);\r
-    switch(modulePcdType) {\r
-    case FEATURE_FLAG:\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("#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
-      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("#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
-      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("#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
-       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
-    case DYNAMIC_EX:\r
-      break;\r
+    /**\r
+      Get the autogen string for C code file.\r
+      \r
+      @return The string of C Code file.\r
+    **/\r
+    public String getCAutogenStr() {\r
+        return cAutogenStr;\r
     }\r
-  }\r
-\r
-  /**\r
-    Get the autogen string for header file.\r
-    \r
-    @return The string of header file.\r
-  **/\r
-  public String getHAutogenStr() {\r
-    return hAutogenStr;\r
-  }\r
-\r
-  /**\r
-    Get the autogen string for C code file.\r
-    \r
-    @return The string of C Code file.\r
-  **/\r
-  public String getCAutogenStr() {\r
-    return cAutogenStr;\r
-  }\r
 }\r
 \r