From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mx.groups.io with SMTP id smtpd.web12.4665.1631751272916530962 for ; Wed, 15 Sep 2021 17:14:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kGGI2Yma; spf=pass (domain: gmail.com, ip: 209.85.216.45, mailfrom: kuqin12@gmail.com) Received: by mail-pj1-f45.google.com with SMTP id j1so3311886pjv.3 for ; Wed, 15 Sep 2021 17:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V9hucTMR15DY0qYjVQQYV0qt7EzUVo6+O1uzUTAH6DQ=; b=kGGI2YmassX05VjKW0GrhUtY3XgHJZhYs2zOAUDCMzz1JXaLMh1LauZzzoqmXo5ucs f3/6ItV7+ykQTve5b2Cx6kE6Zo0hjx/qiFqrG/Y/39k3MUyNMv6IGnn/ClqL+EU/Nv6u 9qxtc/GNN0/TsniTaLMf9SV7GpqaQUaCsBEqOpKTz1M0Opi2WtIMMiuGEnzrzztP8FOp G5JI9Yh78nGAzKzhiRyEzGrI4wJ0iPXUxuICI1FCVt8eXJQC3eTTkTgfjrVeaxeCJg6R QChzuFjiTABrPaG/6vC+Ka9PfxRQv5Wnj/SiDIMoCKUb/AVT9u5oOh6PKlAyaWdkS0B1 3Ndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V9hucTMR15DY0qYjVQQYV0qt7EzUVo6+O1uzUTAH6DQ=; b=PNG/q6jLfAY9ViNq4U5axs0j7HJv8Dfgm5n+GkTwz1HLQLM29XJ/fOQK4FEcUFlPN1 IYW3WWLOoPNlQCphOb3S23f/PXnLDdeeR4DEtOWeflAQRylV1Dj4y/CybDuz84zSm3fw mBS6BPnF9bN+19+/fSsJLx4MLeHb1Mhq53bQGuMVF8gvzyJMteQCKen+uVdPp1hh0Fk3 Cemu4tOj0xVn6B6QiOkNw6GeNZLn/p8rfgXE5wT0O+Scrr/TBlz5pL5ilVXDYCduwTGD 01ZqUbxviGyKgpXPgTJTvCxOA4tteRjyX7mCVbbMSPDibbpP2JjXttqYrTxswyb7+E4i 6FYQ== X-Gm-Message-State: AOAM532exeKZ1gUmGd8NfjrvE3hJrXxLAjXIMNXL1lRwg8XoQlL6vVUr z1w844rKiumaKrJitFkpeX+vT3iKrRk= X-Google-Smtp-Source: ABdhPJwCskr4M4+kEzyzxBsfJwz/YZ6ty9QxLX1YMsWf/yNVrLGC3ME2rRP8cC8tnPag/7PJkKUjag== X-Received: by 2002:a17:902:8647:b0:139:edc9:ed43 with SMTP id y7-20020a170902864700b00139edc9ed43mr1977924plt.23.1631751272249; Wed, 15 Sep 2021 17:14:32 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([50.47.113.238]) by smtp.gmail.com with ESMTPSA id q1sm844977pfj.132.2021.09.15.17.14.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 17:14:31 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Sean Brogan Subject: [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI Date: Wed, 15 Sep 2021 17:14:18 -0700 Message-Id: <20210916001420.459-2-kuqin12@gmail.com> X-Mailer: git-send-email 2.32.0.windows.1 In-Reply-To: <20210916001420.459-1-kuqin12@gmail.com> References: <20210916001420.459-1-kuqin12@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629 MM Communication PPI was defined in PI Specification since v1.5. This change added definition of such PPI and related GUIDs into MdePkg. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Sean Brogan Signed-off-by: Kun Qin --- MdePkg/Include/Ppi/MmCommunication.h | 72 ++++++++++++++++++++ MdePkg/MdePkg.dec | 3 + 2 files changed, 75 insertions(+) diff --git a/MdePkg/Include/Ppi/MmCommunication.h b/MdePkg/Include/Ppi/MmCommunication.h new file mode 100644 index 000000000000..7e06da2ec088 --- /dev/null +++ b/MdePkg/Include/Ppi/MmCommunication.h @@ -0,0 +1,72 @@ +/** @file + EFI MM Communication PPI definition. + + This PPI provides a means of communicating between drivers outside + of MM and MMI handlers inside of MM in PEI phase. + + Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#ifndef MM_COMMUNICATION_PPI_H_ +#define MM_COMMUNICATION_PPI_H_ + +#define EFI_PEI_MM_COMMUNICATION_PPI_GUID \ + { \ + 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \ + } + +typedef struct _EFI_PEI_MM_COMMUNICATION_PPI EFI_PEI_MM_COMMUNICATION_PPI; + +/** + Communicates with a registered handler. + + This function provides a service to send and receive messages from a registered PEI service. + The EFI_PEI_MM_COMMUNICATION_PPI driver is responsible for doing any of the copies such that + the data lives in PEI-service-accessible RAM. + + A given implementation of the EFI_PEI_MM_COMMUNICATION_PPI may choose to use the + EFI_MM_CONTROL_PPI for effecting the mode transition, or it may use some other method. + + The agent invoking the communication interface must be physical/virtually 1:1 mapped. + + To avoid confusion in interpreting frames, the CommBuffer parameter should always begin with + EFI_MM_COMMUNICATE_HEADER. The header data is mandatory for messages sent into the MM agent. + + Once inside of MM, the MM infrastructure will call all registered handlers with the same + HandlerType as the GUID specified by HeaderGuid and the CommBuffer pointing to Data. + + This function is not reentrant. + + @param[in] This The EFI_PEI_MM_COMMUNICATION_PPI instance. + @param[in] CommBuffer Pointer to the buffer to convey into MMRAM. + @param[in] 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 buffer was NULL. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_MM_COMMUNICATE)( + IN CONST EFI_PEI_MM_COMMUNICATION_PPI *This, + IN OUT VOID *CommBuffer, + IN OUT UINTN *CommSize + ); + +/// +/// EFI MM Communication PPI provides services for communicating between PEIM and a registered +/// MMI handler. +/// +struct _EFI_PEI_MM_COMMUNICATION_PPI { + EFI_PEI_MM_COMMUNICATE Communicate; +}; + +extern EFI_GUID gEfiPeiMmCommunicationPpiGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index a28a2daaffa8..9cdc915ebae9 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -991,6 +991,9 @@ [Ppis] ## Include/Ppi/MmConfiguration.h gEfiPeiMmConfigurationPpi = { 0xc109319, 0xc149, 0x450e, { 0xa3, 0xe3, 0xb9, 0xba, 0xdd, 0x9d, 0xc3, 0xa4 } } + ## Include/Ppi/MmCommunication.h + gEfiPeiMmCommunicationPpiGuid = { 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } } + # # PPIs defined in PI 1.7. # -- 2.32.0.windows.1