From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mx.groups.io with SMTP id smtpd.web10.35296.1629176928739932935 for ; Mon, 16 Aug 2021 22:08:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZcfOPY29; spf=pass (domain: gmail.com, ip: 209.85.214.175, mailfrom: kuqin12@gmail.com) Received: by mail-pl1-f175.google.com with SMTP id u1so6341765plr.1 for ; Mon, 16 Aug 2021 22:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lkAv6nOQmH2XihcUGa82C8WxuWh/ChrH1VV4zpFx5vI=; b=ZcfOPY29910AeCJY0hn0NSqOwc+t2U5tazNRqB9UZCXn8v0sI09cd3gFt4z4yu2ZiC Ka4d827+WI5N8KUQ1YvwVhsICB/p/x3B82vKjueJ6lp4VMqbyiNe0gArWxcCyoQcv4MW LmrdjslkDD7Eu0z99EuIXEpwz5AIFTWxJNDvccb0VyBjPR3fccFLxqgZBFPUuKS+IAZT 3bALSe/akQtHjqTXlAIMLmbd43T631wYEsgzEfudcFZ3HuVY4wI6K2e6bTr9TEETnlh2 GSm8PTDrkVilunl3HkBc2vbdw54xqboK5/iP96nRG4OQ6ugOyANGfjiT7EemYEs0NVl4 KZxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lkAv6nOQmH2XihcUGa82C8WxuWh/ChrH1VV4zpFx5vI=; b=RnmYHDZ2nYQU5fbXUj7dqZ2A0Bj15fF9v/vGJVlm2vLGw06jzTktMr9ETBnz19czbZ DK/jgYXE8tCODiYa/LP1daAsodtMaocgG4qVV7DN9f+vjT3Sk3MCwkL3yO5CLM3CPhA3 HhO5O6SEKfTUuXqAiFXipL1GY3h9LuZkK3GnqYTIL7aiKVbl1RjSNV4ZNPNiJqin2Jiq HJ6vh0m3sQ8c2Dy7VKyZSE8gS/wHF7aO78EP3g7fyOmcRiLCxtwqL+lnlTQk8cxcJeSG RQQVjLC3ztpjCfT6XhfeUGbmAP1vdzFTwHWZZBuR/LJto0CYh7MssBEGzWXjnXyuvITA 4Krw== X-Gm-Message-State: AOAM533zOrqD0AVjHYRBbwtpqPOsqbhWlu2U34kDqO76H1NomIi1rAXu MXItFr1RLhVyP+AsjN/nhT5LU8hOJKjUHg== X-Google-Smtp-Source: ABdhPJwf0ll7TERUciGd6CBr1Ymee4NJz0f6jLfitCs7K0QnjAwEv6J+ttPKo+2Q2PcK1dyuYa77og== X-Received: by 2002:a65:690c:: with SMTP id s12mr1750007pgq.401.1629176928088; Mon, 16 Aug 2021 22:08:48 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.35.88.161]) by smtp.gmail.com with ESMTPSA id i5sm737965pjk.47.2021.08.16.22.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 22:08:47 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Hao A Wu , =?UTF-8?q?Marvin=20H=C3=A4user?= , Bret Barkelew , Michael Kubacki Subject: [PATCH v3 4/7] MdePkg: MmCommunication: Introduce EFI_PEI_MM_COMMUNICATION3_PPI to MdePkg Date: Mon, 16 Aug 2021 22:08:04 -0700 Message-Id: <20210817050807.766-5-kuqin12@gmail.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20210817050807.766-1-kuqin12@gmail.com> References: <20210817050807.766-1-kuqin12@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430 This change introduces a new definition for MM communicate PPI v3. This PPI will be installed under a new GUID in contrast to exisiting EFI_PEI_MM_COMMUNICATION_PPI. Data communicated to MM through EFI_PEI_MM_COMMUNICATION3_PPI should always start with EFI_MM_COMMUNICATE_HEADER_V3 with its HeaderGuid, Signature and Version fields properly populated. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Hao A Wu Cc: Marvin Häuser Cc: Bret Barkelew Cc: Michael Kubacki Signed-off-by: Kun Qin --- Notes: v3: - Newly introduced v3 communicate PPI MdePkg/Include/Ppi/MmCommunication3.h | 58 ++++++++++++++++++++ MdePkg/MdePkg.dec | 3 + 2 files changed, 61 insertions(+) diff --git a/MdePkg/Include/Ppi/MmCommunication3.h b/MdePkg/Include/Ppi/MmCommunication3.h new file mode 100644 index 000000000000..11924099b4c3 --- /dev/null +++ b/MdePkg/Include/Ppi/MmCommunication3.h @@ -0,0 +1,58 @@ +/** @file + EFI MM Communication v3 PPI definition. + + This Ppi provides a means of communicating between PEIM and MMI + handlers inside of MM. + +Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#ifndef MM_COMMUNICATION3_PPI_H_ +#define MM_COMMUNICATION3_PPI_H_ + +#include + +#define EFI_PEI_MM_COMMUNICATION3_PPI_GUID \ + { \ + 0xe70febf6, 0x13ef, 0x4a21, { 0x89, 0x9e, 0xb2, 0x36, 0xf8, 0x25, 0xff, 0xc9 } \ + } + +typedef struct _EFI_PEI_MM_COMMUNICATION3_PPI EFI_PEI_MM_COMMUNICATION3_PPI; + +/** + Communicates with a registered handler. + + This function provides a service to send and receive messages from a registered UEFI service. + + @param[in] This The EFI_PEI_MM_COMMUNICATE3 instance. + @param[in, out] CommBuffer A pointer to the buffer to convey into MMRAM. + @param[in, out] CommSize The size of the data buffer being passed in.On exit, the size of data + being returned. Zero if the handler does not wish to reply with any data. + + @retval EFI_SUCCESS The message was successfully posted. + @retval EFI_INVALID_PARAMETER The CommBuffer was NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_MM_COMMUNICATE3)( + IN CONST EFI_PEI_MM_COMMUNICATION3_PPI *This, + IN OUT VOID *CommBuffer, + IN OUT UINTN *CommSize + ); + +/// +/// EFI MM Communication PPI provides runtime services for communicating +/// between DXE drivers and a registered SMI handler. +/// +struct _EFI_PEI_MM_COMMUNICATION3_PPI { + EFI_PEI_MM_COMMUNICATE3 Communicate; +}; + +extern EFI_GUID gEfiPeiMmCommunication3PpiGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 3168534951c1..c194d6225501 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1006,6 +1006,9 @@ [Ppis] ## Include/Ppi/DelayedDispatch.h gEfiPeiDelayedDispatchPpiGuid = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }} + ## Include/Ppi/MmCommunication3.h + gEfiPeiMmCommunication3PpiGuid = { 0xe70febf6, 0x13ef, 0x4a21, { 0x89, 0x9e, 0xb2, 0x36, 0xf8, 0x25, 0xff, 0xc9 }} + [Protocols] ## Include/Protocol/Pcd.h gPcdProtocolGuid = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }} -- 2.32.0.windows.1