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