2 The internal header file that declared a data structure that is shared
3 between the SMM IPL and the SMM Core.
5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef _PI_SMM_CORE_PRIVATE_DATA_H_
11 #define _PI_SMM_CORE_PRIVATE_DATA_H_
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.
25 #define COMM_BUFFER_SMM_DISPATCH_ERROR 0x00
26 #define COMM_BUFFER_SMM_DISPATCH_SUCCESS 0x01
27 #define COMM_BUFFER_SMM_DISPATCH_RESTART 0x02
30 /// Signature for the private structure shared between the SMM IPL and the SMM Core
32 #define SMM_CORE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('s', 'm', 'm', 'c')
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
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.
52 EFI_HANDLE SmmIplImageHandle
;
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.
58 UINTN SmramRangeCount
;
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.
64 EFI_SMRAM_DESCRIPTOR
*SmramRanges
;
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
75 EFI_SMM_ENTRY_POINT SmmEntryPoint
;
78 /// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.
80 BOOLEAN SmmEntryPointRegistered
;
83 /// Boolean flag set to TRUE while an SMI is being processed by the SMM Core.
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
92 EFI_SMM_SYSTEM_TABLE2
*Smst
;
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.
99 VOID
*CommunicationBuffer
;
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.
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.
112 EFI_STATUS ReturnStatus
;
114 EFI_PHYSICAL_ADDRESS PiSmmCoreImageBase
;
115 UINT64 PiSmmCoreImageSize
;
116 EFI_PHYSICAL_ADDRESS PiSmmCoreEntryPoint
;
117 } SMM_CORE_PRIVATE_DATA
;