From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Enhance the *P Flag display for Structure Pcd
Date: Fri, 12 Oct 2018 13:32:27 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3393F2@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1539241576-10044-1-git-send-email-yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhu, Yonghong
> Sent: Thursday, October 11, 2018 3:06 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch] BaseTools: Enhance the *P Flag display for Structure Pcd
>
> Cover the case:
> 1.only define the structure Pcd in DEC file, it should not have any
> Flag.
> 2.In the DEC file and DSC file only have the PCD's default value, and
> without the field value, it should have *P Flag.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
> BaseTools/Source/Python/build/BuildReport.py | 66 ++++++++++++++++------------
> 1 file changed, 39 insertions(+), 27 deletions(-)
>
> diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
> index feaf6a5..031594b 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1071,41 +1071,52 @@ class PcdReport(object):
> if Pcd.PcdFieldValueFromComm:
> BuildOptionMatch = True
> DecMatch = False
> elif Pcd.SkuOverrideValues:
> DscOverride = False
> - if not Pcd.SkuInfoList:
> - OverrideValues = Pcd.SkuOverrideValues
> - if OverrideValues:
> - Keys = list(OverrideValues.keys())
> - Data = OverrideValues[Keys[0]]
> - Struct = list(Data.values())[0]
> - DscOverride = self.ParseStruct(Struct)
> + if Pcd.DefaultFromDSC:
> + DscOverride = True
> else:
> - SkuList = sorted(Pcd.SkuInfoList.keys())
> - for Sku in SkuList:
> - SkuInfo = Pcd.SkuInfoList[Sku]
> - if TypeName in ('DYNHII', 'DEXHII'):
> - if SkuInfo.DefaultStoreDict:
> - DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
> - for DefaultStore in DefaultStoreList:
> - OverrideValues = Pcd.SkuOverrideValues[Sku]
> - DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
> - if DscOverride:
> - break
> - else:
> - OverrideValues = Pcd.SkuOverrideValues[Sku]
> + DictLen = 0
> + for item in Pcd.SkuOverrideValues:
> + DictLen += len(Pcd.SkuOverrideValues[item])
> + if not DictLen:
> + DscOverride = False
> + else:
> + if not Pcd.SkuInfoList:
> + OverrideValues = Pcd.SkuOverrideValues
> if OverrideValues:
> Keys = list(OverrideValues.keys())
> - OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
> - DscOverride = self.ParseStruct(OverrideFieldStruct)
> - if DscOverride:
> - break
> + Data = OverrideValues[Keys[0]]
> + Struct = list(Data.values())
> + DscOverride = self.ParseStruct(Struct[0])
> + else:
> + SkuList = sorted(Pcd.SkuInfoList.keys())
> + for Sku in SkuList:
> + SkuInfo = Pcd.SkuInfoList[Sku]
> + if TypeName in ('DYNHII', 'DEXHII'):
> + if SkuInfo.DefaultStoreDict:
> + DefaultStoreList = sorted(SkuInfo.DefaultStoreDict.keys())
> + for DefaultStore in DefaultStoreList:
> + OverrideValues = Pcd.SkuOverrideValues[Sku]
> + DscOverride = self.ParseStruct(OverrideValues[DefaultStore])
> + if DscOverride:
> + break
> + else:
> + OverrideValues = Pcd.SkuOverrideValues[Sku]
> + if OverrideValues:
> + Keys = list(OverrideValues.keys())
> + OverrideFieldStruct = self.OverrideFieldValue(Pcd, OverrideValues[Keys[0]])
> + DscOverride = self.ParseStruct(OverrideFieldStruct)
> + if DscOverride:
> + break
> if DscOverride:
> DscDefaultValue = True
> DscMatch = True
> DecMatch = False
> + else:
> + DecMatch = True
> else:
> DscDefaultValue = True
> DscMatch = True
> DecMatch = False
>
> @@ -1250,13 +1261,14 @@ class PcdReport(object):
> if IsStructure:
> OverrideValues = Pcd.SkuOverrideValues
> if OverrideValues:
> Keys = list(OverrideValues.keys())
> Data = OverrideValues[Keys[0]]
> - Struct = list(Data.values())[0]
> - OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct)
> - self.PrintStructureInfo(File, OverrideFieldStruct)
> + Struct = list(Data.values())
> + if Struct:
> + OverrideFieldStruct = self.OverrideFieldValue(Pcd, Struct[0])
> + self.PrintStructureInfo(File, OverrideFieldStruct)
> self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch,
> DecDefaultValue)
> else:
> FirstPrint = True
> SkuList = sorted(Pcd.SkuInfoList.keys())
> for Sku in SkuList:
> --
> 2.6.1.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
prev parent reply other threads:[~2018-10-12 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 7:06 [Patch] BaseTools: Enhance the *P Flag display for Structure Pcd Yonghong Zhu
2018-10-12 13:32 ` Gao, Liming [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E3393F2@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox