public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch v3] Dec Spec: Support the syntax of the structure array for structure PCD
@ 2019-01-08  5:37 Liming Gao
  2019-01-08  7:41 ` Feng, Bob C
  0 siblings, 1 reply; 2+ messages in thread
From: Liming Gao @ 2019-01-08  5:37 UTC (permalink / raw)
  To: edk2-devel

In V2, update array style to more than one dimension array.
In V3, Update Pcd Field value assignment with array index.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1292

1. Support the syntax of the structure array for structure PCD
2. Add the syntax to initialize structure PCD with C style value

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
---
 3_edk_ii_dec_file_format/310_pcd_sections.md                  |  2 +-
 .../32_package_declaration_dec_definitions.md                 | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

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 42beee9..2711788 100644
--- a/3_edk_ii_dec_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dec_file_format/310_pcd_sections.md
@@ -125,7 +125,7 @@ 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>
+<PcdStruct>       ::= <PcdName> <FS> <PtrVal> <FS> {<CName>} {<CArrayName>} <FS> <Token> "{" <EOL>
                       <TS> <PcdStructHF>
                       <TS> <PcdStructPKGs> "}" <CbOrEol>
 <PcdStructHF>     ::= "<HeaderFile>" <EOL> <PcdStructFile>
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 a3120f3..dc18fb0 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
@@ -87,6 +87,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <NonDigit>            ::= (a-zA-Z_)
 <Identifier>          ::= <NonDigit> <Chars>*
 <CName>               ::= <Identifier> # A valid C variable name.
+<CArrayName>          ::= <Identifier>["["[<Number>]"]"]+ # A valid C variable array name.
 <AsciiChars>          ::= (0x21 - 0x7E)
 <CChars>              ::= [{0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)}
                           {(0x5D - 0x7E)} {<EscapeSequence>}]*
@@ -166,7 +167,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <MACRO>               ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>            ::= "$(" <MACRO> ")"
 <PcdName>             ::= <TokenSpaceGuidCName> "." <PcdCName>
-<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
+<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> ["["<Number>"]"]* "." <Field>
 <PcdCName>            ::= <CName>
 <TokenSpaceGuidCName> ::= <CName>
 <PcdFieldEntry>       ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
@@ -208,7 +209,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <StringVal>           ::= {<UnicodeString>} {<CString>} {<Array>}
 <Array>               ::= "{" {<Array>} {[<Lable>] <ArrayVal> 
                            [<CommaSpace> [<Lable>] <ArrayVal>]* } "}"
-<ArrayVal>            ::= {<Num8Array>} {<GuidStr>} {<DevicePath>} 
+<ArrayVal>            ::= {<Num8Array>} {<GuidStr>} {<DevicePath>} {<CodeStr>}
 <NonNumType>          ::= {<BoolVal>}{<UnicodeString>} {<CString>}
                           {<Offset>} {<UintMac>}
 <Num8Array>           ::= {<NonNumType>} {<ShortNum>} {<UINT8>}
@@ -216,6 +217,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <Num32Array>          ::= {<NonNumType>} {<LongNum>} {<UINT32>}
 <Num64Array>          ::= {<NonNumType>} {<LongLongNum>} {<UINT64>}
 <GuidStr>             ::= "GUID(" <GuidVal> ")"
+<CodeStr>             ::= "CODE(" <CData> ")"
 <GuidVal>             ::= {<DblQuote> <RegistryFormatGUID> <DblQuote>}
                           {<CFormatGUID>} {<CName>}
 <DevicePath>          ::= "DEVICE_PATH(" <DevicePathStr> ")"
@@ -326,6 +328,11 @@ All C data arrays used in PCD value fields must be byte arrays. The C format
 GUID style is a special case that is permitted in some fields that use the
 `<CArray>` nomenclature.
 
+**_CData_**
+
+All C data used in PCD value CODE syntax can be C style value to initialize 
+C structure or Array in C source code.
+
 **_EOL_**
 
 The DOS End Of Line: "0x0D 0x0A" character sequence must be used for all EDK II
-- 
2.13.0.windows.1



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

* Re: [Patch v3] Dec Spec: Support the syntax of the structure array for structure PCD
  2019-01-08  5:37 [Patch v3] Dec Spec: Support the syntax of the structure array for structure PCD Liming Gao
@ 2019-01-08  7:41 ` Feng, Bob C
  0 siblings, 0 replies; 2+ messages in thread
From: Feng, Bob C @ 2019-01-08  7:41 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Gao, Liming 
Sent: Tuesday, January 8, 2019 1:37 PM
To: edk2-devel@lists.01.org
Cc: Feng, Bob C <bob.c.feng@intel.com>
Subject: [Patch v3] Dec Spec: Support the syntax of the structure array for structure PCD

In V2, update array style to more than one dimension array.
In V3, Update Pcd Field value assignment with array index.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1292

1. Support the syntax of the structure array for structure PCD 2. Add the syntax to initialize structure PCD with C style value

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
---
 3_edk_ii_dec_file_format/310_pcd_sections.md                  |  2 +-
 .../32_package_declaration_dec_definitions.md                 | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

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 42beee9..2711788 100644
--- a/3_edk_ii_dec_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dec_file_format/310_pcd_sections.md
@@ -125,7 +125,7 @@ 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>
+<PcdStruct>       ::= <PcdName> <FS> <PtrVal> <FS> {<CName>} {<CArrayName>} <FS> <Token> "{" <EOL>
                       <TS> <PcdStructHF>
                       <TS> <PcdStructPKGs> "}" <CbOrEol>
 <PcdStructHF>     ::= "<HeaderFile>" <EOL> <PcdStructFile>
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 a3120f3..dc18fb0 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
@@ -87,6 +87,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <NonDigit>            ::= (a-zA-Z_)
 <Identifier>          ::= <NonDigit> <Chars>*
 <CName>               ::= <Identifier> # A valid C variable name.
+<CArrayName>          ::= <Identifier>["["[<Number>]"]"]+ # A valid C variable array name.
 <AsciiChars>          ::= (0x21 - 0x7E)
 <CChars>              ::= [{0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)}
                           {(0x5D - 0x7E)} {<EscapeSequence>}]* @@ -166,7 +167,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <MACRO>               ::= (A-Z)(A-Z0-9_)*
 <MACROVAL>            ::= "$(" <MACRO> ")"
 <PcdName>             ::= <TokenSpaceGuidCName> "." <PcdCName>
-<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> "." <Field>
+<PcdFieldName>        ::= <TokenSpaceGuidCName> "." <PcdCName> ["["<Number>"]"]* "." <Field>
 <PcdCName>            ::= <CName>
 <TokenSpaceGuidCName> ::= <CName>
 <PcdFieldEntry>       ::= <PcdFieldName> <FS> <PcdFieldValue> <EOL>
@@ -208,7 +209,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <StringVal>           ::= {<UnicodeString>} {<CString>} {<Array>}
 <Array>               ::= "{" {<Array>} {[<Lable>] <ArrayVal> 
                            [<CommaSpace> [<Lable>] <ArrayVal>]* } "}"
-<ArrayVal>            ::= {<Num8Array>} {<GuidStr>} {<DevicePath>} 
+<ArrayVal>            ::= {<Num8Array>} {<GuidStr>} {<DevicePath>} {<CodeStr>}
 <NonNumType>          ::= {<BoolVal>}{<UnicodeString>} {<CString>}
                           {<Offset>} {<UintMac>}
 <Num8Array>           ::= {<NonNumType>} {<ShortNum>} {<UINT8>}
@@ -216,6 +217,7 @@ DEC file (for example, `<Expression>` statements are not permitted).
 <Num32Array>          ::= {<NonNumType>} {<LongNum>} {<UINT32>}
 <Num64Array>          ::= {<NonNumType>} {<LongLongNum>} {<UINT64>}
 <GuidStr>             ::= "GUID(" <GuidVal> ")"
+<CodeStr>             ::= "CODE(" <CData> ")"
 <GuidVal>             ::= {<DblQuote> <RegistryFormatGUID> <DblQuote>}
                           {<CFormatGUID>} {<CName>}
 <DevicePath>          ::= "DEVICE_PATH(" <DevicePathStr> ")"
@@ -326,6 +328,11 @@ All C data arrays used in PCD value fields must be byte arrays. The C format  GUID style is a special case that is permitted in some fields that use the  `<CArray>` nomenclature.
 
+**_CData_**
+
+All C data used in PCD value CODE syntax can be C style value to 
+initialize C structure or Array in C source code.
+
 **_EOL_**
 
 The DOS End Of Line: "0x0D 0x0A" character sequence must be used for all EDK II
--
2.13.0.windows.1



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

end of thread, other threads:[~2019-01-08  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-08  5:37 [Patch v3] Dec Spec: Support the syntax of the structure array for structure PCD Liming Gao
2019-01-08  7:41 ` Feng, Bob C

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