From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="28111826" 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 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao , Michael Kinney , Kevin W Shaw 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: [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: Wed, 07 Feb 2018 12:30:16 -0000 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 values, 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 developer 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 following is the syntax to override the value of a PCD on the command line: `--pcd [.]=` -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 [.]="String"` + `--pcd [.]='String'` -* Unicode string value for a `VOID*` PCD +* Unicode string value for a PCD `--pcd [.]=L"String"` + `--pcd [.]=L'String'` -* Byte array value for a `VOID*` PCD +* Byte array value for a PCD `--pcd [.]= 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, then 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 quoted 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 value -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 string doesn't +need to include string null termination character. For example, if the string in the DSC file is `L"DSC Length"`, the INF file 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 ::= "--pcd" ["=" ] ::= 0x20 ::= + + ::= * + ::= "," * + ::= (a-fA-F0-9) + ::= A valid C variable name. ::= [ "."] ::= C Variable Name of the Token Space GUID ::= C Variable Name of the PCD - ::= {} {} {} {} + ::= {} {} {} {} ::= {} {} ::= {(0-9)} {(1-9)(0-9)+} ::= {"0x"} {"0X"} (a-fA-F0-9){1,16} ::= {} {} ::= {"TRUE"} {"True"} {"true"} {"1"} {"0x1"} {"0x01"} ::= {"FALSE"} {"False"} {"false"} {"0"} {"0x0"} {"0x00"} - ::= ["L"] - ::= * + ::= ["L"] {} {} + ::= * + ::= * + ::= {} {} ::= 0x22 - ::= {0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} {} - ::= "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"} {0x22} - ::= "H" "{" "}" - ::= ["," ]* - ::= {"0x"} {"0X"} (a-fA-F0-9){1,2} + ::= 0x27 + ::= {0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} {(0x5D - 0x7E)} + {} + ::= "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"} + {} {} + ::= "H" "{"[] + [ [] ]*"}" + ::= {} {} {} + ::= (0-255) + ::= (0-65535) + ::= (0-4294967295) + ::= (0-18446744073709551615) + ::= {"0x"} {"0X"} (a-fA-F0-9){1,2} + ::= {"0x"} {"0X"} (a-fA-F0-9){1,4} + ::= {"0x"} {"0X"} (a-fA-F0-9){1,8} + ::= + ::= {} {} {} {} + ::= {} {} {} + ::= {} {} {} + ::= {} {} {} + ::= {} {} {} + ::= "GUID(" ")" + ::= { } + {} {} +::= "-" "-" "-" "-" + + ::= + ::= + ::= + ::= ? + ::= ? ? ? + ::= ? ? ? ? + ::= {"0x"} {"0X"} + ::= {"0x"} {"0X"} + ::= {"0x"} {"0X"} + ::= {"0x"} {"0X"} + ::= {"0x"} {"0X"} + + ::= "{" + "{" + + + + "}" "}" + ::= "DEVICE_PATH(" ")" + ::= A double quoted string that follow the device path + as string format defined in UEFI Specification 2.6 + Section 9.6 + ::= {} {} {} {} + ::= "UINT8(" ")" + ::= "UINT16(" ")" + ::= "UINT32(" ")" + ::= "UINT64(" ")" + ::= "LABEL(" ")" + ::= "OFFSET_OF(" ")" ``` -- 2.6.1.windows.1