[edk2] [Patch] DecSpecification: Add structure PCD definition syntax

Liming Gao posted 1 patch 6 years, 7 months ago
Failed in applying to current master (apply log)
2_dec_file_overview/210_pcd_usage.md                           |  7 ++++++-
3_edk_ii_dec_file_format/310_pcd_sections.md                   | 10 ++++++++--
.../32_package_declaration_dec_definitions.md                  |  5 ++++-
3 files changed, 18 insertions(+), 4 deletions(-)
[edk2] [Patch] DecSpecification: Add structure PCD definition syntax
Posted by Liming Gao 6 years, 7 months ago
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
---
 2_dec_file_overview/210_pcd_usage.md                           |  7 ++++++-
 3_edk_ii_dec_file_format/310_pcd_sections.md                   | 10 ++++++++--
 .../32_package_declaration_dec_definitions.md                  |  5 ++++-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/2_dec_file_overview/210_pcd_usage.md b/2_dec_file_overview/210_pcd_usage.md
index e6231b2..9b554be 100644
--- a/2_dec_file_overview/210_pcd_usage.md
+++ b/2_dec_file_overview/210_pcd_usage.md
@@ -1,7 +1,7 @@
 <!--- @file
   2.10 PCD Usage
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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
@@ -64,6 +64,9 @@ defined in published architectural specs. If a PCD is only going to be used by
 a single organization, then a new PCD can be created within the organization,
 keeping all modules that use the PCD internal to the organization.
 
+PCDs are defined with C structure type name. It means this PCD has the layout 
+of C strucutre. PCD value can be assigned by its structure field. 
+
 Every PCD (`PcdName`) is identified by a two part definition - the PCD's Token
 Space Guid CName and the PCD CName. These two parts are separated by a period
 "`.`" character. Together, these two parts make up the first field in a PCD
@@ -159,3 +162,5 @@ based on the greater of the lengths from the values in the DEC, DSC and INF
 files. However, if the platform integrator does not specify a size in the DSC
 file, the data size is calculated by the tools to be the greatest length of all
 values specified for this PCD listed in the DEC, INF, FDF and DSC files.
+
+If PCD is defined with C structure type name, it will also be VOID* PCD.
\ No newline at end of file
diff --git a/3_edk_ii_dec_file_format/310_pcd_sections.md b/3_edk_ii_dec_file_format/310_pcd_sections.md
index 36c32ff..42beee9 100644
--- a/3_edk_ii_dec_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dec_file_format/310_pcd_sections.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.10 PCD Sections
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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
@@ -112,7 +112,7 @@ PCDs listed in `PcdsFeatureFlag` sections must only be listed in
 <PcdEntries>      ::= ["##" <TS> <PcdDescription>]
                       [<TS> <Prompt>]
                       [<DoxComment>] <PcdEntry>
-<PcdEntry>        ::= <TS> {<PcdBool>} {<PcdNumEntry>} {<PcdPtr>}
+<PcdEntry>        ::= <TS> {<PcdBool>} {<PcdNumEntry>} {<PcdPtr>} {<PcdStruct>} {<PcdFieldValue>}
 <PcdNumEntry>     ::= {<Pcd8>} {<Pcd16>} {<Pcd32>} {<Pcd64>}
 <PcdBool>         ::= <PcdName> <FS> <BoolPcd> <FS> <Token> <CbOrEol>
 <BoolPcd>         ::= <Boolean> <FS> "BOOLEAN"
@@ -125,6 +125,12 @@ PCDs listed in `PcdsFeatureFlag` sections must only be listed in
 <PcdUint32>       ::= {<NumValUint32>} {<Expression>} <FS> "UINT32"
 <Pcd64>           ::= <PcdName> <FS> <PcdUint64> <FS> <Token> <CbOrEol>
 <PcdUint64>       ::= {<NumValUint64>} {<Expression>} <FS> "UINT64"
+<PcdStruct>       ::= <PcdName> <FS> <PtrVal> <FS> <CName> <FS> <Token> "{" <EOL>
+                      <TS> <PcdStructHF>
+                      <TS> <PcdStructPKGs> "}" <CbOrEol>
+<PcdStructHF>     ::= "<HeaderFile>" <EOL> <PcdStructFile>
+<PcdStructPKGs>   ::= "<Packages>" <EOL> <PcdStructFile>*
+<PcdStructFile>   ::= <Filename> <EOL>
 <PcdPtr>          ::= <PcdName> <FS> <PcdPtrVal> <FS> <Token> <CbOrEol>
 <PcdPtrVal>       ::= <PtrVal> <FS> "VOID*"
 <PtrVal>          ::= {<StringVal>} {<Expression>}
diff --git a/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md b/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
index 1370c4e..dcf73d4 100644
--- a/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
+++ b/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.2 Package Declaration (DEC) Definitions
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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
@@ -166,8 +166,11 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <MACRO>               ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>            ::= "$(" <MACRO> ")"
 <PcdName>             ::= <TokenSpaceGuidCName> "." <PcdCName>
+<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
 <PcdCName>            ::= <CName>
 <TokenSpaceGuidCName> ::= <CName>
+<PcdFieldEntry>       ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
+<PcdFieldValue>       ::= {<BoolType>} {<NumValUint8>} {<NumValUint16>} {<NumValUint32>} {<NumValUint64>} {<StringVal>} {<MACROVAL>} {<Expression>}
 <UINT8>               ::= {"0x"} {"0X"} (\x0 - \xFF)
 <UINT16>              ::= {"0x"} {"0X"} (\x0 - \xFFFF)
 <UINT32>              ::= {"0x"} {"0X"} (\x0 - \xFFFFFFFF)
-- 
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] DecSpecification: Add structure PCD definition syntax
Posted by Zhu, Yonghong 6 years, 7 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:43 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [Patch] DecSpecification: Add structure PCD definition syntax

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
---
 2_dec_file_overview/210_pcd_usage.md                           |  7 ++++++-
 3_edk_ii_dec_file_format/310_pcd_sections.md                   | 10 ++++++++--
 .../32_package_declaration_dec_definitions.md                  |  5 ++++-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/2_dec_file_overview/210_pcd_usage.md b/2_dec_file_overview/210_pcd_usage.md
index e6231b2..9b554be 100644
--- a/2_dec_file_overview/210_pcd_usage.md
+++ b/2_dec_file_overview/210_pcd_usage.md
@@ -1,7 +1,7 @@
 <!--- @file
   2.10 PCD Usage
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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 @@ -64,6 +64,9 @@ defined in published architectural specs. If a PCD is only going to be used by  a single organization, then a new PCD can be created within the organization,  keeping all modules that use the PCD internal to the organization.
 
+PCDs are defined with C structure type name. It means this PCD has the 
+layout of C strucutre. PCD value can be assigned by its structure field.
+
 Every PCD (`PcdName`) is identified by a two part definition - the PCD's Token  Space Guid CName and the PCD CName. These two parts are separated by a period  "`.`" character. Together, these two parts make up the first field in a PCD @@ -159,3 +162,5 @@ based on the greater of the lengths from the values in the DEC, DSC and INF  files. However, if the platform integrator does not specify a size in the DSC  file, the data size is calculated by the tools to be the greatest length of all  values specified for this PCD listed in the DEC, INF, FDF and DSC files.
+
+If PCD is defined with C structure type name, it will also be VOID* PCD.
\ No newline at end of file
diff --git a/3_edk_ii_dec_file_format/310_pcd_sections.md b/3_edk_ii_dec_file_format/310_pcd_sections.md
index 36c32ff..42beee9 100644
--- a/3_edk_ii_dec_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dec_file_format/310_pcd_sections.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.10 PCD Sections
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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 @@ -112,7 +112,7 @@ PCDs listed in `PcdsFeatureFlag` sections must only be listed in
 <PcdEntries>      ::= ["##" <TS> <PcdDescription>]
                       [<TS> <Prompt>]
                       [<DoxComment>] <PcdEntry>
-<PcdEntry>        ::= <TS> {<PcdBool>} {<PcdNumEntry>} {<PcdPtr>}
+<PcdEntry>        ::= <TS> {<PcdBool>} {<PcdNumEntry>} {<PcdPtr>} {<PcdStruct>} {<PcdFieldValue>}
 <PcdNumEntry>     ::= {<Pcd8>} {<Pcd16>} {<Pcd32>} {<Pcd64>}
 <PcdBool>         ::= <PcdName> <FS> <BoolPcd> <FS> <Token> <CbOrEol>
 <BoolPcd>         ::= <Boolean> <FS> "BOOLEAN"
@@ -125,6 +125,12 @@ PCDs listed in `PcdsFeatureFlag` sections must only be listed in
 <PcdUint32>       ::= {<NumValUint32>} {<Expression>} <FS> "UINT32"
 <Pcd64>           ::= <PcdName> <FS> <PcdUint64> <FS> <Token> <CbOrEol>
 <PcdUint64>       ::= {<NumValUint64>} {<Expression>} <FS> "UINT64"
+<PcdStruct>       ::= <PcdName> <FS> <PtrVal> <FS> <CName> <FS> <Token> "{" <EOL>
+                      <TS> <PcdStructHF>
+                      <TS> <PcdStructPKGs> "}" <CbOrEol>
+<PcdStructHF>     ::= "<HeaderFile>" <EOL> <PcdStructFile>
+<PcdStructPKGs>   ::= "<Packages>" <EOL> <PcdStructFile>*
+<PcdStructFile>   ::= <Filename> <EOL>
 <PcdPtr>          ::= <PcdName> <FS> <PcdPtrVal> <FS> <Token> <CbOrEol>
 <PcdPtrVal>       ::= <PtrVal> <FS> "VOID*"
 <PtrVal>          ::= {<StringVal>} {<Expression>}
diff --git a/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md b/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
index 1370c4e..dcf73d4 100644
--- a/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
+++ b/3_edk_ii_dec_file_format/32_package_declaration_dec_definitions.md
@@ -1,7 +1,7 @@
 <!--- @file
   3.2 Package Declaration (DEC) Definitions
 
-  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2007-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 @@ -166,8 +166,11 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <MACRO>               ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>            ::= "$(" <MACRO> ")"
 <PcdName>             ::= <TokenSpaceGuidCName> "." <PcdCName>
+<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
 <PcdCName>            ::= <CName>
 <TokenSpaceGuidCName> ::= <CName>
+<PcdFieldEntry>       ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
+<PcdFieldValue>       ::= {<BoolType>} {<NumValUint8>} {<NumValUint16>} {<NumValUint32>} {<NumValUint64>} {<StringVal>} {<MACROVAL>} {<Expression>}
 <UINT8>               ::= {"0x"} {"0X"} (\x0 - \xFF)
 <UINT16>              ::= {"0x"} {"0X"} (\x0 - \xFFFF)
 <UINT32>              ::= {"0x"} {"0X"} (\x0 - \xFFFFFFFF)
--
2.8.0.windows.1

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