public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Li, Yi" <yi1.li@intel.com>
To: devel@edk2.groups.io
Cc: Yi Li <yi1.li@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>
Subject: [edk2-devel] [PATCH 1/2] MdePkg: Add DECLARE_LENGTH opcode of dependency expression
Date: Tue, 19 Dec 2023 12:50:12 +0800	[thread overview]
Message-ID: <20231219045013.1425-2-yi1.li@intel.com> (raw)
In-Reply-To: <20231219045013.1425-1-yi1.li@intel.com>

Mantis: https://mantis.uefi.org/mantis/view.php?id=2025

To avoid messy parsing of the Depex section of a Capsule, it would
be a lot easier for everyone involved if we preceded the Capsule Depex
Section with a length declaration. It provides simple bounds checking
to avoid having to parse the op-codes, but in the case of a malformed
depex being parsed, avoid other issues which can be messy.

REF: UEFI spec 2.10 Table 23.4

Signed-off-by: Yi Li <yi1.li@intel.com>

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
 MdePkg/Include/Protocol/FirmwareManagement.h | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/MdePkg/Include/Protocol/FirmwareManagement.h b/MdePkg/Include/Protocol/FirmwareManagement.h
index f37067df3455..e535bb697d88 100644
--- a/MdePkg/Include/Protocol/FirmwareManagement.h
+++ b/MdePkg/Include/Protocol/FirmwareManagement.h
@@ -30,20 +30,21 @@ typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCO
 ///
 /// Dependency Expression Opcode
 ///
-#define EFI_FMP_DEP_PUSH_GUID     0x00
-#define EFI_FMP_DEP_PUSH_VERSION  0x01
-#define EFI_FMP_DEP_VERSION_STR   0x02
-#define EFI_FMP_DEP_AND           0x03
-#define EFI_FMP_DEP_OR            0x04
-#define EFI_FMP_DEP_NOT           0x05
-#define EFI_FMP_DEP_TRUE          0x06
-#define EFI_FMP_DEP_FALSE         0x07
-#define EFI_FMP_DEP_EQ            0x08
-#define EFI_FMP_DEP_GT            0x09
-#define EFI_FMP_DEP_GTE           0x0A
-#define EFI_FMP_DEP_LT            0x0B
-#define EFI_FMP_DEP_LTE           0x0C
-#define EFI_FMP_DEP_END           0x0D
+#define EFI_FMP_DEP_PUSH_GUID       0x00
+#define EFI_FMP_DEP_PUSH_VERSION    0x01
+#define EFI_FMP_DEP_VERSION_STR     0x02
+#define EFI_FMP_DEP_AND             0x03
+#define EFI_FMP_DEP_OR              0x04
+#define EFI_FMP_DEP_NOT             0x05
+#define EFI_FMP_DEP_TRUE            0x06
+#define EFI_FMP_DEP_FALSE           0x07
+#define EFI_FMP_DEP_EQ              0x08
+#define EFI_FMP_DEP_GT              0x09
+#define EFI_FMP_DEP_GTE             0x0A
+#define EFI_FMP_DEP_LT              0x0B
+#define EFI_FMP_DEP_LTE             0x0C
+#define EFI_FMP_DEP_END             0x0D
+#define EFI_FMP_DEP_DECLARE_LENGTH  0x0E
 
 ///
 /// Image Attribute - Dependency
-- 
2.42.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112687): https://edk2.groups.io/g/devel/message/112687
Mute This Topic: https://groups.io/mt/103257908/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-19  4:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  4:50 [edk2-devel] [PATCH 0/2] Add DECLARE_LENGTH opcode of dependency expression Li, Yi
2023-12-19  4:50 ` Li, Yi [this message]
2023-12-19  4:50 ` [edk2-devel] [PATCH 2/2] FmpDevicePkg: " Li, Yi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231219045013.1425-2-yi1.li@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox