[edk2] [Patch 3/3] DscSpecification: Add structure PCD field value assignment syntax

Liming Gao posted 3 patches 6 years, 9 months ago
[edk2] [Patch 3/3] DscSpecification: Add structure PCD field value assignment syntax
Posted by Liming Gao 6 years, 9 months ago
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
---
 2_dsc_overview/28_pcd_section_processing.md           | 10 ++++++----
 3_edk_ii_dsc_file_format/310_pcd_sections.md          | 19 +++++++++++--------
 .../33_platform_dsc_definition.md                     |  6 +++++-
 3 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/2_dsc_overview/28_pcd_section_processing.md b/2_dsc_overview/28_pcd_section_processing.md
index 1adde81..4c5d952 100644
--- a/2_dsc_overview/28_pcd_section_processing.md
+++ b/2_dsc_overview/28_pcd_section_processing.md
@@ -1,7 +1,7 @@
 <!--- @file
   2.8 PCD Section Processing
 
-  Copyright (c) 2006-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006-2018, Intel Corporation. All rights reserved.<BR>
 
   Redistribution and use in source (original document form) and 'compiled'
   forms (converted to PDF, epub, HTML and other formats) with or without
@@ -283,8 +283,9 @@ Unique PCDs are identified using the format to identify the named PCD:
 `TokenSpaceGuidCName.PcdCName`
 
 The content for a PCD in this section is the PCD's Name (PCD Token Space Guid
-C name, the PCD C name - separated by a period character,) and Default value.
-Field entries on a line are separated by the pipe "|" character.
+C name, the PCD C name and the optional field name - separated by a period 
+character) and Default value. Field entries on a line are separated by the 
+pipe "|" character.
 
 This specification prohibits setting different PCD access methods for a single
 PCD in different modules. The access methods here are `PcdsFixedAtBuild`,
@@ -373,7 +374,8 @@ prohibited in this type of platform description file.
 **Note:** PCD values within a section are positional, (last wins) if a PCD is
 listed more than one time within a section. List a PCD in one of the other
 access methods is allowed, provided a single access method must be used for all
-instances of the PCD.
+instances of the PCD. If PCD field value is listed, it will override PCD value 
+even if PCD value is after PCD field value.
 **********
 
 #### 2.8.3.9 Library Instances
diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md b/3_edk_ii_dsc_file_format/310_pcd_sections.md
index f79a0fd..4eaa15c 100644
--- a/3_edk_ii_dsc_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md
@@ -107,6 +107,9 @@ value. If not provided, the maximum length will be calculated as the largest of
 the size of the data in the DSC file, the size of the data in the INF file or
 the size of the data in the DEC file that declares the PCD.
 
+PCDs with a C strucutre type is also a VOID* PCD. Its value can be specified like
+normal VOID* PCD, and also be specified by its structure field.
+
 Refer to the _EDK II Build Specification_ for the description of the PCD
 processing rules.
 
@@ -218,7 +221,7 @@ fields that are separated by the pipe character, "|".
 <SkuIdS>        ::= <Keyword> [<FS> <Keyword>]*
 <Keyword>       ::= <UiName>
 <UiName>        ::= <Word>
-<FabStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>}
+<FabStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>} {<PcdFieldEntry>}
 <PcdEntry>      ::= <TS> <PcdName> [<FS> <PcdValue>] <EOL>
 <PcdValue>      ::= if (pcddatumtype == "BOOLEAN"):
                       {<BoolType>} {<Expression>}
@@ -326,7 +329,7 @@ of the DSC file.
 <SkuIdS>        ::= <Keyword> [<FS> <Keyword>]*
 <Keyword>       ::= <UiName>
 <UiName>        ::= <Word>
-<PimStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>}
+<PimStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>} {<PcdFieldEntry>}
 <PcdEntry>      ::= <TS> <PcdName> [<FS> <PcdValue>] <EOL>
 <PcdValue>      ::= if (pcddatumtype == "BOOLEAN"):
                       {<BoolType>} {<Expression>}
@@ -449,16 +452,16 @@ sections of the DSC file.
 <PcdsDefault>    ::= "[PcdsDynamicDefault" [<PddAttribs>] "]" <EOL>
                      <PddEntries>*
 <PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>}
-                     {<TS> <MinEntry>}
+                     {<TS> <MinEntry>} {<TS> <PcdFieldEntry>}
 <PddAttribs>     ::= <attrs> ["," <TS> "PcdsDynamicDefault" <attrs>]*
 <PcdsVpd>        ::= "[PcdsDynamicVpd" [<PdvAttribs>] "]" <EOL>
                      <PdvEntries>*
 <PdvAttribs>     ::= <attrs> [ "," <TS> "PcdsDynamicVpd" <attrs>]*
-<PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <VpdEntry>}
+<PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <VpdEntry>} {<TS> <PcdFieldEntry>}
 <PcdsHii>        ::= "[PcdsDynamicHii" [<PdhAttribs>] "]" <EOL>
                      <PcdHiiEntries>*
 <PdhAttribs>     ::= <phattrs> ["," <TS> "PcdsDynamicHii <phattrs>]* <PdvEntries>*
-<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>}
+<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>} {<TS> <PcdFieldEntry>}
 <attrs>          ::= "." <arch> ["." <SkuIds>]
 <phattrs>        ::= "." <arch> ["." <SkuIds>]["." <DefaultStore>]
 <SkuIdS>         ::= <Keyword> [<FS> <Keyword>]*
@@ -662,18 +665,18 @@ sections of the DSC file.
 <Pcds>           ::= {<PcdsExDefault>} {<PcdsExVpd>} {<PcdsExHii>}
 <PcdsExDefault>  ::= "[PcdsDynamicExDefault" [<PddAttribs>] "]" <EOL>
                      <PddEntries>*
-<PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <MinEntry>}
+<PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <MinEntry>} {<TS> <PcdFieldEntry>}
 <PddAttribs>     ::= <attrs> ["," <TS> "PcdsDynamicExDefault" <attrs>]*
 <PcdsExVpd>      ::= "[PcdsDynamicExVpd" [<PdvAttribs>] "]" <EOL>
                      <PdvEntries>*
 <PdvAttribs>     ::= <attrs> [ "," <TS> "PcdsDynamicExVpd" <attrs>]*
 <PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>}
-                     {<TS> <VpdEntry>}
+                     {<TS> <VpdEntry>} {<TS> <PcdFieldEntry>}
 <PcdsExHii>      ::= "[PcdsDynamicExHii" [<PdhAttribs>] "]" <EOL>
                      <PcdHiiEntries>*
 <PdhAttribs>     ::= <phattrs> ["," <TS> "PcdsDynamicExHii <phattrs>]*
                      <PdvEntries>*
-<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>}
+<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>} {<TS> <PcdFieldEntry>}
 <attrs>          ::= "." <arch> ["." <SkuIds>]
 <phattrs>        ::= "." <arch> ["." <SkuIds>]["." <DefaultStore>]
 <SkuIdS>         ::= <Keyword> [<FS> <Keyword>]*
diff --git a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
index 5b1c0d4..313fc20 100644
--- a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
+++ b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.3 Platform DSC Definition
 
-  Copyright (c) 2006-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006-2018, Intel Corporation. All rights reserved.<BR>
 
   Redistribution and use in source (original document form) and 'compiled'
   forms (converted to PDF, epub, HTML and other formats) with or without
@@ -192,9 +192,13 @@ The following are common definitions used by multiple section types.
 <BoolType>             ::= {<BoolVal>} {"{"<BoolVal>"}"}
 <MACRO>                ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>             ::= "$(" <MACRO> ")"
+<PcdFieldName>         ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
 <PcdName>              ::= <TokenSpaceGuidCName> "." <PcdCName>
 <PcdCName>             ::= <CName>
 <TokenSpaceGuidCName>  ::= <CName>
+<Field>                ::= <CName>
+<PcdFieldEntry>        ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
+<PcdFieldValue>        ::= {<BoolType>} {<NumValUint8>} {<NumValUint16>} {<NumValUint32>} {<NumValUint64>} {<StringVal>} {<MACROVAL>} {<Expression>}
 <PCDVAL>               ::= "PCD(" <PcdName> ")"
 <UINT8>                ::= {"0x"} {"0X"} (\x0 - \xFF)
 <UINT16>               ::= {"0x"} {"0X"} (\x0 - \xFFFF)
-- 
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch 3/3] DscSpecification: Add structure PCD field value assignment syntax
Posted by Zhu, Yonghong 6 years, 9 months ago
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> 

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Gao, Liming 
Sent: Friday, March 16, 2018 12:42 PM
To: edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: [Patch 3/3] DscSpecification: Add structure PCD field value assignment syntax

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
---
 2_dsc_overview/28_pcd_section_processing.md           | 10 ++++++----
 3_edk_ii_dsc_file_format/310_pcd_sections.md          | 19 +++++++++++--------
 .../33_platform_dsc_definition.md                     |  6 +++++-
 3 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/2_dsc_overview/28_pcd_section_processing.md b/2_dsc_overview/28_pcd_section_processing.md
index 1adde81..4c5d952 100644
--- a/2_dsc_overview/28_pcd_section_processing.md
+++ b/2_dsc_overview/28_pcd_section_processing.md
@@ -1,7 +1,7 @@
 <!--- @file
   2.8 PCD Section Processing
 
-  Copyright (c) 2006-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006-2018, Intel Corporation. All rights reserved.<BR>
 
   Redistribution and use in source (original document form) and 'compiled'
   forms (converted to PDF, epub, HTML and other formats) with or without @@ -283,8 +283,9 @@ Unique PCDs are identified using the format to identify the named PCD:
 `TokenSpaceGuidCName.PcdCName`
 
 The content for a PCD in this section is the PCD's Name (PCD Token Space Guid -C name, the PCD C name - separated by a period character,) and Default value.
-Field entries on a line are separated by the pipe "|" character.
+C name, the PCD C name and the optional field name - separated by a 
+period
+character) and Default value. Field entries on a line are separated by 
+the pipe "|" character.
 
 This specification prohibits setting different PCD access methods for a single  PCD in different modules. The access methods here are `PcdsFixedAtBuild`, @@ -373,7 +374,8 @@ prohibited in this type of platform description file.
 **Note:** PCD values within a section are positional, (last wins) if a PCD is  listed more than one time within a section. List a PCD in one of the other  access methods is allowed, provided a single access method must be used for all -instances of the PCD.
+instances of the PCD. If PCD field value is listed, it will override 
+PCD value even if PCD value is after PCD field value.
 **********
 
 #### 2.8.3.9 Library Instances
diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md b/3_edk_ii_dsc_file_format/310_pcd_sections.md
index f79a0fd..4eaa15c 100644
--- a/3_edk_ii_dsc_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md
@@ -107,6 +107,9 @@ value. If not provided, the maximum length will be calculated as the largest of  the size of the data in the DSC file, the size of the data in the INF file or  the size of the data in the DEC file that declares the PCD.
 
+PCDs with a C strucutre type is also a VOID* PCD. Its value can be 
+specified like normal VOID* PCD, and also be specified by its structure field.
+
 Refer to the _EDK II Build Specification_ for the description of the PCD  processing rules.
 
@@ -218,7 +221,7 @@ fields that are separated by the pipe character, "|".
 <SkuIdS>        ::= <Keyword> [<FS> <Keyword>]*
 <Keyword>       ::= <UiName>
 <UiName>        ::= <Word>
-<FabStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>}
+<FabStatements> ::= {<MacroDefinition>} {<IncludeStatement>} 
+{<PcdEntry>} {<PcdFieldEntry>}
 <PcdEntry>      ::= <TS> <PcdName> [<FS> <PcdValue>] <EOL>
 <PcdValue>      ::= if (pcddatumtype == "BOOLEAN"):
                       {<BoolType>} {<Expression>} @@ -326,7 +329,7 @@ of the DSC file.
 <SkuIdS>        ::= <Keyword> [<FS> <Keyword>]*
 <Keyword>       ::= <UiName>
 <UiName>        ::= <Word>
-<PimStatements> ::= {<MacroDefinition>} {<IncludeStatement>} {<PcdEntry>}
+<PimStatements> ::= {<MacroDefinition>} {<IncludeStatement>} 
+{<PcdEntry>} {<PcdFieldEntry>}
 <PcdEntry>      ::= <TS> <PcdName> [<FS> <PcdValue>] <EOL>
 <PcdValue>      ::= if (pcddatumtype == "BOOLEAN"):
                       {<BoolType>} {<Expression>} @@ -449,16 +452,16 @@ sections of the DSC file.
 <PcdsDefault>    ::= "[PcdsDynamicDefault" [<PddAttribs>] "]" <EOL>
                      <PddEntries>*
 <PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>}
-                     {<TS> <MinEntry>}
+                     {<TS> <MinEntry>} {<TS> <PcdFieldEntry>}
 <PddAttribs>     ::= <attrs> ["," <TS> "PcdsDynamicDefault" <attrs>]*
 <PcdsVpd>        ::= "[PcdsDynamicVpd" [<PdvAttribs>] "]" <EOL>
                      <PdvEntries>*
 <PdvAttribs>     ::= <attrs> [ "," <TS> "PcdsDynamicVpd" <attrs>]*
-<PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <VpdEntry>}
+<PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <VpdEntry>} {<TS> <PcdFieldEntry>}
 <PcdsHii>        ::= "[PcdsDynamicHii" [<PdhAttribs>] "]" <EOL>
                      <PcdHiiEntries>*
 <PdhAttribs>     ::= <phattrs> ["," <TS> "PcdsDynamicHii <phattrs>]* <PdvEntries>*
-<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>}
+<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> 
+<HiiEntry>} {<TS> <PcdFieldEntry>}
 <attrs>          ::= "." <arch> ["." <SkuIds>]
 <phattrs>        ::= "." <arch> ["." <SkuIds>]["." <DefaultStore>]
 <SkuIdS>         ::= <Keyword> [<FS> <Keyword>]*
@@ -662,18 +665,18 @@ sections of the DSC file.
 <Pcds>           ::= {<PcdsExDefault>} {<PcdsExVpd>} {<PcdsExHii>}
 <PcdsExDefault>  ::= "[PcdsDynamicExDefault" [<PddAttribs>] "]" <EOL>
                      <PddEntries>*
-<PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <MinEntry>}
+<PddEntries>     ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <MinEntry>} {<TS> <PcdFieldEntry>}
 <PddAttribs>     ::= <attrs> ["," <TS> "PcdsDynamicExDefault" <attrs>]*
 <PcdsExVpd>      ::= "[PcdsDynamicExVpd" [<PdvAttribs>] "]" <EOL>
                      <PdvEntries>*
 <PdvAttribs>     ::= <attrs> [ "," <TS> "PcdsDynamicExVpd" <attrs>]*
 <PdvEntries>     ::= {<MacroDefinition>} {<IncludeStatement>}
-                     {<TS> <VpdEntry>}
+                     {<TS> <VpdEntry>} {<TS> <PcdFieldEntry>}
 <PcdsExHii>      ::= "[PcdsDynamicExHii" [<PdhAttribs>] "]" <EOL>
                      <PcdHiiEntries>*
 <PdhAttribs>     ::= <phattrs> ["," <TS> "PcdsDynamicExHii <phattrs>]*
                      <PdvEntries>*
-<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> <HiiEntry>}
+<PcdHiiEntries>  ::= {<MacroDefinition>} {<IncludeStatement>} {<TS> 
+<HiiEntry>} {<TS> <PcdFieldEntry>}
 <attrs>          ::= "." <arch> ["." <SkuIds>]
 <phattrs>        ::= "." <arch> ["." <SkuIds>]["." <DefaultStore>]
 <SkuIdS>         ::= <Keyword> [<FS> <Keyword>]*
diff --git a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
index 5b1c0d4..313fc20 100644
--- a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
+++ b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.3 Platform DSC Definition
 
-  Copyright (c) 2006-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006-2018, Intel Corporation. All rights reserved.<BR>
 
   Redistribution and use in source (original document form) and 'compiled'
   forms (converted to PDF, epub, HTML and other formats) with or without @@ -192,9 +192,13 @@ The following are common definitions used by multiple section types.
 <BoolType>             ::= {<BoolVal>} {"{"<BoolVal>"}"}
 <MACRO>                ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>             ::= "$(" <MACRO> ")"
+<PcdFieldName>         ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
 <PcdName>              ::= <TokenSpaceGuidCName> "." <PcdCName>
 <PcdCName>             ::= <CName>
 <TokenSpaceGuidCName>  ::= <CName>
+<Field>                ::= <CName>
+<PcdFieldEntry>        ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
+<PcdFieldValue>        ::= {<BoolType>} {<NumValUint8>} {<NumValUint16>} {<NumValUint32>} {<NumValUint64>} {<StringVal>} {<MACROVAL>} {<Expression>}
 <PCDVAL>               ::= "PCD(" <PcdName> ")"
 <UINT8>                ::= {"0x"} {"0X"} (\x0 - \xFF)
 <UINT16>               ::= {"0x"} {"0X"} (\x0 - \xFFFF)
--
2.8.0.windows.1

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