public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name
@ 2018-01-23  3:34 BobCF
  2018-01-23  4:31 ` Zhu, Yonghong
  2018-01-23  8:53 ` Gao, Liming
  0 siblings, 2 replies; 3+ messages in thread
From: BobCF @ 2018-01-23  3:34 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py          | 4 ++--
 BaseTools/Source/Python/Workspace/DscBuildData.py   | 7 +++++--
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 3 +++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 604d38a4d6..ce8bc64ca5 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1749,12 +1749,12 @@ class PlatformAutoGen(AutoGen):
                             DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
                             if DefaultSku:
                                 PcdValue = DefaultSku.DefaultValue
                                 if PcdValue not in SkuValueMap:
                                     SkuValueMap[PcdValue] = []
-                                    VpdFile.Add(DscPcdEntry, 'DEFAULT',Sku.VpdOffset)
-                                SkuValueMap[PcdValue].append(Sku)
+                                    VpdFile.Add(DscPcdEntry, 'DEFAULT',DefaultSku.VpdOffset)
+                                SkuValueMap[PcdValue].append(DefaultSku)
                             for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
                                 Sku.VpdOffset = Sku.VpdOffset.strip() 
                                 
                                 # Need to iterate DEC pcd information to get the value & datumtype
                                 for eachDec in self.PackageList:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 60aa4868ed..6e4f8ac390 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1287,12 +1287,15 @@ class DscBuildData(PlatformBuildClassObject):
             CApp = CApp + '  UINT32  OriginalSize;\n'
             CApp = CApp + '  VOID    *OriginalPcd;\n'
             CApp = CApp + '  %s      *Pcd;  // From %s Line %d \n' % (Pcd.DatumType, Pcd.PkgPath, Pcd.PcdDefineLineNo)
             CApp = CApp + '\n'
 
-            Pcd.DefaultValue = Pcd.DefaultValue.strip()
-            PcdDefaultValue = StringToArray(Pcd.DefaultValue)
+            if SkuName in Pcd.SkuInfoList:
+                DefaultValue = Pcd.SkuInfoList[SkuName].DefaultStoreDict.get(DefaultStoreName,Pcd.SkuInfoList[SkuName].HiiDefaultValue) if Pcd.SkuInfoList[SkuName].HiiDefaultValue  else Pcd.SkuInfoList[SkuName].DefaultValue
+            else:
+                DefaultValue = Pcd.DefaultValue
+            PcdDefaultValue = StringToArray(DefaultValue.strip())
 
             InitByteValue += '%s.%s.%s.%s|%s|%s\n' % (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, PcdDefaultValue)
 
             #
             # Get current PCD value and size
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 7469cd7ab7..f404db7b7a 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1915,10 +1915,13 @@ class DecParser(MetaFileParser):
                 PcdTockens = self._CurrentLine.split(TAB_VALUE_SPLIT)
                 PcdNames = PcdTockens[0].split(TAB_SPLIT)
                 if len(PcdNames) == 2:
                     self._CurrentStructurePcdName = ""
                 else:
+                    if self._CurrentStructurePcdName != TAB_SPLIT.join(PcdNames[:2]):
+                        EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Name does not match: %s and %s " % (self._CurrentStructurePcdName , TAB_SPLIT.join(PcdNames[:2])),
+                                File=self.MetaFile, Line=self._LineIndex + 1)
                     self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:])
                     self._ValueList[2] = PcdTockens[1]
         if not self._CurrentStructurePcdName:
             TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
             self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
-- 
2.14.3.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name
  2018-01-23  3:34 [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name BobCF
@ 2018-01-23  4:31 ` Zhu, Yonghong
  2018-01-23  8:53 ` Gao, Liming
  1 sibling, 0 replies; 3+ messages in thread
From: Zhu, Yonghong @ 2018-01-23  4:31 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zhu, Yonghong

Hi Bob,

Please use PatchCheck.py script to check the patch, current it will report following error.

The commit message format is not valid:
 * First line of commit message (subject line) is too long.

Best Regards,
Zhu Yonghong


-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of BobCF
Sent: Tuesday, January 23, 2018 11:35 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py          | 4 ++--
 BaseTools/Source/Python/Workspace/DscBuildData.py   | 7 +++++--
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 3 +++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 604d38a4d6..ce8bc64ca5 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1749,12 +1749,12 @@ class PlatformAutoGen(AutoGen):
                             DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
                             if DefaultSku:
                                 PcdValue = DefaultSku.DefaultValue
                                 if PcdValue not in SkuValueMap:
                                     SkuValueMap[PcdValue] = []
-                                    VpdFile.Add(DscPcdEntry, 'DEFAULT',Sku.VpdOffset)
-                                SkuValueMap[PcdValue].append(Sku)
+                                    VpdFile.Add(DscPcdEntry, 'DEFAULT',DefaultSku.VpdOffset)
+                                
+ SkuValueMap[PcdValue].append(DefaultSku)
                             for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
                                 Sku.VpdOffset = Sku.VpdOffset.strip() 
                                 
                                 # Need to iterate DEC pcd information to get the value & datumtype
                                 for eachDec in self.PackageList:
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 60aa4868ed..6e4f8ac390 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1287,12 +1287,15 @@ class DscBuildData(PlatformBuildClassObject):
             CApp = CApp + '  UINT32  OriginalSize;\n'
             CApp = CApp + '  VOID    *OriginalPcd;\n'
             CApp = CApp + '  %s      *Pcd;  // From %s Line %d \n' % (Pcd.DatumType, Pcd.PkgPath, Pcd.PcdDefineLineNo)
             CApp = CApp + '\n'
 
-            Pcd.DefaultValue = Pcd.DefaultValue.strip()
-            PcdDefaultValue = StringToArray(Pcd.DefaultValue)
+            if SkuName in Pcd.SkuInfoList:
+                DefaultValue = Pcd.SkuInfoList[SkuName].DefaultStoreDict.get(DefaultStoreName,Pcd.SkuInfoList[SkuName].HiiDefaultValue) if Pcd.SkuInfoList[SkuName].HiiDefaultValue  else Pcd.SkuInfoList[SkuName].DefaultValue
+            else:
+                DefaultValue = Pcd.DefaultValue
+            PcdDefaultValue = StringToArray(DefaultValue.strip())
 
             InitByteValue += '%s.%s.%s.%s|%s|%s\n' % (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, PcdDefaultValue)
 
             #
             # Get current PCD value and size diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 7469cd7ab7..f404db7b7a 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -1915,10 +1915,13 @@ class DecParser(MetaFileParser):
                 PcdTockens = self._CurrentLine.split(TAB_VALUE_SPLIT)
                 PcdNames = PcdTockens[0].split(TAB_SPLIT)
                 if len(PcdNames) == 2:
                     self._CurrentStructurePcdName = ""
                 else:
+                    if self._CurrentStructurePcdName != TAB_SPLIT.join(PcdNames[:2]):
+                        EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Name does not match: %s and %s " % (self._CurrentStructurePcdName , TAB_SPLIT.join(PcdNames[:2])),
+                                File=self.MetaFile, 
+ Line=self._LineIndex + 1)
                     self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:])
                     self._ValueList[2] = PcdTockens[1]
         if not self._CurrentStructurePcdName:
             TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
             self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
--
2.14.3.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name
  2018-01-23  3:34 [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name BobCF
  2018-01-23  4:31 ` Zhu, Yonghong
@ 2018-01-23  8:53 ` Gao, Liming
  1 sibling, 0 replies; 3+ messages in thread
From: Gao, Liming @ 2018-01-23  8:53 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org

Bob:
  Patch title is < 80. Please move the information in the commit message. 

>-----Original Message-----
>From: Feng, Bob C
>Sent: Tuesday, January 23, 2018 11:35 AM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fixed some small issues 1. The structure pcd
>default value should use the default value under sku. 2. Incorrect VpdOffset
>value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd
>Name
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py          | 4 ++--
> BaseTools/Source/Python/Workspace/DscBuildData.py   | 7 +++++--
> BaseTools/Source/Python/Workspace/MetaFileParser.py | 3 +++
> 3 files changed, 10 insertions(+), 4 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 604d38a4d6..ce8bc64ca5 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -1749,12 +1749,12 @@ class PlatformAutoGen(AutoGen):
>                             DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT')
>                             if DefaultSku:
>                                 PcdValue = DefaultSku.DefaultValue
>                                 if PcdValue not in SkuValueMap:
>                                     SkuValueMap[PcdValue] = []
>-                                    VpdFile.Add(DscPcdEntry, 'DEFAULT',Sku.VpdOffset)
>-                                SkuValueMap[PcdValue].append(Sku)
>+                                    VpdFile.Add(DscPcdEntry,
>'DEFAULT',DefaultSku.VpdOffset)
>+                                SkuValueMap[PcdValue].append(DefaultSku)
>                             for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
>                                 Sku.VpdOffset = Sku.VpdOffset.strip()
>
>                                 # Need to iterate DEC pcd information to get the value &
>datumtype
>                                 for eachDec in self.PackageList:
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 60aa4868ed..6e4f8ac390 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1287,12 +1287,15 @@ class DscBuildData(PlatformBuildClassObject):
>             CApp = CApp + '  UINT32  OriginalSize;\n'
>             CApp = CApp + '  VOID    *OriginalPcd;\n'
>             CApp = CApp + '  %s      *Pcd;  // From %s Line %d \n' % (Pcd.DatumType,
>Pcd.PkgPath, Pcd.PcdDefineLineNo)
>             CApp = CApp + '\n'
>
>-            Pcd.DefaultValue = Pcd.DefaultValue.strip()
>-            PcdDefaultValue = StringToArray(Pcd.DefaultValue)
>+            if SkuName in Pcd.SkuInfoList:
>+                DefaultValue =
>Pcd.SkuInfoList[SkuName].DefaultStoreDict.get(DefaultStoreName,Pcd.SkuIn
>foList[SkuName].HiiDefaultValue) if
>Pcd.SkuInfoList[SkuName].HiiDefaultValue  else
>Pcd.SkuInfoList[SkuName].DefaultValue
>+            else:
>+                DefaultValue = Pcd.DefaultValue
>+            PcdDefaultValue = StringToArray(DefaultValue.strip())
>
>             InitByteValue += '%s.%s.%s.%s|%s|%s\n' % (SkuName,
>DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName,
>Pcd.DatumType, PcdDefaultValue)
>
>             #
>             # Get current PCD value and size
>diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py
>b/BaseTools/Source/Python/Workspace/MetaFileParser.py
>index 7469cd7ab7..f404db7b7a 100644
>--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
>+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
>@@ -1915,10 +1915,13 @@ class DecParser(MetaFileParser):
>                 PcdTockens = self._CurrentLine.split(TAB_VALUE_SPLIT)
>                 PcdNames = PcdTockens[0].split(TAB_SPLIT)
>                 if len(PcdNames) == 2:
>                     self._CurrentStructurePcdName = ""
>                 else:
>+                    if self._CurrentStructurePcdName !=
>TAB_SPLIT.join(PcdNames[:2]):
>+                        EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Name does
>not match: %s and %s " % (self._CurrentStructurePcdName ,
>TAB_SPLIT.join(PcdNames[:2])),
>+                                File=self.MetaFile, Line=self._LineIndex + 1)
>                     self._ValueList[1] = TAB_SPLIT.join(PcdNames[2:])
>                     self._ValueList[2] = PcdTockens[1]
>         if not self._CurrentStructurePcdName:
>             TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT, 1)
>             self._ValueList[0:1] = GetSplitValueList(TokenList[0], TAB_SPLIT)
>--
>2.14.3.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-23  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  3:34 [Patch] BaseTools: Fixed some small issues 1. The structure pcd default value should use the default value under sku. 2. Incorrect VpdOffset value for those un-used in module Vpd 3. Add a checkpoint for Structure Pcd Name BobCF
2018-01-23  4:31 ` Zhu, Yonghong
2018-01-23  8:53 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox