From nobody Fri May 3 09:46:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518006964307928.8651148844253; Wed, 7 Feb 2018 04:36:04 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 37C6121F0DA7D; Wed, 7 Feb 2018 04:30:18 -0800 (PST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 D1EF521F0DA6F for ; Wed, 7 Feb 2018 04:30:15 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 04:35:59 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 04:35:58 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="28111826" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Wed, 7 Feb 2018 20:35:52 +0800 Message-Id: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , Cc: Michael Kinney , Kevin W Shaw , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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/7= 3_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. ``` =20 If using automatic offset feature, the build tools byte-align numeric va= lues, while `VOID*` PCD types will be aligned using the following rules: =20 - * 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. =20 If the developer manually assigns offset values in the DSC file, the dev= eloper must follow the same rules. =20 ********** **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_pr= e-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 p= recedence. It overrides all instances of the PCD value specified in the DSC or FDF file. The follo= wing is the syntax to override the value of a PCD on the command line: =20 `--pcd [.]=3D` =20 -For `VOID*` type PCDs, `` supports the following syntax: +`` supports the following syntax: =20 -* ASCII string value for a `VOID*` PCD +* ASCII string value for a PCD =20 `--pcd [.]=3D"String"` + `--pcd [.]=3D'String'` =20 -* Unicode string value for a `VOID*` PCD +* Unicode string value for a PCD =20 `--pcd [.]=3DL"String"` + `--pcd [.]=3DL'String'` =20 -* Byte array value for a `VOID*` PCD +* Byte array value for a PCD =20 `--pcd [.]=3D H"{0x1, 0x2}"` =20 ********** **Note:** The EDK II meta-data specs have changed to permit a PCD entry (o= r any other entry) to be listed only one time per section. ********** -**Caution:** Dynamic and DynamicEx `VOID*` VPD PCD array values must be he= x byte -arrays. Using a Registry or C format GUID value in the value field of a `V= OID*` -VPD PCD is not permitted. -********** =20 If the maximum size of a `VOID*` PCD is not specified in the DSC file, the= n the maximum size is calculated based on the largest size of 1) the string or a= rray 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 t= he string will be incremented by one to handle string termination. If the quo= ted string is preceded by L, as in `L"This is a string"`, then the size of the= string will be incremented by two to handle unicode string termination. If the va= lue -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 v= alue is +a single quoted string, as in 'string' or L'string', the size of the strin= g doesn't +need to include string null termination character. =20 For example, if the string in the DSC file is `L"DSC Length"`, the INF fil= e has `L"Module Length"` and the DEC file declares the default as `L"Length"`, t= hen 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 DE= C files. =20 ```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"} {"0x00= "} - ::=3D ["L"] - ::=3D * + ::=3D ["L"] {} {} + ::=3D * + ::=3D * + ::=3D {} {} ::=3D 0x22 - ::=3D {0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} {} - ::=3D "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"} {0x2= 2} - ::=3D "H" "{" "}" - ::=3D ["," ]* - ::=3D {"0x"} {"0X"} (a-fA-F0-9){1,2} + ::=3D 0x27 + ::=3D {0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} {(0x5D - 0x= 7E)} + {} + ::=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 path + 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(" ")" ``` --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel