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.88; helo=mga01.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 6D4052215BD9C for ; Wed, 31 Jan 2018 07:55:21 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 08:00:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,440,1511856000"; d="scan'208";a="200132479" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga005.fm.intel.com with ESMTP; 31 Jan 2018 08:00:56 -0800 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao , Michael Kinney , Kevin W Shaw Date: Thu, 1 Feb 2018 00:00:47 +0800 Message-Id: <1517414448-4012-4-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1517414448-4012-1-git-send-email-yonghong.zhu@intel.com> References: <1517414448-4012-1-git-send-email-yonghong.zhu@intel.com> Subject: [Patch] FDF 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, 31 Jan 2018 15:55:21 -0000 Cc: Liming Gao Cc: Michael Kinney Cc: Kevin W Shaw Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- 2_fdf_design_discussion/24_[fd]_sections.md | 6 --- 2_fdf_design_discussion/25_[fv]_sections.md | 6 --- 2_fdf_design_discussion/26_[capsule]_sections.md | 6 --- 3_edk_ii_fdf_file_format/32_fdf_definition.md | 62 +++++++++++++++++++---- 3_edk_ii_fdf_file_format/34_[defines]_section.md | 4 +- 3_edk_ii_fdf_file_format/35_[fd]_sections.md | 9 ++-- 3_edk_ii_fdf_file_format/36_[fv]_sections.md | 2 +- 3_edk_ii_fdf_file_format/37_[capsule]_sections.md | 2 +- 8 files changed, 60 insertions(+), 37 deletions(-) diff --git a/2_fdf_design_discussion/24_[fd]_sections.md b/2_fdf_design_discussion/24_[fd]_sections.md index d55b793..2e1facb 100644 --- a/2_fdf_design_discussion/24_[fd]_sections.md +++ b/2_fdf_design_discussion/24_[fd]_sections.md @@ -155,16 +155,10 @@ The following is an example of the `SET` statement: `SET gFlashDevicePkgTokenSpaceGuid.PcdEfiMemoryMapped = TRUE` The `VALUE` specified must match the PCD's datum type and must be the content data. -For a PCD that has a datum type of `VOID`*, the data can be a Unicode string, -as in `L"text"`, a valid C data array (it must be either a C format GUID or a -hex byte array), as in `{0x20, 0x01, 0x50, 0x00, 0x32, 0xFF, 0x00, 0xAA, {0xFF, 0xF0, 0x00, 0x00, 0x00}}.` -For other PCD datum types, the value may be a boolean or a hex value, as in -`0x0000000F,` with a value that is consistent with the PCD's datum type. - The value may also be a macro or it may be computed, using arithmetic operations, arithmetic expressions and or logical expressions. The value portion of the `SET` statement, when using any of these computations are in-fix expressions that are evaluated left to right, with items within parenthesis evaluated before the outer expressions are evaluated. Use of parenthesis is diff --git a/2_fdf_design_discussion/25_[fv]_sections.md b/2_fdf_design_discussion/25_[fv]_sections.md index 7b50017..343e252 100644 --- a/2_fdf_design_discussion/25_[fv]_sections.md +++ b/2_fdf_design_discussion/25_[fv]_sections.md @@ -130,16 +130,10 @@ The following is an example of the `SET` statement: `SET gEfiMyTokenSpaceGuid.PcdDisableOnboardVideo = TRUE` The `VALUE` specified must match the Pcd's datum type and must be the content data. -For a PCD that has a datum type of `VOID`*, the data can be a Unicode string, -as in `L"text"`, a valid C data array (it must be either a C format GUID or a -hex byte array), as in `{0x20, 0x00, 0x20, 0x00, 0x32, 0xFF, 0x00, 0xAA, {0xFF, 0xF0, 0x00, 0x00, 0x00}}.` -Other PCD datum types are either boolean values or a hex value, as in -`0x0000000F`, with a value that is consistent with the PCD's datum type - The value may also be a macro or it may be computed, using arithmetic operations, arithmetic expressions and or logical expressions. The value portion of the `SET` statement, when using any of these computations are in-fix expressions that are evaluated left to right, with items within parenthesis evaluated before the outer expressions are evaluated. Use of parenthesis is diff --git a/2_fdf_design_discussion/26_[capsule]_sections.md b/2_fdf_design_discussion/26_[capsule]_sections.md index ba93268..d0b956a 100644 --- a/2_fdf_design_discussion/26_[capsule]_sections.md +++ b/2_fdf_design_discussion/26_[capsule]_sections.md @@ -97,16 +97,10 @@ The following is an example of the `SET` statement. `SET gEfiMyTokenSpaceGuid.PcdSecStartLocalApicTimer = TRUE` The `VALUE` specified must match the PCD's datum type and must be the content data. -For a PCD that has a datum type of `VOID`*, the data can be a Unicode string, -as in `L"text"`, a valid C data array (it must be either a C format GUID or a -hex Byte array), as in `{0x20002000, 0x32FF, 0x00AA, {0xFF, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xEF, 0x1A, 0x55}}.` -Other PCD datum types are either boolean values or a hex value, as in -`0x0000000F`, with a value that is consistent with the PCD's datum type. - ### 2.6.3 Capsule Data `EFI_CAPSULE_DATA` follows the `EFI_CAPSULE_HEADER` token definitions in the `[Capsule]` section or sub-sections. The content consists of one or more files, FD UiName, FV UiName or the following. diff --git a/3_edk_ii_fdf_file_format/32_fdf_definition.md b/3_edk_ii_fdf_file_format/32_fdf_definition.md index 1379db4..0eb9108 100644 --- a/3_edk_ii_fdf_file_format/32_fdf_definition.md +++ b/3_edk_ii_fdf_file_format/32_fdf_definition.md @@ -96,15 +96,16 @@ The following are common definitions used by multiple section types. ::= (0-9) ::= (a-zA-Z_) ::= * ::= # A valid C variable name. ::= (0x21 - 0x7E) - ::= [{0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} - {}]* + ::= [{0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} + {(0x5D - 0x7E)} {}]* ::= 0x22 + ::= 0x27 ::= "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} - {"\"} {} + {"\"} {} {} ::= {} {} ::= * ::= + ::= 0x09 ::= 0x20 @@ -122,15 +123,16 @@ The following are common definitions used by multiple section types. ::= [ * * ]* ::= ::= ::= {} {} ::= * - ::= ["L"] + ::= * + ::= {} {} ::= [{} {}]+ ::= "#" [] + ::= "#" + - ::= "L" + ::= "L" {} {} ::= (a-fA-F0-9) ::= {"0x"} {"0X"} [] ::= {"0x"} {"0X"} + ::= "0x" [0]* ::= ? ? ? @@ -169,11 +171,12 @@ The following are common definitions used by multiple section types. ::= (1-18446744073709551615) ::= {} {} ::= {"TRUE"} {"true"} {"True"} {"0x1"} {"0x01"} {"1"} ::= {"FALSE"} {"false"} {"False"} {"0x0"} {"0x00"} {"0"} - ::= {} {} + ::= {} {} + ::= {} {"{""}"} ::= (A-Z)(A-Z0-9_)* ::= "$(" ")" ::= "." ::= ::= @@ -195,14 +198,45 @@ The following are common definitions used by multiple section types. ::= (0-255) ::= (0-65535) ::= (0-4294967295) ::= (0-18446744073709551615) - ::= {} {} - ::= {} {} - ::= {} {} - ::= {} {} + ::= {} {} {} + {} {} + ::= {} {} {} + {} {} + ::= {} {} {} + {} {} + ::= {} {} {} + {} {} + ::= {} {"{""}"} + ::= {} + {"{" [ ]*"}"} + ::= {} + {"{" [ ]*"}"} + ::= {} + {"{" [ ]*"}"} + ::= {} {} {} + ::= "{"[] + [ [] ]*"}" + ::= {} {} {} + ::= {} {} {} {} + {} {} + ::= "GUID(" ")" + ::= { } + {} {} + ::= "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(" ")" ::= {"BASE"} {"SEC"} {"PEI_CORE"} {"PEIM"} {"DXE_CORE"} {"DXE_DRIVER"} {"SMM_CORE"} {"DXE_RUNTIME_DRIVER"} {"DXE_SAL_DRIVER"} {"DXE_SMM_DRIVER"} {"UEFI_DRIVER"} {"UEFI_APPLICATION"} {"USER_DEFINED"} @@ -231,10 +265,18 @@ The following are common definitions used by multiple section types. {"256K"} {"512K"} {"1M"} {"2M"} {"4M"} {"8M"} {"16M"} ``` ********** +**Note:** When using CString, UnicodeString or byte array format as +UINT8/UINT16/UINT32/UINT64 values, please make sure they fit in the +target type's size, otherwise tool would report failure. +********** +**Note:** LABEL() macro in byte arrays to tag the byte offset of a +location in a byte array. OFFSET_OF() macro in byte arrays that returns +the byte offset of a LABEL() declared in a byte array. +********** **Note:** When using the characters "|" or "||" in an expression, the expression must be encapsulated in open "(" and close ")" parenthesis. ********** **Note:** Comments may appear anywhere within a FDF file, provided they follow the rules that a comment may not be enclosed within Section headers, and that diff --git a/3_edk_ii_fdf_file_format/34_[defines]_section.md b/3_edk_ii_fdf_file_format/34_[defines]_section.md index 7011db8..5bbb890 100644 --- a/3_edk_ii_fdf_file_format/34_[defines]_section.md +++ b/3_edk_ii_fdf_file_format/34_[defines]_section.md @@ -60,12 +60,12 @@ Conditional statements may be used anywhere within this section. [ "FDF_VERSION" ] * ::= {} {} {} ::= ::= {} {(0-9)+ "." (0-9)+} ::= "SET" [] - ::= {} {} {} {} - {} {} {} + ::= {} {} {} {} + {} {} ``` #### Parameters **_Expression_** diff --git a/3_edk_ii_fdf_file_format/35_[fd]_sections.md b/3_edk_ii_fdf_file_format/35_[fd]_sections.md index 6c87ebd..8558e7e 100644 --- a/3_edk_ii_fdf_file_format/35_[fd]_sections.md +++ b/3_edk_ii_fdf_file_format/35_[fd]_sections.md @@ -65,11 +65,11 @@ Conditional statements may be used anywhere within this section. ::= ::= "BlockSize" [] [ "NumBlocks" ] ::= "SET" - ::= {} {} {} {} + ::= {} {} {} {} {} {} ::= [ [ ] ] [] ::= {} {} @@ -149,14 +149,13 @@ in this the file. The `FvUiName` must be specified in a `[FV]` section header defined in this the file. **_PcdValue_** -The PCD Value may be a specific numeric value, an array of numeric bytes, a -GUID, a quoted string, an L quoted string (representing a unicode string), an -arithmetic expression, a logic expression or a macro from a previously defined -macro statement. +The PCD Value may be a specific numeric value, an byte array, a quoted +string, an L quoted string (representing a unicode string), an expression +or a macro from a previously defined macro statement. **_Expression_** Refer to the EDK II Expression Syntax Specification for more information. diff --git a/3_edk_ii_fdf_file_format/36_[fv]_sections.md b/3_edk_ii_fdf_file_format/36_[fv]_sections.md index b4f292a..63e877e 100644 --- a/3_edk_ii_fdf_file_format/36_[fv]_sections.md +++ b/3_edk_ii_fdf_file_format/36_[fv]_sections.md @@ -85,11 +85,11 @@ Conditional statements may be used anywhere within this section. ::= {} {} ::= ::= [ "BlockSize" ] [ "NumBlocks" ] ::= "SET" - ::= {} {} {} {} + ::= {} {} {} {} {} {} ::= [ "FvBaseAddress" ] [ "FvForceRebase" ] "FvAlignment" diff --git a/3_edk_ii_fdf_file_format/37_[capsule]_sections.md b/3_edk_ii_fdf_file_format/37_[capsule]_sections.md index 6606d56..673cb37 100644 --- a/3_edk_ii_fdf_file_format/37_[capsule]_sections.md +++ b/3_edk_ii_fdf_file_format/37_[capsule]_sections.md @@ -48,11 +48,11 @@ Conditional statements may be used anywhere within this section. ::= "[Capsule" "]" * ::= "." ::= "SET" - ::= {} {} {} {} + ::= {} {} {} {} {} {} ::= "CAPSULE_GUID" [ "CAPSULE_HEADER_SIZE" ] [ "CAPSULE_FLAGS" ] [ "CAPSULE_HEADER_INIT_VERSION" ] -- 2.6.1.windows.1