[edk2] [Patch] BaseTools: Fix two cases that use GUID CName as PCD Value

Yonghong Zhu posted 1 patch 6 years ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/AutoGen/AutoGen.py        | 9 +++------
BaseTools/Source/Python/Workspace/InfBuildData.py | 1 +
2 files changed, 4 insertions(+), 6 deletions(-)
[edk2] [Patch] BaseTools: Fix two cases that use GUID CName as PCD Value
Posted by Yonghong Zhu 6 years ago
1. use CName format in components section:
  [Components]
   TestPkg/TestDriver.inf {
     <PcdsFixedAtBuild>
      PcdToken.PcdName |{GUID(TestGuid)}|VOID*|16
  }

2. Use Guid CName format in INF and the Guid is defined in the DEC
file but not write in driver's [Guids] section.
    PcdToken.PcdName  | {GUID(TestGuid)}

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py        | 9 +++------
 BaseTools/Source/Python/Workspace/InfBuildData.py | 1 +
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 95e3e91..0057839 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -395,16 +395,12 @@ class WorkspaceAutoGen(AutoGen):
                 self.CapTargetList = []
 
         # apply SKU and inject PCDs from Flash Definition file
         for Arch in self.ArchList:
             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
-
-
-
-
-
-
+            PlatformPcds = Platform.Pcds
+            self._GuidDict = Platform._GuidDict
             SourcePcdDict = {'DynamicEx':[], 'PatchableInModule':[],'Dynamic':[],'FixedAtBuild':[]}
             BinaryPcdDict = {'DynamicEx':[], 'PatchableInModule':[]}
             SourcePcdDict_Keys = SourcePcdDict.keys()
             BinaryPcdDict_Keys = BinaryPcdDict.keys()
 
@@ -2797,10 +2793,11 @@ class ModuleAutoGen(AutoGen):
         EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" % (ModuleFile, Arch))
         GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch, Toolchain, Target)
 
         self.Workspace = Workspace
         self.WorkspaceDir = Workspace.WorkspaceDir
+        self._GuidDict = Workspace._GuidDict
 
         self.MetaFile = ModuleFile
         self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target, Toolchain, Arch)
         # check if this module is employed by active platform
         if not self.PlatformInfo.ValidModule(self.MetaFile):
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 7ea9b56..7e1b8ba 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -1054,10 +1054,11 @@ class InfBuildData(ModuleBuildClassObject):
                 # if platform doesn't give its type, use 'lowest' one in the
                 # following order, if any
                 #
                 #   "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"
                 #
+                self.Guids.update(Package.Guids)
                 PcdType = self._PCD_TYPE_STRING_[Type]
                 if Type == MODEL_PCD_DYNAMIC:
                     Pcd.Pending = True
                     for T in ["FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic", "DynamicEx"]:
                         if (PcdRealName, TokenSpaceGuid) in GlobalData.MixedPcd:
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] BaseTools: Fix two cases that use GUID CName as PCD Value
Posted by Gao, Liming 6 years ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Yonghong Zhu
>Sent: Wednesday, March 28, 2018 8:43 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Fix two cases that use GUID CName as PCD
>Value
>
>1. use CName format in components section:
>  [Components]
>   TestPkg/TestDriver.inf {
>     <PcdsFixedAtBuild>
>      PcdToken.PcdName |{GUID(TestGuid)}|VOID*|16
>  }
>
>2. Use Guid CName format in INF and the Guid is defined in the DEC
>file but not write in driver's [Guids] section.
>    PcdToken.PcdName  | {GUID(TestGuid)}
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py        | 9 +++------
> BaseTools/Source/Python/Workspace/InfBuildData.py | 1 +
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 95e3e91..0057839 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -395,16 +395,12 @@ class WorkspaceAutoGen(AutoGen):
>                 self.CapTargetList = []
>
>         # apply SKU and inject PCDs from Flash Definition file
>         for Arch in self.ArchList:
>             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
>-
>-
>-
>-
>-
>-
>+            PlatformPcds = Platform.Pcds
>+            self._GuidDict = Platform._GuidDict
>             SourcePcdDict = {'DynamicEx':[],
>'PatchableInModule':[],'Dynamic':[],'FixedAtBuild':[]}
>             BinaryPcdDict = {'DynamicEx':[], 'PatchableInModule':[]}
>             SourcePcdDict_Keys = SourcePcdDict.keys()
>             BinaryPcdDict_Keys = BinaryPcdDict.keys()
>
>@@ -2797,10 +2793,11 @@ class ModuleAutoGen(AutoGen):
>         EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" %
>(ModuleFile, Arch))
>         GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch,
>Toolchain, Target)
>
>         self.Workspace = Workspace
>         self.WorkspaceDir = Workspace.WorkspaceDir
>+        self._GuidDict = Workspace._GuidDict
>
>         self.MetaFile = ModuleFile
>         self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target,
>Toolchain, Arch)
>         # check if this module is employed by active platform
>         if not self.PlatformInfo.ValidModule(self.MetaFile):
>diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py
>b/BaseTools/Source/Python/Workspace/InfBuildData.py
>index 7ea9b56..7e1b8ba 100644
>--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
>@@ -1054,10 +1054,11 @@ class InfBuildData(ModuleBuildClassObject):
>                 # if platform doesn't give its type, use 'lowest' one in the
>                 # following order, if any
>                 #
>                 #   "FixedAtBuild", "PatchableInModule", "FeatureFlag", "Dynamic",
>"DynamicEx"
>                 #
>+                self.Guids.update(Package.Guids)
>                 PcdType = self._PCD_TYPE_STRING_[Type]
>                 if Type == MODEL_PCD_DYNAMIC:
>                     Pcd.Pending = True
>                     for T in ["FixedAtBuild", "PatchableInModule", "FeatureFlag",
>"Dynamic", "DynamicEx"]:
>                         if (PcdRealName, TokenSpaceGuid) in GlobalData.MixedPcd:
>--
>2.6.1.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel