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