summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorHongbin1 Zhang <hongbin1.zhang@intel.com>2024-05-31 15:26:10 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-28 15:25:27 +0000
commitff04469d33512d29a5b1afa9c99ec3a152795360 (patch)
tree0ca9188b14412bf295159cadbf31e5ac54366ec0 /MdeModulePkg
parent82b1f691961f3e845e2e46873823c4843b660a7a (diff)
downloadedk2-ff04469d33512d29a5b1afa9c99ec3a152795360.zip
edk2-ff04469d33512d29a5b1afa9c99ec3a152795360.tar.gz
edk2-ff04469d33512d29a5b1afa9c99ec3a152795360.tar.bz2
MdeModulePkg: Add MM Communication Buffer definition
The MM communicate buffer facilitates data sharing between non-MM and MM code. The MM IPL code allocates a "fixed" runtime type memory as the MM communication buffer, and communicates its address and size to MM Core via MmCommBuffer GUIDed HOB. Here, "fixed" implies that the buffer's location remains constant throughout the boot process. Data is exchanged between the MM Communication PPI/Protocol and a software MMI handler using this fixed MM communication buffer. Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com> Co-authored-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Co-authored-by: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Include/Guid/MmCommBuffer.h63
-rw-r--r--MdeModulePkg/MdeModulePkg.dec3
2 files changed, 66 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Guid/MmCommBuffer.h b/MdeModulePkg/Include/Guid/MmCommBuffer.h
new file mode 100644
index 0000000..df4ea31
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/MmCommBuffer.h
@@ -0,0 +1,63 @@
+/** @file
+ MM Communication buffer data.
+
+Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef MM_COMM_BUFFER_H_
+#define MM_COMM_BUFFER_H_
+
+///
+/// The GUID of the MM Communication buffer HOB.
+///
+#define MM_COMM_BUFFER_HOB_GUID \
+ { 0x6c2a2520, 0x0131, 0x4aee, { 0xa7, 0x50, 0xcc, 0x38, 0x4a, 0xac, 0xe8, 0xc6 }}
+
+///
+/// The MM communicate buffer facilitates data sharing between non-MM and MM code.
+/// The MM IPL code allocates a "fixed" runtime type memory as the MM communication buffer,
+/// and communicates its address and size to MM Core via MmCommBuffer GUIDed HOB.
+/// Here, "fixed" implies that the buffer's location remains constant throughout the boot process.
+/// Data is exchanged between the MM Communication PPI/Protocol and a software MMI handler
+/// using this fixed MM communication buffer.
+///
+typedef struct {
+ ///
+ /// The address of the 4-KiB aligned fixed MM communication buffer.
+ ///
+ EFI_PHYSICAL_ADDRESS PhysicalStart;
+
+ ///
+ /// Size of the fixed MM communication buffer, in 4KiB pages.
+ ///
+ UINT64 NumberOfPages;
+
+ ///
+ /// Point to MM_COMM_BUFFER_STATUS structure.
+ ///
+ EFI_PHYSICAL_ADDRESS Status;
+} MM_COMM_BUFFER;
+
+typedef struct {
+ ///
+ /// Whether the data in the fixed MM communication buffer is valid when entering from non-MM to MM.
+ ///
+ BOOLEAN IsCommBufferValid;
+
+ ///
+ /// The return status when returning from MM to non-MM.
+ ///
+ UINT64 ReturnStatus;
+
+ ///
+ /// The size in bytes of the output buffer when returning from MM to non-MM.
+ ///
+ UINT64 ReturnBufferSize;
+} MM_COMM_BUFFER_STATUS;
+
+extern EFI_GUID gMmCommBufferHobGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 693e459..e71a4dd 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -485,6 +485,9 @@
## HOB GUID to get ACPI table after FSP is done. The ACPI table that related SOC will be pass by this HOB.
gAcpiTableHobGuid = { 0xf9886b57, 0x8a35, 0x455e, { 0xbb, 0xb1, 0x14, 0x65, 0x5e, 0x7b, 0xe7, 0xec }}
+ ## Include/Guid/MmCommBuffer.h
+ gMmCommBufferHobGuid = { 0x6c2a2520, 0x0131, 0x4aee, { 0xa7, 0x50, 0xcc, 0x38, 0x4a, 0xac, 0xe8, 0xc6 }}
+
[Ppis]
## Include/Ppi/FirmwareVolumeShadowPpi.h
gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }