From nobody Mon May 6 03:56:12 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 151800697150073.75902406427588; Wed, 7 Feb 2018 04:36:11 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 685BE221660C6; Wed, 7 Feb 2018 04:30:21 -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 17E00221660C6 for ; Wed, 7 Feb 2018 04:30:20 -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:36:03 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 04:36:03 -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="28111861" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Wed, 7 Feb 2018 20:35:55 +0800 Message-Id: <1518006956-2284-4-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 In-Reply-To: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> References: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> Subject: [edk2] [Patch V2] Expression spec: update format to support flexible Pcd format 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 --- 2_expression_overview.md | 3 +++ 3_expression_format.md | 50 +++++++++++++++++++++++++++++++++++++++++++-= ---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/2_expression_overview.md b/2_expression_overview.md index 34ceb97..c29a632 100644 --- a/2_expression_overview.md +++ b/2_expression_overview.md @@ -100,5 +100,8 @@ directives section do not apply. 12. Logical operators require operands that are type scalar. =20 13. For the Conditional Operator, the first operand must be scalar, while = the second and third operands must have the same type (i.e., both being sc= alar, both being integers, or both being string literals). + +14. Array format like "{0x10, 0x20}" can't be a operand of any operator ex= cept + Relational and equality operators. diff --git a/3_expression_format.md b/3_expression_format.md index 50b94c4..1f90fc9 100644 --- a/3_expression_format.md +++ b/3_expression_format.md @@ -93,10 +93,21 @@ GRACEFULLY._ ::=3D ::=3D []+ ::=3D (a-fA-F0-9) ::=3D {"0x"} {"0X"} ::=3D {} {} + ::=3D (\x0 - \xFF) + ::=3D (\x0 - \xFFFF) + ::=3D (\x0 - \xFFFFFFFF) + ::=3D (\x0 - \xFFFFFFFFFFFFFFFF) + ::=3D (0-255) + ::=3D (0-65535) + ::=3D (0-4294967295) + ::=3D (0-18446744073709551615) + ::=3D "GUID(" ")" + ::=3D { } + {} {} Rhex2 ::=3D [] Rhex4 ::=3D [] [] Rhex2 Rhex8 ::=3D [] [] [] [] Rhex4 ::=3D Rghex8 "-" Rghex4 "-" Rghex4 "-" Rghex4 "-" = Rghex12 Rghex2 ::=3D @@ -111,19 +122,42 @@ Rghex12 ::=3D <= HexDigit> Rghex8 ::=3D "{" []* ::=3D "{" []* ::=3D ::=3D ::=3D []* "}" []* "}" - ::=3D {} {} + ::=3D {} {} ::=3D "{" * "}" - ::=3D "{" * [ ]* "}" + ::=3D "{" * [] =20 + [ [] ]* "}" + ::=3D {} {} {} + ::=3D "DEVICE_PATH(" ")" + ::=3D A double quoted string that follow the devic= e path + as string format defined in UEFI Specification= 2.6 + Section 9.6 + ::=3D "LABEL(" ")" + ::=3D "OFFSET_OF(" ")" ::=3D {} {"L" } + {} {"L" } ::=3D 0x22 + ::=3D 0x27 ::=3D []* + ::=3D []* ::=3D {} {} - ::=3D {0x20} {0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} - ::=3D "\" {"n"} {"r"} {"t"} {"f"} {"b"} {"0"} {"\"= } {} + ::=3D {0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} + {(0x5D - 0x7E)} {} + ::=3D "\" {"n"} {"r"} {"t"} {"f"} {"b"} {"0"} {"\"} + {} {} + ::=3D {} {} {} {= } + ::=3D {} {} {} + ::=3D {} {} {} + ::=3D {} {} {} + ::=3D {} {} {} + ::=3D {} {} {} {} + ::=3D "UINT8(" ")" + ::=3D "UINT16(" ")" + ::=3D "UINT32(" ")" + ::=3D "UINT64(" ")" ::=3D {} {} ::=3D "." ::=3D {} { } ::=3D {} {} ::=3D {"+"} {"-"} {"~"} @@ -187,13 +221,19 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress = | !gCrownBayTokenSpaceGuid. =20 This is the value of the MACRO assigned in a DEFINE statement. =20 **Expressions** =20 -If the "|" character is used in an expression, the expression must be +If the "|" or "||"character is used in an expression, the expression must = be encapsulated by parenthesis. =20 +**OFFSET_OF()** + +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. + ## 3.2 Conditional Directive Expressions =20 Conditional directive statements are defined in the EDK II Platform Descri= ption (DSC) File and Flash Definition (FDF) File. The following EBNF describes t= he format for expressions used in conditional directives. The format is based= on --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel