public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Liming Gao <liming.gao@intel.com>
To: edk2-devel@lists.01.org
Cc: Yonghong Zhu <yonghong.zhu@intel.com>,
	Michael Kinney <michael.d.kinney@intel.com>
Subject: [Patch] DecSpecification: Add structure PCD definition syntax
Date: Fri, 16 Mar 2018 12:43:13 +0800	[thread overview]
Message-ID: <1521175393-17184-1-git-send-email-liming.gao@intel.com> (raw)

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



             reply	other threads:[~2018-03-16  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16  4:43 Liming Gao [this message]
2018-03-21  3:45 ` [Patch] DecSpecification: Add structure PCD definition syntax Zhu, Yonghong

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=1521175393-17184-1-git-send-email-liming.gao@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