From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EECDC22436928 for ; Mon, 5 Mar 2018 06:15:01 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 06:21:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="208961533" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 05 Mar 2018 06:21:14 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:21:14 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:21:12 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Mon, 5 Mar 2018 22:21:09 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Shaw, Kevin W" Thread-Topic: [Patch V2] Build spec: Add flexible PCD value format into spec Thread-Index: AQHToBA7GDbFevoxvkqI/kRDX6xmmqPB2kRA Date: Mon, 5 Mar 2018 14:21:08 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D78A3@SHSMSX104.ccr.corp.intel.com> References: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch V2] Build spec: Add flexible PCD value format into spec X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2018 14:15:02 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Wednesday, February 07, 2018 8:36 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming ; Kinney, Michael D >; Shaw, Kevin W >Subject: [Patch V2] Build spec: Add flexible PCD value format into spec > >V2: update EBNF for Array format. > >Cc: Liming Gao >Cc: Michael Kinney >Cc: Kevin W Shaw >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > 7_build_environment/73_guided_tools.md | 8 +-- > .../82_auto-generation_process.md | 18 +++--- > appendix_d_buildexe_command/d4_usage.md | 72 >+++++++++++++++++++--- > 3 files changed, 77 insertions(+), 21 deletions(-) > >diff --git a/7_build_environment/73_guided_tools.md >b/7_build_environment/73_guided_tools.md >index a8881d3..50119f1 100644 >--- a/7_build_environment/73_guided_tools.md >+++ b/7_build_environment/73_guided_tools.md >@@ -119,21 +119,21 @@ file required by the build system is provided in the >appendix, VPD Tool. > ``` > > If using automatic offset feature, the build tools byte-align numeric v= alues, > while `VOID*` PCD types will be aligned using the following rules: > >- * ASCII strings, "string", will be byte aligned. >- * Unicode strings, L"string" will be two-byte aligned. >+ * ASCII strings, "string" or 'string', will be byte aligned. >+ * Unicode strings, L"string" or L'string' will be two-byte aligned. > * Byte arrays, {0x00, 0x01} will be 8-byte aligned. > > If the developer manually assigns offset values in the DSC file, the de= veloper > must follow the same rules. > > ********** > **Note:** If a developer manually sets the offset of a `VOID*` PCD with >- Unicode string, L"string", style to a value that is not 2-byte aligned,= then >- an error is generated and the build halts. >+ Unicode string, L"string"/L'string' style to a value that is not 2-byte= aligned, >+ then an error is generated and the build halts. > ********** > **Note:** If a developer manually sets the offset of a `VOID*` PCD with >byte > array {} style to a value that is not 8-byte aligned, then a warning is > generated, but the build will continue. > ********** >diff --git a/8_pre-build_autogen_stage/82_auto-generation_process.md >b/8_pre-build_autogen_stage/82_auto-generation_process.md >index f610185..5a950d7 100644 >--- a/8_pre-build_autogen_stage/82_auto-generation_process.md >+++ b/8_pre-build_autogen_stage/82_auto-generation_process.md >@@ -875,41 +875,41 @@ A PCD value set on the command-line has the >highest precedence. It overrides > all instances of the PCD value specified in the DSC or FDF file. The foll= owing > is the syntax to override the value of a PCD on the command line: > > `--pcd [.]=3D` > >-For `VOID*` type PCDs, `` supports the following syntax: >+`` supports the following syntax: > >-* ASCII string value for a `VOID*` PCD >+* ASCII string value for a PCD > > `--pcd [.]=3D"String"` >+ `--pcd [.]=3D'String'` > >-* Unicode string value for a `VOID*` PCD >+* Unicode string value for a PCD > > `--pcd [.]=3DL"String"` >+ `--pcd [.]=3DL'String'` > >-* Byte array value for a `VOID*` PCD >+* Byte array value for a PCD > > `--pcd [.]=3D H"{0x1, 0x2}"` > > ********** > **Note:** The EDK II meta-data specs have changed to permit a PCD entry >(or any > other entry) to be listed only one time per section. > ********** >-**Caution:** Dynamic and DynamicEx `VOID*` VPD PCD array values must be >hex byte >-arrays. Using a Registry or C format GUID value in the value field of a `= VOID*` >-VPD PCD is not permitted. >-********** > > If the maximum size of a `VOID*` PCD is not specified in the DSC file, th= en the > maximum size is calculated based on the largest size of 1) the string or = array > in the DSC file, 2) the string or array in the INF file and 3) the string= or > array in the DEC file. If the value is a quoted text string, the size of = the > string will be incremented by one to handle string termination. If the qu= oted > string is preceded by L, as in `L"This is a string"`, then the size of th= e string > will be incremented by two to handle unicode string termination. If the v= alue >-is a byte array, then the size of the byte array is not modified. >+is a byte array, then the size of the byte array is not modified. If the = value is >+a single quoted string, as in 'string' or L'string', the size of the stri= ng doesn't >+need to include string null termination character. > > For example, if the string in the DSC file is `L"DSC Length"`, the INF fi= le has > `L"Module Length"` and the DEC file declares the default as `L"Length"`, = then > the maximum size that will be allocated for this PCD will be 28 bytes (` > L"Module Length"` 26 bytes, 2 bytes for null termination character). >diff --git a/appendix_d_buildexe_command/d4_usage.md >b/appendix_d_buildexe_command/d4_usage.md >index c901266..57d2656 100644 >--- a/appendix_d_buildexe_command/d4_usage.md >+++ b/appendix_d_buildexe_command/d4_usage.md >@@ -195,24 +195,80 @@ precedence over PCD provided in DSC, FDF, INF, and >DEC files. > > ```c > ::=3D "--pcd" ["=3D" ] > ::=3D 0x20 > ::=3D + >+ ::=3D * >+ ::=3D "," * >+ ::=3D (a-fA-F0-9) >+ ::=3D A valid C variable name. > ::=3D [ "."] > ::=3D C Variable Name of the Token Space GUID > ::=3D C Variable Name of the PCD >- ::=3D {} {} {} {} >+ ::=3D {} {} {} {} > ::=3D {} {} > ::=3D {(0-9)} {(1-9)(0-9)+} > ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,16} > ::=3D {} {} > ::=3D {"TRUE"} {"True"} {"true"} {"1"} {"0x1"} {"0x01"} > ::=3D {"FALSE"} {"False"} {"false"} {"0"} {"0x0"} {"0x0= 0"} >- ::=3D ["L"] >- ::=3D * >+ ::=3D ["L"] {} {} >+ ::=3D * >+ ::=3D * >+ ::=3D {} {} > ::=3D 0x22 >- ::=3D {0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} {} >- ::=3D "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"} {0x= 22} >- ::=3D "H" "{" "}" >- ::=3D ["," ]* >- ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,2} >+ ::=3D 0x27 >+ ::=3D {0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} {(0x5D - 0= x7E)} >+ {} >+ ::=3D "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"} >+ {} {} >+ ::=3D "H" "{"[] >+ [ [] ]*"}" >+ ::=3D {} {} {} >+ ::=3D (0-255) >+ ::=3D (0-65535) >+ ::=3D (0-4294967295) >+ ::=3D (0-18446744073709551615) >+ ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,2} >+ ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,4} >+ ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,8} >+ ::=3D >+ ::=3D {} {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D "GUID(" ")" >+ ::=3D { } >+ {} {} >+::=3D "-" "-" "-" "- >" >+ >+ ::=3D >+ ::=3D >+ ::=3D >+ ::=3D ? >+ ::=3D ? ? ? >+ ::=3D ? ? ? ? >+ ::=3D {"0x"} {"0X"} >+ ::=3D {"0x"} {"0X"} >+ ::=3D {"0x"} {"0X"} >+ ::=3D {"0x"} {"0X"} >+ ::=3D {"0x"} {"0X"} >+ >+ ::=3D "{" >+ "{" >+ >+ >+ >+ "}" "}" >+ ::=3D "DEVICE_PATH(" ")" >+ ::=3D A double quoted string that follow the device pat= h >+ as string format defined in UEFI Specification 2.6 >+ Section 9.6 >+ ::=3D {} {} {} >{} >+ ::=3D "UINT8(" ")" >+ ::=3D "UINT16(" ")" >+ ::=3D "UINT32(" ")" >+ ::=3D "UINT64(" ")" >+ ::=3D "LABEL(" ")" >+ ::=3D "OFFSET_OF(" ")" > ``` >-- >2.6.1.windows.1