]>
Commit | Line | Data |
---|---|---|
04c5d169 | 1 | /** @file\r |
65352665 | 2 | Common definitions in the Platform Initialization Specification version 1.4a\r |
04c5d169 | 3 | VOLUME 4 System Management Mode Core Interface version.\r |
4 | \r | |
9095d37b | 5 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9df063a0 | 6 | This program and the accompanying materials\r |
04c5d169 | 7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
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 | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _PI_SMMCIS_H_\r | |
17 | #define _PI_SMMCIS_H_\r | |
18 | \r | |
2f208e59 | 19 | #include <Pi/PiMmCis.h>\r |
8fc71dec | 20 | #include <Protocol/SmmCpuIo2.h>\r |
04c5d169 | 21 | \r |
a2bb197e | 22 | typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2;\r |
2f208e59 ED |
23 | //\r |
24 | // Define new MM related definition introduced by PI 1.5.\r | |
25 | //\r | |
26 | #define SMM_SMST_SIGNATURE MM_MMST_SIGNATURE\r | |
27 | #define SMM_SPECIFICATION_MAJOR_REVISION MM_SPECIFICATION_MAJOR_REVISION\r | |
28 | #define SMM_SPECIFICATION_MINOR_REVISION MM_SPECIFICATION_MINOR_REVISION\r | |
29 | #define EFI_SMM_SYSTEM_TABLE2_REVISION EFI_MM_SYSTEM_TABLE_REVISION\r | |
04c5d169 | 30 | \r |
31 | /**\r | |
32 | Adds, updates, or removes a configuration table entry from the System Management System Table.\r | |
33 | \r | |
34 | The SmmInstallConfigurationTable() function is used to maintain the list\r | |
35 | of configuration tables that are stored in the System Management System\r | |
36 | Table. The list is stored as an array of (GUID, Pointer) pairs. The list\r | |
37 | must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.\r | |
38 | \r | |
39 | @param[in] SystemTable A pointer to the SMM System Table (SMST).\r | |
40 | @param[in] Guid A pointer to the GUID for the entry to add, update, or remove.\r | |
41 | @param[in] Table A pointer to the buffer of the table to add.\r | |
42 | @param[in] TableSize The size of the table to install.\r | |
43 | \r | |
44 | @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r | |
45 | @retval EFI_INVALID_PARAMETER Guid is not valid.\r | |
46 | @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.\r | |
47 | @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r | |
48 | **/\r | |
49 | typedef\r | |
50 | EFI_STATUS\r | |
a2bb197e | 51 | (EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)(\r |
2f208e59 ED |
52 | IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable,\r |
53 | IN CONST EFI_GUID *Guid,\r | |
54 | IN VOID *Table,\r | |
55 | IN UINTN TableSize\r | |
04c5d169 | 56 | );\r |
57 | \r | |
2f208e59 ED |
58 | typedef EFI_MM_STARTUP_THIS_AP EFI_SMM_STARTUP_THIS_AP;\r |
59 | typedef EFI_MM_NOTIFY_FN EFI_SMM_NOTIFY_FN;\r | |
60 | typedef EFI_MM_REGISTER_PROTOCOL_NOTIFY EFI_SMM_REGISTER_PROTOCOL_NOTIFY;\r | |
61 | typedef EFI_MM_INTERRUPT_MANAGE EFI_SMM_INTERRUPT_MANAGE;\r | |
62 | typedef EFI_MM_HANDLER_ENTRY_POINT EFI_SMM_HANDLER_ENTRY_POINT2;\r | |
63 | typedef EFI_MM_INTERRUPT_REGISTER EFI_SMM_INTERRUPT_REGISTER;\r | |
64 | typedef EFI_MM_INTERRUPT_UNREGISTER EFI_SMM_INTERRUPT_UNREGISTER;\r | |
04c5d169 | 65 | \r |
66 | ///\r | |
67 | /// Processor information and functionality needed by SMM Foundation.\r | |
68 | ///\r | |
69 | typedef struct _EFI_SMM_ENTRY_CONTEXT {\r | |
70 | EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r | |
71 | ///\r | |
9095d37b | 72 | /// A number between zero and the NumberOfCpus field. This field designates which\r |
04c5d169 | 73 | /// processor is executing the SMM Foundation.\r |
74 | ///\r | |
75 | UINTN CurrentlyExecutingCpu;\r | |
76 | ///\r | |
9095d37b | 77 | /// The number of possible processors in the platform. This is a 1 based\r |
04c5d169 | 78 | /// counter. This does not indicate the number of processors that entered SMM.\r |
79 | ///\r | |
80 | UINTN NumberOfCpus;\r | |
81 | ///\r | |
9095d37b LG |
82 | /// Points to an array, where each element describes the number of bytes in the\r |
83 | /// corresponding save state specified by CpuSaveState. There are always\r | |
84 | /// NumberOfCpus entries in the array.\r | |
04c5d169 | 85 | ///\r |
86 | UINTN *CpuSaveStateSize;\r | |
87 | ///\r | |
9095d37b LG |
88 | /// Points to an array, where each element is a pointer to a CPU save state. The\r |
89 | /// corresponding element in CpuSaveStateSize specifies the number of bytes in the\r | |
04c5d169 | 90 | /// save state area. There are always NumberOfCpus entries in the array.\r |
91 | ///\r | |
92 | VOID **CpuSaveState;\r | |
93 | } EFI_SMM_ENTRY_CONTEXT;\r | |
94 | \r | |
95 | /**\r | |
96 | This function is the main entry point to the SMM Foundation.\r | |
97 | \r | |
98 | @param[in] SmmEntryContext Processor information and functionality needed by SMM Foundation.\r | |
99 | **/\r | |
100 | typedef\r | |
101 | VOID\r | |
102 | (EFIAPI *EFI_SMM_ENTRY_POINT)(\r | |
103 | IN CONST EFI_SMM_ENTRY_CONTEXT *SmmEntryContext\r | |
104 | );\r | |
105 | \r | |
106 | ///\r | |
107 | /// System Management System Table (SMST)\r | |
108 | ///\r | |
9095d37b LG |
109 | /// The System Management System Table (SMST) is a table that contains a collection of common\r |
110 | /// services for managing SMRAM allocation and providing basic I/O services. These services are\r | |
04c5d169 | 111 | /// intended for both preboot and runtime usage.\r |
112 | ///\r | |
a2bb197e | 113 | struct _EFI_SMM_SYSTEM_TABLE2 {\r |
04c5d169 | 114 | ///\r |
115 | /// The table header for the SMST.\r | |
116 | ///\r | |
a2bb197e | 117 | EFI_TABLE_HEADER Hdr;\r |
04c5d169 | 118 | ///\r |
119 | /// A pointer to a NULL-terminated Unicode string containing the vendor name.\r | |
120 | /// It is permissible for this pointer to be NULL.\r | |
121 | ///\r | |
a2bb197e | 122 | CHAR16 *SmmFirmwareVendor;\r |
04c5d169 | 123 | ///\r |
124 | /// The particular revision of the firmware.\r | |
125 | ///\r | |
a2bb197e | 126 | UINT32 SmmFirmwareRevision;\r |
04c5d169 | 127 | \r |
a2bb197e | 128 | EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable;\r |
04c5d169 | 129 | \r |
130 | ///\r | |
131 | /// I/O Service\r | |
132 | ///\r | |
8fc71dec | 133 | EFI_SMM_CPU_IO2_PROTOCOL SmmIo;\r |
04c5d169 | 134 | \r |
135 | ///\r | |
136 | /// Runtime memory services\r | |
137 | ///\r | |
a2bb197e | 138 | EFI_ALLOCATE_POOL SmmAllocatePool;\r |
139 | EFI_FREE_POOL SmmFreePool;\r | |
140 | EFI_ALLOCATE_PAGES SmmAllocatePages;\r | |
141 | EFI_FREE_PAGES SmmFreePages;\r | |
04c5d169 | 142 | \r |
143 | ///\r | |
144 | /// MP service\r | |
145 | ///\r | |
a2bb197e | 146 | EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r |
04c5d169 | 147 | \r |
148 | ///\r | |
149 | /// CPU information records\r | |
150 | ///\r | |
151 | \r | |
152 | ///\r | |
9095d37b | 153 | /// A number between zero and and the NumberOfCpus field. This field designates\r |
04c5d169 | 154 | /// which processor is executing the SMM infrastructure.\r |
155 | ///\r | |
a2bb197e | 156 | UINTN CurrentlyExecutingCpu;\r |
04c5d169 | 157 | ///\r |
09c990ae | 158 | /// The number of possible processors in the platform. This is a 1 based counter.\r |
04c5d169 | 159 | ///\r |
a2bb197e | 160 | UINTN NumberOfCpus;\r |
04c5d169 | 161 | ///\r |
9095d37b LG |
162 | /// Points to an array, where each element describes the number of bytes in the\r |
163 | /// corresponding save state specified by CpuSaveState. There are always\r | |
164 | /// NumberOfCpus entries in the array.\r | |
04c5d169 | 165 | ///\r |
a2bb197e | 166 | UINTN *CpuSaveStateSize;\r |
04c5d169 | 167 | ///\r |
9095d37b LG |
168 | /// Points to an array, where each element is a pointer to a CPU save state. The\r |
169 | /// corresponding element in CpuSaveStateSize specifies the number of bytes in the\r | |
04c5d169 | 170 | /// save state area. There are always NumberOfCpus entries in the array.\r |
171 | ///\r | |
a2bb197e | 172 | VOID **CpuSaveState;\r |
04c5d169 | 173 | \r |
174 | ///\r | |
175 | /// Extensibility table\r | |
176 | ///\r | |
177 | \r | |
178 | ///\r | |
179 | /// The number of UEFI Configuration Tables in the buffer SmmConfigurationTable.\r | |
180 | ///\r | |
a2bb197e | 181 | UINTN NumberOfTableEntries;\r |
04c5d169 | 182 | ///\r |
9095d37b LG |
183 | /// A pointer to the UEFI Configuration Tables. The number of entries in the table is\r |
184 | /// NumberOfTableEntries.\r | |
04c5d169 | 185 | ///\r |
a2bb197e | 186 | EFI_CONFIGURATION_TABLE *SmmConfigurationTable;\r |
04c5d169 | 187 | \r |
188 | ///\r | |
189 | /// Protocol services\r | |
190 | ///\r | |
a2bb197e | 191 | EFI_INSTALL_PROTOCOL_INTERFACE SmmInstallProtocolInterface;\r |
192 | EFI_UNINSTALL_PROTOCOL_INTERFACE SmmUninstallProtocolInterface;\r | |
193 | EFI_HANDLE_PROTOCOL SmmHandleProtocol;\r | |
194 | EFI_SMM_REGISTER_PROTOCOL_NOTIFY SmmRegisterProtocolNotify;\r | |
195 | EFI_LOCATE_HANDLE SmmLocateHandle;\r | |
196 | EFI_LOCATE_PROTOCOL SmmLocateProtocol;\r | |
04c5d169 | 197 | \r |
198 | ///\r | |
199 | /// SMI Management functions\r | |
200 | ///\r | |
a2bb197e | 201 | EFI_SMM_INTERRUPT_MANAGE SmiManage;\r |
202 | EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister;\r | |
203 | EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister;\r | |
04c5d169 | 204 | };\r |
205 | \r | |
206 | #endif\r |