4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2018, ARM Limited. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __MM_CORE_DATA_H__
11 #define __MM_CORE_DATA_H__
13 #define MM_CORE_DATA_HOB_GUID \
14 { 0xa160bf99, 0x2aa4, 0x4d7d, { 0x99, 0x93, 0x89, 0x9c, 0xb1, 0x2d, 0xf3, 0x76 }}
16 extern EFI_GUID gMmCoreDataHobGuid
;
20 // Address pointer to MM_CORE_PRIVATE_DATA
22 EFI_PHYSICAL_ADDRESS Address
;
23 } MM_CORE_DATA_HOB_DATA
;
27 /// Define values for the communications buffer used when gEfiEventDxeDispatchGuid is
28 /// event signaled. This event is signaled by the DXE Core each time the DXE Core
29 /// dispatcher has completed its work. When this event is signaled, the MM Core
30 /// if notified, so the MM Core can dispatch MM drivers. If COMM_BUFFER_MM_DISPATCH_ERROR
31 /// is returned in the communication buffer, then an error occurred dispatching MM
32 /// Drivers. If COMM_BUFFER_MM_DISPATCH_SUCCESS is returned, then the MM Core
33 /// dispatched all the drivers it could. If COMM_BUFFER_MM_DISPATCH_RESTART is
34 /// returned, then the MM Core just dispatched the MM Driver that registered
35 /// the MM Entry Point enabling the use of MM Mode. In this case, the MM Core
36 /// should be notified again to dispatch more MM Drivers using MM Mode.
38 #define COMM_BUFFER_MM_DISPATCH_ERROR 0x00
39 #define COMM_BUFFER_MM_DISPATCH_SUCCESS 0x01
40 #define COMM_BUFFER_MM_DISPATCH_RESTART 0x02
43 /// Signature for the private structure shared between the MM IPL and the MM Core
45 #define MM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('m', 'm', 'i', 'c')
48 /// Private structure that is used to share information between the MM IPL and
49 /// the MM Core. This structure is allocated from memory of type EfiRuntimeServicesData.
50 /// Since runtime memory types are converted to available memory when a legacy boot
51 /// is performed, the MM Core must not access any fields of this structure if a legacy
52 /// boot is performed. As a result, the MM IPL must create an event notification
53 /// for the Legacy Boot event and notify the MM Core that a legacy boot is being
54 /// performed. The MM Core can then use this information to filter accesses to
61 /// The number of MMRAM ranges passed from the MM IPL to the MM Core. The MM
62 /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.
64 UINT64 MmramRangeCount
;
67 /// A table of MMRAM ranges passed from the MM IPL to the MM Core. The MM
68 /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.
70 EFI_PHYSICAL_ADDRESS MmramRanges
;
73 /// The MM Foundation Entry Point. The MM Core fills in this field when the
74 /// MM Core is initialized. The MM IPL is responsbile for registering this entry
75 /// point with the MM Configuration Protocol. The MM Configuration Protocol may
76 /// not be available at the time the MM IPL and MM Core are started, so the MM IPL
77 /// sets up a protocol notification on the MM Configuration Protocol and registers
78 /// the MM Foundation Entry Point as soon as the MM Configuration Protocol is
81 EFI_PHYSICAL_ADDRESS MmEntryPoint
;
84 /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.
86 BOOLEAN MmEntryPointRegistered
;
89 /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.
94 /// This field is set by the MM Core then the MM Core is initialized. This field is
95 /// used by the MM Base 2 Protocol and MM Communication Protocol implementations in
98 EFI_PHYSICAL_ADDRESS Mmst
;
101 /// This field is used by the MM Communicatioon Protocol to pass a buffer into
102 /// a software MMI handler and for the software MMI handler to pass a buffer back to
103 /// the caller of the MM Communication Protocol.
105 EFI_PHYSICAL_ADDRESS CommunicationBuffer
;
108 /// This field is used by the MM Communicatioon Protocol to pass the size of a buffer,
109 /// in bytes, into a software MMI handler and for the software MMI handler to pass the
110 /// size, in bytes, of a buffer back to the caller of the MM Communication Protocol.
115 /// This field is used by the MM Communication Protocol to pass the return status from
116 /// a software MMI handler back to the caller of the MM Communication Protocol.
120 EFI_PHYSICAL_ADDRESS MmCoreImageBase
;
121 UINT64 MmCoreImageSize
;
122 EFI_PHYSICAL_ADDRESS MmCoreEntryPoint
;
124 EFI_PHYSICAL_ADDRESS StandaloneBfvAddress
;
125 } MM_CORE_PRIVATE_DATA
;