]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/PiSmmCore/PiSmmCorePrivateData.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmCorePrivateData.h
CommitLineData
e42e9404 1/** @file\r
2 The internal header file that declared a data structure that is shared\r
3 between the SMM IPL and the SMM Core.\r
4\r
d1102dba
LG
5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials are licensed and made available\r
7 under the terms and conditions of the BSD License which accompanies this\r
8 distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
e42e9404 10\r
d1102dba
LG
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
e42e9404 13\r
14**/\r
15\r
16#ifndef _PI_SMM_CORE_PRIVATE_DATA_H_\r
17#define _PI_SMM_CORE_PRIVATE_DATA_H_\r
18\r
5657b268 19///\r
20/// Define values for the communications buffer used when gEfiEventDxeDispatchGuid is\r
d1102dba 21/// event signaled. This event is signaled by the DXE Core each time the DXE Core\r
5657b268 22/// dispatcher has completed its work. When this event is signaled, the SMM Core\r
23/// if notified, so the SMM Core can dispatch SMM drivers. If COMM_BUFFER_SMM_DISPATCH_ERROR\r
24/// is returned in the communication buffer, then an error occurred dispatching SMM\r
d1102dba
LG
25/// Drivers. If COMM_BUFFER_SMM_DISPATCH_SUCCESS is returned, then the SMM Core\r
26/// dispatched all the drivers it could. If COMM_BUFFER_SMM_DISPATCH_RESTART is\r
5657b268 27/// returned, then the SMM Core just dispatched the SMM Driver that registered\r
28/// the SMM Entry Point enabling the use of SMM Mode. In this case, the SMM Core\r
29/// should be notified again to dispatch more SMM Drivers using SMM Mode.\r
30///\r
31#define COMM_BUFFER_SMM_DISPATCH_ERROR 0x00\r
32#define COMM_BUFFER_SMM_DISPATCH_SUCCESS 0x01\r
33#define COMM_BUFFER_SMM_DISPATCH_RESTART 0x02\r
34\r
e42e9404 35///\r
36/// Signature for the private structure shared between the SMM IPL and the SMM Core\r
37///\r
38#define SMM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('s', 'm', 'm', 'c')\r
39\r
40///\r
d1102dba 41/// Private structure that is used to share information between the SMM IPL and\r
e42e9404 42/// the SMM Core. This structure is allocated from memory of type EfiRuntimeServicesData.\r
d1102dba
LG
43/// Since runtime memory types are converted to available memory when a legacy boot\r
44/// is performed, the SMM Core must not access any fields of this structure if a legacy\r
45/// boot is performed. As a result, the SMM IPL must create an event notification\r
46/// for the Legacy Boot event and notify the SMM Core that a legacy boot is being\r
47/// performed. The SMM Core can then use this information to filter accesses to\r
e42e9404 48/// thos structure.\r
49///\r
50typedef struct {\r
51 UINTN Signature;\r
52\r
53 ///\r
54 /// The ImageHandle passed into the entry point of the SMM IPL. This ImageHandle\r
55 /// is used by the SMM Core to fill in the ParentImageHandle field of the Loaded\r
56 /// Image Protocol for each SMM Driver that is dispatched by the SMM Core.\r
57 ///\r
58 EFI_HANDLE SmmIplImageHandle;\r
59\r
60 ///\r
61 /// The number of SMRAM ranges passed from the SMM IPL to the SMM Core. The SMM\r
62 /// Core uses these ranges of SMRAM to initialize the SMM Core memory manager.\r
63 ///\r
64 UINTN SmramRangeCount;\r
65\r
66 ///\r
67 /// A table of SMRAM ranges passed from the SMM IPL to the SMM Core. The SMM\r
68 /// Core uses these ranges of SMRAM to initialize the SMM Core memory manager.\r
69 ///\r
70 EFI_SMRAM_DESCRIPTOR *SmramRanges;\r
71\r
72 ///\r
d1102dba
LG
73 /// The SMM Foundation Entry Point. The SMM Core fills in this field when the\r
74 /// SMM Core is initialized. The SMM IPL is responsbile for registering this entry\r
75 /// point with the SMM Configuration Protocol. The SMM Configuration Protocol may\r
e42e9404 76 /// not be available at the time the SMM IPL and SMM Core are started, so the SMM IPL\r
d1102dba
LG
77 /// sets up a protocol notification on the SMM Configuration Protocol and registers\r
78 /// the SMM Foundation Entry Point as soon as the SMM Configuration Protocol is\r
e42e9404 79 /// available.\r
80 ///\r
81 EFI_SMM_ENTRY_POINT SmmEntryPoint;\r
d1102dba 82\r
e42e9404 83 ///\r
84 /// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.\r
d1102dba 85 ///\r
e42e9404 86 BOOLEAN SmmEntryPointRegistered;\r
87\r
88 ///\r
89 /// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.\r
d1102dba 90 ///\r
e42e9404 91 BOOLEAN InSmm;\r
92\r
93 ///\r
94 /// This field is set by the SMM Core then the SMM Core is initialized. This field is\r
95 /// used by the SMM Base 2 Protocol and SMM Communication Protocol implementations in\r
d1102dba 96 /// the SMM IPL.\r
e42e9404 97 ///\r
98 EFI_SMM_SYSTEM_TABLE2 *Smst;\r
99\r
100 ///\r
d1102dba 101 /// This field is used by the SMM Communicatioon Protocol to pass a buffer into\r
e42e9404 102 /// a software SMI handler and for the software SMI handler to pass a buffer back to\r
d1102dba 103 /// the caller of the SMM Communication Protocol.\r
e42e9404 104 ///\r
105 VOID *CommunicationBuffer;\r
106\r
107 ///\r
108 /// This field is used by the SMM Communicatioon Protocol to pass the size of a buffer,\r
d1102dba 109 /// in bytes, into a software SMI handler and for the software SMI handler to pass the\r
e42e9404 110 /// size, in bytes, of a buffer back to the caller of the SMM Communication Protocol.\r
111 ///\r
ab780ebf 112 UINTN BufferSize;\r
e42e9404 113\r
114 ///\r
115 /// This field is used by the SMM Communication Protocol to pass the return status from\r
116 /// a software SMI handler back to the caller of the SMM Communication Protocol.\r
117 ///\r
118 EFI_STATUS ReturnStatus;\r
84edd20b
SZ
119\r
120 EFI_PHYSICAL_ADDRESS PiSmmCoreImageBase;\r
121 UINT64 PiSmmCoreImageSize;\r
122 EFI_PHYSICAL_ADDRESS PiSmmCoreEntryPoint;\r
e42e9404 123} SMM_CORE_PRIVATE_DATA;\r
124\r
125#endif\r