From nobody Fri Nov 1 10:25:36 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 1517414463727748.5997384453175; Wed, 31 Jan 2018 08:01:03 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 903AC2238B593; Wed, 31 Jan 2018 07:55:23 -0800 (PST) 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) 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 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 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=192.55.52.88; helo=mga01.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,440,1511856000"; d="scan'208";a="200132479" From: Yonghong Zhu To: edk2-devel@lists.01.org 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: [edk2] [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: , 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" 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_dis= cussion/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 =3D TRUE` =20 The `VALUE` specified must match the PCD's datum type and must be the cont= ent data. =20 -For a PCD that has a datum type of `VOID`*, the data can be a Unicode stri= ng, -as in `L"text"`, a valid C data array (it must be either a C format GUID o= r 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 i= n-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_dis= cussion/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 =3D TRUE` =20 The `VALUE` specified must match the Pcd's datum type and must be the cont= ent data. =20 -For a PCD that has a datum type of `VOID`*, the data can be a Unicode stri= ng, -as in `L"text"`, a valid C data array (it must be either a C format GUID o= r 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 i= n-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_desig= n_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 =3D TRUE` =20 The `VALUE` specified must match the PCD's datum type and must be the cont= ent data. =20 -For a PCD that has a datum type of `VOID`*, the data can be a Unicode stri= ng, -as in `L"text"`, a valid C data array (it must be either a C format GUID o= r a -hex Byte array), as in `{0x20002000, 0x32FF, 0x00AA, {0xFF, 0xF0, 0x00, 0x= 00, 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 =20 `EFI_CAPSULE_DATA` follows the `EFI_CAPSULE_HEADER` token definitions in t= he `[Capsule]` section or sub-sections. The content consists of one or more f= iles, 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_f= ile_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 s= ection types. ::=3D (0-9) ::=3D (a-zA-Z_) ::=3D * ::=3D # A valid C variable name. ::=3D (0x21 - 0x7E) - ::=3D [{0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} - {}]* + ::=3D [{0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} + {(0x5D - 0x7E)} {}]* ::=3D 0x22 + ::=3D 0x27 ::=3D "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} - {"\"} {} + {"\"} {} {} ::=3D {} {} ::=3D * ::=3D + ::=3D 0x09 ::=3D 0x20 @@ -122,15 +123,16 @@ The following are common definitions used by multiple= section types. ::=3D [ * * ]* ::=3D ::=3D ::=3D {} {} ::=3D * - ::=3D ["L"] + ::=3D * + ::=3D {} {} ::=3D [{} {}]+ ::=3D "#" [] + ::=3D "#" + - ::=3D "L" + ::=3D "L" {} {} ::=3D (a-fA-F0-9) ::=3D {"0x"} {"0X"} [] ::=3D {"0x"} {"0X"} + ::=3D "0x" [0]* ::=3D ? ? ? @@ -169,11 +171,12 @@ The following are common definitions used by multiple= section types. ::=3D (1-18446744073709551615) ::=3D {} {} ::=3D {"TRUE"} {"true"} {"True"} {"0x1"} {"0x01"} {"1"} ::=3D {"FALSE"} {"false"} {"False"} {"0x0"} {"0x00"= } {"0"} - ::=3D {} {} + ::=3D {} {} + ::=3D {} {"{""}"} ::=3D (A-Z)(A-Z0-9_)* ::=3D "$(" ")" ::=3D "." ::=3D ::=3D @@ -195,14 +198,45 @@ The following are common definitions used by multiple= section types. ::=3D (0-255) ::=3D (0-65535) ::=3D (0-4294967295) ::=3D (0-18446744073709551615) - ::=3D {} {} - ::=3D {} {} - ::=3D {} {} - ::=3D {} {} + ::=3D {} {} {} + {} {} + ::=3D {} {} {} + {} {} + ::=3D {} {} {} + {} {} + ::=3D {} {} {} + {} {} + ::=3D {} {"{""}"} + ::=3D {} + {"{" [ ]*"}"} + ::=3D {} + {"{" [ ]*"}"} + ::=3D {} + {"{" [ ]*"}"} + ::=3D {} {} {} + ::=3D "{"[] =20 + [ [] ]*"}" + ::=3D {} {} {}=20 + ::=3D {} {} {} {} + {} {} + ::=3D "GUID(" ")" + ::=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(" ")" ::=3D {"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"} ``` =20 ********** +**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 fo= llow the rules that a comment may not be enclosed within Section headers, and t= hat diff --git a/3_edk_ii_fdf_file_format/34_[defines]_section.md b/3_edk_ii_fd= f_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" ] * ::=3D {} {} {} ::=3D ::=3D {} {(0-9)+ "." (0-9)+} ::=3D "SET" [] - ::=3D {} {} {} {} - {} {} {} + ::=3D {} {} {} {} + {} {} ``` =20 #### Parameters =20 **_Expression_** diff --git a/3_edk_ii_fdf_file_format/35_[fd]_sections.md b/3_edk_ii_fdf_fi= le_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. ::=3D ::=3D "BlockSize" [] [ "NumBlocks" ] ::=3D "SET" - ::=3D {} {} {} {} + ::=3D {} {} {} {} {} {} ::=3D [ [ ] ] [] ::=3D {} {} @@ -149,14 +149,13 @@ in this the file. The `FvUiName` must be specified in a `[FV]` section header defined in thi= s the file. =20 **_PcdValue_** =20 -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 def= ined -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. =20 **_Expression_** =20 Refer to the EDK II Expression Syntax Specification for more information. =20 diff --git a/3_edk_ii_fdf_file_format/36_[fv]_sections.md b/3_edk_ii_fdf_fi= le_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. ::=3D {} {} ::=3D ::=3D [ "BlockSize" ] [ "NumBlocks" ] ::=3D "SET" - ::=3D {} {} {} {} + ::=3D {} {} {} {} {} {} ::=3D [ "FvBaseAddress" ] [ "FvForceRebase" ] "FvAlignment" diff --git a/3_edk_ii_fdf_file_format/37_[capsule]_sections.md b/3_edk_ii_f= df_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. ::=3D "[Capsule" "]" * ::=3D "." ::=3D "SET" - ::=3D {} {} {} {} + ::=3D {} {} {} {} {} {} ::=3D "CAPSULE_GUID" [ "CAPSULE_HEADER_SIZE" ] [<= TS> "CAPSULE_FLAGS" ] [ "CAPSULE_HEADER_INIT_VERSION" ] --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel