--- /dev/null
+/** @file\r
+ MM Core data.\r
+\r
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2018, ARM Limited. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __MM_CORE_DATA_H__\r
+#define __MM_CORE_DATA_H__\r
+\r
+#define MM_CORE_DATA_HOB_GUID \\r
+ { 0xa160bf99, 0x2aa4, 0x4d7d, { 0x99, 0x93, 0x89, 0x9c, 0xb1, 0x2d, 0xf3, 0x76 }}\r
+\r
+extern EFI_GUID gMmCoreDataHobGuid;\r
+\r
+typedef struct {\r
+ //\r
+ // Address pointer to MM_CORE_PRIVATE_DATA\r
+ //\r
+ EFI_PHYSICAL_ADDRESS Address;\r
+} MM_CORE_DATA_HOB_DATA;\r
+\r
+\r
+///\r
+/// Define values for the communications buffer used when gEfiEventDxeDispatchGuid is\r
+/// event signaled. This event is signaled by the DXE Core each time the DXE Core\r
+/// dispatcher has completed its work. When this event is signaled, the MM Core\r
+/// if notified, so the MM Core can dispatch MM drivers. If COMM_BUFFER_MM_DISPATCH_ERROR\r
+/// is returned in the communication buffer, then an error occurred dispatching MM\r
+/// Drivers. If COMM_BUFFER_MM_DISPATCH_SUCCESS is returned, then the MM Core\r
+/// dispatched all the drivers it could. If COMM_BUFFER_MM_DISPATCH_RESTART is\r
+/// returned, then the MM Core just dispatched the MM Driver that registered\r
+/// the MM Entry Point enabling the use of MM Mode. In this case, the MM Core\r
+/// should be notified again to dispatch more MM Drivers using MM Mode.\r
+///\r
+#define COMM_BUFFER_MM_DISPATCH_ERROR 0x00\r
+#define COMM_BUFFER_MM_DISPATCH_SUCCESS 0x01\r
+#define COMM_BUFFER_MM_DISPATCH_RESTART 0x02\r
+\r
+///\r
+/// Signature for the private structure shared between the MM IPL and the MM Core\r
+///\r
+#define MM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('m', 'm', 'i', 'c')\r
+\r
+///\r
+/// Private structure that is used to share information between the MM IPL and\r
+/// the MM Core. This structure is allocated from memory of type EfiRuntimeServicesData.\r
+/// Since runtime memory types are converted to available memory when a legacy boot\r
+/// is performed, the MM Core must not access any fields of this structure if a legacy\r
+/// boot is performed. As a result, the MM IPL must create an event notification\r
+/// for the Legacy Boot event and notify the MM Core that a legacy boot is being\r
+/// performed. The MM Core can then use this information to filter accesses to\r
+/// thos structure.\r
+///\r
+typedef struct {\r
+ UINT64 Signature;\r
+\r
+ ///\r
+ /// The number of MMRAM ranges passed from the MM IPL to the MM Core. The MM\r
+ /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.\r
+ ///\r
+ UINT64 MmramRangeCount;\r
+\r
+ ///\r
+ /// A table of MMRAM ranges passed from the MM IPL to the MM Core. The MM\r
+ /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.\r
+ ///\r
+ EFI_PHYSICAL_ADDRESS MmramRanges;\r
+\r
+ ///\r
+ /// The MM Foundation Entry Point. The MM Core fills in this field when the\r
+ /// MM Core is initialized. The MM IPL is responsbile for registering this entry\r
+ /// point with the MM Configuration Protocol. The MM Configuration Protocol may\r
+ /// not be available at the time the MM IPL and MM Core are started, so the MM IPL\r
+ /// sets up a protocol notification on the MM Configuration Protocol and registers\r
+ /// the MM Foundation Entry Point as soon as the MM Configuration Protocol is\r
+ /// available.\r
+ ///\r
+ EFI_PHYSICAL_ADDRESS MmEntryPoint;\r
+\r
+ ///\r
+ /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.\r
+ ///\r
+ BOOLEAN MmEntryPointRegistered;\r
+\r
+ ///\r
+ /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.\r
+ ///\r
+ BOOLEAN InMm;\r
+\r
+ ///\r
+ /// This field is set by the MM Core then the MM Core is initialized. This field is\r
+ /// used by the MM Base 2 Protocol and MM Communication Protocol implementations in\r
+ /// the MM IPL.\r
+ ///\r
+ EFI_PHYSICAL_ADDRESS Mmst;\r
+\r
+ ///\r
+ /// This field is used by the MM Communicatioon Protocol to pass a buffer into\r
+ /// a software MMI handler and for the software MMI handler to pass a buffer back to\r
+ /// the caller of the MM Communication Protocol.\r
+ ///\r
+ EFI_PHYSICAL_ADDRESS CommunicationBuffer;\r
+\r
+ ///\r
+ /// This field is used by the MM Communicatioon Protocol to pass the size of a buffer,\r
+ /// in bytes, into a software MMI handler and for the software MMI handler to pass the\r
+ /// size, in bytes, of a buffer back to the caller of the MM Communication Protocol.\r
+ ///\r
+ UINT64 BufferSize;\r
+\r
+ ///\r
+ /// This field is used by the MM Communication Protocol to pass the return status from\r
+ /// a software MMI handler back to the caller of the MM Communication Protocol.\r
+ ///\r
+ UINT64 ReturnStatus;\r
+\r
+ EFI_PHYSICAL_ADDRESS MmCoreImageBase;\r
+ UINT64 MmCoreImageSize;\r
+ EFI_PHYSICAL_ADDRESS MmCoreEntryPoint;\r
+\r
+ EFI_PHYSICAL_ADDRESS StandaloneBfvAddress;\r
+} MM_CORE_PRIVATE_DATA;\r
+\r
+#endif\r