From nobody Mon Dec 23 11:15:09 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 1517439493728391.45339815968657; Wed, 31 Jan 2018 14:58:13 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 348802239365D; Wed, 31 Jan 2018 14:52:32 -0800 (PST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 39A6522393625 for ; Wed, 31 Jan 2018 14:52:30 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 14:58:06 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by orsmga001.jf.intel.com with ESMTP; 31 Jan 2018 14:58:04 -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.20; helo=mga02.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,441,1511856000"; d="scan'208";a="27862098" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 1 Feb 2018 06:58:04 +0800 Message-Id: <1517439484-5104-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] 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" Cc: Liming Gao Cc: Michael Kinney Cc: Kevin W Shaw Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- 2_expression_overview.md | 13 +++++++------ 3_expression_format.md | 30 +++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/2_expression_overview.md b/2_expression_overview.md index 34ceb97..2f3dffa 100644 --- a/2_expression_overview.md +++ b/2_expression_overview.md @@ -63,26 +63,27 @@ directives section do not apply. 5. Between the previous and next sequence, an object shall have its stored value modified at most once by the evaluation of an expression. =20 6. Some operators (the unary operator, ~, and the binary operators, `<<, >= >`, &, | and ^ collectively described as bitwise operators) are required to= have - operands that are integer (base10) or hexadecimal (base16) types. + operands that can be translated to integer (base10) or hexadecimal (ba= se16) + types. =20 -7. The unary arithmetic operators, +, - and ~ must have an operand that is= an - integer (base10) or hexadecimal (base16) type, while the scalar unary - operators, ! and NOT, must have operands that are of type scalar. +7. The unary arithmetic operators, +, - and ~ must have an operand that ca= n be + translated to an integer (base10) or hexadecimal (base16) type, while t= he + scalar unary operators, ! and NOT, must have operands that are of type = scalar. =20 8. The Boolean values, False, FALSE and false have a numerical value of ze= ro. The Boolean values, True, TRUE and true have a numerical value of one. =20 9. Tools may be required to translate the expression sequence into an expression format that is comprehended by the tool's native language. F= or example, a tool written in Python may require changing the exact syntax= of an expression to a syntax that can be processed by Python's eval() func= tion. =20 -10. Multiplicative and additive operators require both operands to be - arithmetic in type. +10. Multiplicative and additive operators require both operands that can be + translated to arithmetic in type. =20 11. Relational and equality operators require both operands to be of the s= ame type. Relational comparison on string literals and byte arrays must be performed comparing the byte values, left to right. The first pair of = bytes (or a single extra byte) that is not equal will determine the result o= f the diff --git a/3_expression_format.md b/3_expression_format.md index 50b94c4..8a5c873 100644 --- a/3_expression_format.md +++ b/3_expression_format.md @@ -74,11 +74,11 @@ GRACEFULLY._ =20 #### Prototype =20 ```c ::=3D {} {} {= } {} - {"(" ")"} {} + {"(" ")"} {} {} ::=3D {} {} ::=3D "$(" ")" ::=3D (A-Z) [(A-Z0-9_)]* ::=3D "(" [ ]* "= )" ::=3D @@ -92,11 +92,13 @@ GRACEFULLY._ ::=3D {(0-9)} {(1-9) [(0-9)]*} ::=3D ::=3D []+ ::=3D (a-fA-F0-9) ::=3D {"0x"} {"0X"} - ::=3D {} {} + ::=3D "GUID(" ")" + ::=3D { } + {} {} Rhex2 ::=3D [] Rhex4 ::=3D [] [] Rhex2 Rhex8 ::=3D [] [] [] [] Rhex4 ::=3D Rghex8 "-" Rghex4 "-" Rghex4 "-" Rghex4 "-" = Rghex12 Rghex2 ::=3D @@ -111,19 +113,33 @@ Rghex12 ::=3D <= HexDigit> Rghex8 ::=3D "{" []* ::=3D "{" []* ::=3D ::=3D ::=3D []* "}" []* "}" - ::=3D {} {} + ::=3D {} {} ::=3D "{" * "}" - ::=3D "{" * [ ]* "}" + ::=3D "{" * [] =20 + [ [] ]* "}" + ::=3D {} {} {} {= } + ::=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 "UINT8(" ")" + ::=3D "UINT16(" ")" + ::=3D "UINT32(" ")" + ::=3D "UINT64(" ")" ::=3D {} {} ::=3D "." ::=3D {} { } ::=3D {} {} ::=3D {"+"} {"-"} {"~"} @@ -187,11 +203,11 @@ 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 ## 3.2 Conditional Directive Expressions =20 Conditional directive statements are defined in the EDK II Platform Descri= ption --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel