]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiSmmCis.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Pi / PiSmmCis.h
CommitLineData
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
9344f092 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
04c5d169 7\r
8**/\r
9\r
10#ifndef _PI_SMMCIS_H_\r
11#define _PI_SMMCIS_H_\r
12\r
2f208e59 13#include <Pi/PiMmCis.h>\r
8fc71dec 14#include <Protocol/SmmCpuIo2.h>\r
04c5d169 15\r
2f88bd3a 16typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2;\r
2f208e59
ED
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
04c5d169 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
a2bb197e 45(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)(\r
2f208e59
ED
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
04c5d169 50 );\r
51\r
2f88bd3a
MK
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
04c5d169 59\r
60///\r
61/// Processor information and functionality needed by SMM Foundation.\r
62///\r
63typedef struct _EFI_SMM_ENTRY_CONTEXT {\r
2f88bd3a 64 EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r
04c5d169 65 ///\r
9095d37b 66 /// A number between zero and the NumberOfCpus field. This field designates which\r
04c5d169 67 /// processor is executing the SMM Foundation.\r
68 ///\r
2f88bd3a 69 UINTN CurrentlyExecutingCpu;\r
04c5d169 70 ///\r
9095d37b 71 /// The number of possible processors in the platform. This is a 1 based\r
04c5d169 72 /// counter. This does not indicate the number of processors that entered SMM.\r
73 ///\r
2f88bd3a 74 UINTN NumberOfCpus;\r
04c5d169 75 ///\r
9095d37b
LG
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
04c5d169 79 ///\r
2f88bd3a 80 UINTN *CpuSaveStateSize;\r
04c5d169 81 ///\r
9095d37b
LG
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
04c5d169 84 /// save state area. There are always NumberOfCpus entries in the array.\r
85 ///\r
2f88bd3a 86 VOID **CpuSaveState;\r
04c5d169 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
9095d37b
LG
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
04c5d169 105/// intended for both preboot and runtime usage.\r
106///\r
a2bb197e 107struct _EFI_SMM_SYSTEM_TABLE2 {\r
04c5d169 108 ///\r
109 /// The table header for the SMST.\r
110 ///\r
2f88bd3a 111 EFI_TABLE_HEADER Hdr;\r
04c5d169 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
2f88bd3a 116 CHAR16 *SmmFirmwareVendor;\r
04c5d169 117 ///\r
118 /// The particular revision of the firmware.\r
119 ///\r
2f88bd3a 120 UINT32 SmmFirmwareRevision;\r
04c5d169 121\r
2f88bd3a 122 EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable;\r
04c5d169 123\r
124 ///\r
125 /// I/O Service\r
126 ///\r
2f88bd3a 127 EFI_SMM_CPU_IO2_PROTOCOL SmmIo;\r
04c5d169 128\r
129 ///\r
130 /// Runtime memory services\r
131 ///\r
2f88bd3a
MK
132 EFI_ALLOCATE_POOL SmmAllocatePool;\r
133 EFI_FREE_POOL SmmFreePool;\r
134 EFI_ALLOCATE_PAGES SmmAllocatePages;\r
135 EFI_FREE_PAGES SmmFreePages;\r
04c5d169 136\r
137 ///\r
138 /// MP service\r
139 ///\r
2f88bd3a 140 EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;\r
04c5d169 141\r
142 ///\r
143 /// CPU information records\r
144 ///\r
145\r
146 ///\r
9095d37b 147 /// A number between zero and and the NumberOfCpus field. This field designates\r
04c5d169 148 /// which processor is executing the SMM infrastructure.\r
149 ///\r
2f88bd3a 150 UINTN CurrentlyExecutingCpu;\r
04c5d169 151 ///\r
09c990ae 152 /// The number of possible processors in the platform. This is a 1 based counter.\r
04c5d169 153 ///\r
2f88bd3a 154 UINTN NumberOfCpus;\r
04c5d169 155 ///\r
9095d37b
LG
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
04c5d169 159 ///\r
2f88bd3a 160 UINTN *CpuSaveStateSize;\r
04c5d169 161 ///\r
9095d37b
LG
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
04c5d169 164 /// save state area. There are always NumberOfCpus entries in the array.\r
165 ///\r
2f88bd3a 166 VOID **CpuSaveState;\r
04c5d169 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
2f88bd3a 175 UINTN NumberOfTableEntries;\r
04c5d169 176 ///\r
9095d37b
LG
177 /// A pointer to the UEFI Configuration Tables. The number of entries in the table is\r
178 /// NumberOfTableEntries.\r
04c5d169 179 ///\r
2f88bd3a 180 EFI_CONFIGURATION_TABLE *SmmConfigurationTable;\r
04c5d169 181\r
182 ///\r
183 /// Protocol services\r
184 ///\r
2f88bd3a
MK
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
04c5d169 191\r
192 ///\r
193 /// SMI Management functions\r
194 ///\r
2f88bd3a
MK
195 EFI_SMM_INTERRUPT_MANAGE SmiManage;\r
196 EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister;\r
197 EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister;\r
04c5d169 198};\r
199\r
200#endif\r