]> git.proxmox.com Git - mirror_edk2.git/blob - StandaloneMmPkg/Include/Guid/MmCoreData.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / StandaloneMmPkg / Include / Guid / MmCoreData.h
1 /** @file
2 MM Core data.
3
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2018 - 2021, Arm Limited. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __MM_CORE_DATA_H__
11 #define __MM_CORE_DATA_H__
12
13 #define MM_CORE_DATA_HOB_GUID \
14 { 0xa160bf99, 0x2aa4, 0x4d7d, { 0x99, 0x93, 0x89, 0x9c, 0xb1, 0x2d, 0xf3, 0x76 }}
15
16 extern EFI_GUID gMmCoreDataHobGuid;
17
18 typedef struct {
19 //
20 // Address pointer to MM_CORE_PRIVATE_DATA
21 //
22 EFI_PHYSICAL_ADDRESS Address;
23 } MM_CORE_DATA_HOB_DATA;
24
25 ///
26 /// Define values for the communications buffer used when gEfiEventDxeDispatchGuid is
27 /// event signaled. This event is signaled by the DXE Core each time the DXE Core
28 /// dispatcher has completed its work. When this event is signaled, the MM Core
29 /// if notified, so the MM Core can dispatch MM drivers. If COMM_BUFFER_MM_DISPATCH_ERROR
30 /// is returned in the communication buffer, then an error occurred dispatching MM
31 /// Drivers. If COMM_BUFFER_MM_DISPATCH_SUCCESS is returned, then the MM Core
32 /// dispatched all the drivers it could. If COMM_BUFFER_MM_DISPATCH_RESTART is
33 /// returned, then the MM Core just dispatched the MM Driver that registered
34 /// the MM Entry Point enabling the use of MM Mode. In this case, the MM Core
35 /// should be notified again to dispatch more MM Drivers using MM Mode.
36 ///
37 #define COMM_BUFFER_MM_DISPATCH_ERROR 0x00
38 #define COMM_BUFFER_MM_DISPATCH_SUCCESS 0x01
39 #define COMM_BUFFER_MM_DISPATCH_RESTART 0x02
40
41 ///
42 /// Signature for the private structure shared between the MM IPL and the MM Core
43 ///
44 #define MM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('m', 'm', 'i', 'c')
45
46 ///
47 /// Private structure that is used to share information between the MM IPL and
48 /// the MM Core. This structure is allocated from memory of type EfiRuntimeServicesData.
49 /// Since runtime memory types are converted to available memory when a legacy boot
50 /// is performed, the MM Core must not access any fields of this structure if a legacy
51 /// boot is performed. As a result, the MM IPL must create an event notification
52 /// for the Legacy Boot event and notify the MM Core that a legacy boot is being
53 /// performed. The MM Core can then use this information to filter accesses to
54 /// thos structure.
55 ///
56 typedef struct {
57 UINT64 Signature;
58
59 ///
60 /// The number of MMRAM ranges passed from the MM IPL to the MM Core. The MM
61 /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.
62 ///
63 UINT64 MmramRangeCount;
64
65 ///
66 /// A table of MMRAM ranges passed from the MM IPL to the MM Core. The MM
67 /// Core uses these ranges of MMRAM to initialize the MM Core memory manager.
68 ///
69 EFI_PHYSICAL_ADDRESS MmramRanges;
70
71 ///
72 /// The MM Foundation Entry Point. The MM Core fills in this field when the
73 /// MM Core is initialized. The MM IPL is responsbile for registering this entry
74 /// point with the MM Configuration Protocol. The MM Configuration Protocol may
75 /// not be available at the time the MM IPL and MM Core are started, so the MM IPL
76 /// sets up a protocol notification on the MM Configuration Protocol and registers
77 /// the MM Foundation Entry Point as soon as the MM Configuration Protocol is
78 /// available.
79 ///
80 EFI_PHYSICAL_ADDRESS MmEntryPoint;
81
82 ///
83 /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.
84 ///
85 BOOLEAN MmEntryPointRegistered;
86
87 ///
88 /// Boolean flag set to TRUE while an MMI is being processed by the MM Core.
89 ///
90 BOOLEAN InMm;
91
92 ///
93 /// This field is set by the MM Core then the MM Core is initialized. This field is
94 /// used by the MM Base 2 Protocol and MM Communication Protocol implementations in
95 /// the MM IPL.
96 ///
97 EFI_PHYSICAL_ADDRESS Mmst;
98
99 ///
100 /// This field is used by the MM Communication Protocol to pass a buffer into
101 /// a software MMI handler and for the software MMI handler to pass a buffer back to
102 /// the caller of the MM Communication Protocol.
103 ///
104 EFI_PHYSICAL_ADDRESS CommunicationBuffer;
105
106 ///
107 /// This field is used by the MM Communication Protocol to pass the size of a buffer,
108 /// in bytes, into a software MMI handler and for the software MMI handler to pass the
109 /// size, in bytes, of a buffer back to the caller of the MM Communication Protocol.
110 ///
111 UINT64 BufferSize;
112
113 ///
114 /// This field is used by the MM Communication Protocol to pass the return status from
115 /// a software MMI handler back to the caller of the MM Communication Protocol.
116 ///
117 UINT64 ReturnStatus;
118
119 EFI_PHYSICAL_ADDRESS MmCoreImageBase;
120 UINT64 MmCoreImageSize;
121 EFI_PHYSICAL_ADDRESS MmCoreEntryPoint;
122
123 EFI_PHYSICAL_ADDRESS StandaloneBfvAddress;
124 } MM_CORE_PRIVATE_DATA;
125
126 #endif