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