]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Pi/PiSmmCis.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Pi / PiSmmCis.h
... / ...
CommitLineData
1/** @file\r
2 Common definitions in the Platform Initialization Specification version 1.4a\r
3 VOLUME 4 System Management Mode Core Interface version.\r
4\r
5 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials\r
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
19#include <Pi/PiMmCis.h>\r
20#include <Protocol/SmmCpuIo2.h>\r
21\r
22typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2;\r
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
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
49typedef\r
50EFI_STATUS\r
51(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)(\r
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
56 );\r
57\r
58typedef EFI_MM_STARTUP_THIS_AP EFI_SMM_STARTUP_THIS_AP;\r
59typedef EFI_MM_NOTIFY_FN EFI_SMM_NOTIFY_FN;\r
60typedef EFI_MM_REGISTER_PROTOCOL_NOTIFY EFI_SMM_REGISTER_PROTOCOL_NOTIFY;\r
61typedef EFI_MM_INTERRUPT_MANAGE EFI_SMM_INTERRUPT_MANAGE;\r
62typedef EFI_MM_HANDLER_ENTRY_POINT EFI_SMM_HANDLER_ENTRY_POINT2;\r
63typedef EFI_MM_INTERRUPT_REGISTER EFI_SMM_INTERRUPT_REGISTER;\r
64typedef EFI_MM_INTERRUPT_UNREGISTER EFI_SMM_INTERRUPT_UNREGISTER;\r
65\r
66///\r
67/// Processor information and functionality needed by SMM Foundation.\r
68///\r
69typedef struct _EFI_SMM_ENTRY_CONTEXT {\r
70 EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r
71 ///\r
72 /// A number between zero and the NumberOfCpus field. This field designates which\r
73 /// processor is executing the SMM Foundation.\r
74 ///\r
75 UINTN CurrentlyExecutingCpu;\r
76 ///\r
77 /// The number of possible processors in the platform. This is a 1 based\r
78 /// counter. This does not indicate the number of processors that entered SMM.\r
79 ///\r
80 UINTN NumberOfCpus;\r
81 ///\r
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
85 ///\r
86 UINTN *CpuSaveStateSize;\r
87 ///\r
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
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
100typedef\r
101VOID\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
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
111/// intended for both preboot and runtime usage.\r
112///\r
113struct _EFI_SMM_SYSTEM_TABLE2 {\r
114 ///\r
115 /// The table header for the SMST.\r
116 ///\r
117 EFI_TABLE_HEADER Hdr;\r
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
122 CHAR16 *SmmFirmwareVendor;\r
123 ///\r
124 /// The particular revision of the firmware.\r
125 ///\r
126 UINT32 SmmFirmwareRevision;\r
127\r
128 EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable;\r
129\r
130 ///\r
131 /// I/O Service\r
132 ///\r
133 EFI_SMM_CPU_IO2_PROTOCOL SmmIo;\r
134\r
135 ///\r
136 /// Runtime memory services\r
137 ///\r
138 EFI_ALLOCATE_POOL SmmAllocatePool;\r
139 EFI_FREE_POOL SmmFreePool;\r
140 EFI_ALLOCATE_PAGES SmmAllocatePages;\r
141 EFI_FREE_PAGES SmmFreePages;\r
142\r
143 ///\r
144 /// MP service\r
145 ///\r
146 EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r
147\r
148 ///\r
149 /// CPU information records\r
150 ///\r
151\r
152 ///\r
153 /// A number between zero and and the NumberOfCpus field. This field designates\r
154 /// which processor is executing the SMM infrastructure.\r
155 ///\r
156 UINTN CurrentlyExecutingCpu;\r
157 ///\r
158 /// The number of possible processors in the platform. This is a 1 based counter.\r
159 ///\r
160 UINTN NumberOfCpus;\r
161 ///\r
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
165 ///\r
166 UINTN *CpuSaveStateSize;\r
167 ///\r
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
170 /// save state area. There are always NumberOfCpus entries in the array.\r
171 ///\r
172 VOID **CpuSaveState;\r
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
181 UINTN NumberOfTableEntries;\r
182 ///\r
183 /// A pointer to the UEFI Configuration Tables. The number of entries in the table is\r
184 /// NumberOfTableEntries.\r
185 ///\r
186 EFI_CONFIGURATION_TABLE *SmmConfigurationTable;\r
187\r
188 ///\r
189 /// Protocol services\r
190 ///\r
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
197\r
198 ///\r
199 /// SMI Management functions\r
200 ///\r
201 EFI_SMM_INTERRUPT_MANAGE SmiManage;\r
202 EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister;\r
203 EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister;\r
204};\r
205\r
206#endif\r