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