]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/McaInitPmi.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / McaInitPmi.h
CommitLineData
41335d22 1/** @file\r
2 MCA/PMI/INIT Protocol as defined in PI Specification VOLUME 4.\r
3\r
4 This protocol provides services to handle Machine Checks (MCA),\r
5 Initialization (INIT) events, and Platform Management Interrupt (PMI) events\r
6 on an Intel Itanium Processor Family based system.\r
7\r
9df063a0
HT
8 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
9 This program and the accompanying materials \r
41335d22 10 are licensed and made available under the terms and conditions of the BSD License \r
11 which accompanies this distribution. The full text of the license may be found at \r
12 http://opensource.org/licenses/bsd-license.php \r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
18\r
19#ifndef __MCA_INIT_PMI_PROTOCOL_H__\r
20#define __MCA_INIT_PMI_PROTOCOL_H__\r
21\r
22///\r
23/// Global ID for the MCA/PMI/INIT Protocol.\r
24///\r
25#define EFI_SAL_MCA_INIT_PMI_PROTOCOL_GUID \\r
26 { 0xb60dc6e8, 0x3b6f, 0x11d5, {0xaf, 0x9, 0x0, 0xa0, 0xc9, 0x44, 0xa0, 0x5b} }\r
27\r
28\r
29///\r
30/// Declare forward reference for the Timer Architectural Protocol\r
31///\r
32typedef struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL EFI_SAL_MCA_INIT_PMI_PROTOCOL;\r
33\r
34#pragma pack(1)\r
35///\r
36/// MCA Records Structure\r
37///\r
38typedef struct {\r
39 UINT64 First : 1;\r
40 UINT64 Last : 1;\r
41 UINT64 EntryCount : 16;\r
42 UINT64 DispatchedCount : 16;\r
43 UINT64 Reserved : 30;\r
44} SAL_MCA_COUNT_STRUCTURE;\r
45\r
46#pragma pack()\r
47\r
48/**\r
49 Prototype of MCA handler.\r
50\r
51 @param ModuleGlobal The context of MCA Handler\r
52 @param ProcessorStateParameters The processor state parameters (PSP)\r
53 @param MinstateBase Base address of the min-state\r
54 @param RendezvouseStateInformation Rendezvous state information to be passed to\r
55 the OS on OS MCA entry\r
56 @param CpuIndex Index of the logical processor\r
57 @param McaCountStructure Pointer to the MCA records structure\r
58 @param CorrectedMachineCheck This flag is set to TRUE is the MCA has been\r
59 corrected by the handler or by a previous handler\r
60\r
61 @retval EFI_SUCCESS Handler successfully returned\r
62\r
63**/\r
64typedef\r
65EFI_STATUS\r
a1749b80 66(EFIAPI *EFI_SAL_MCA_HANDLER)(\r
41335d22 67 IN VOID *ModuleGlobal,\r
68 IN UINT64 ProcessorStateParameters,\r
69 IN EFI_PHYSICAL_ADDRESS MinstateBase,\r
70 IN UINT64 RendezvouseStateInformation,\r
71 IN UINT64 CpuIndex,\r
72 IN SAL_MCA_COUNT_STRUCTURE *McaCountStructure,\r
73 OUT BOOLEAN *CorrectedMachineCheck\r
74 );\r
75\r
76/**\r
77 Prototype of INIT handler.\r
78\r
79 @param ModuleGlobal The context of INIT Handler\r
80 @param ProcessorStateParameters The processor state parameters (PSP)\r
81 @param MinstateBase Base address of the min-state\r
82 @param McaInProgress This flag indicates if an MCA is in progress\r
83 @param CpuIndex Index of the logical processor\r
84 @param McaCountStructure Pointer to the MCA records structure\r
85 @param DumpSwitchPressed This flag indicates the crash dump switch has been pressed\r
86\r
87 @retval EFI_SUCCESS Handler successfully returned\r
88\r
89**/\r
90typedef\r
91EFI_STATUS\r
a1749b80 92(EFIAPI *EFI_SAL_INIT_HANDLER)(\r
41335d22 93 IN VOID *ModuleGlobal,\r
94 IN UINT64 ProcessorStateParameters,\r
95 IN EFI_PHYSICAL_ADDRESS MinstateBase,\r
96 IN BOOLEAN McaInProgress,\r
97 IN UINT64 CpuIndex,\r
98 IN SAL_MCA_COUNT_STRUCTURE *McaCountStructure,\r
99 OUT BOOLEAN *DumpSwitchPressed\r
100 );\r
101\r
102/**\r
103 Prototype of PMI handler\r
104\r
105 @param ModuleGlobal The context of PMI Handler\r
106 @param CpuIndex Index of the logical processor\r
107 @param PmiVector The PMI vector number as received from the PALE_PMI exit state (GR24)\r
108\r
109 @retval EFI_SUCCESS Handler successfully returned\r
110\r
111**/\r
112typedef\r
113EFI_STATUS\r
a1749b80 114(EFIAPI *EFI_SAL_PMI_HANDLER)(\r
41335d22 115 IN VOID *ModuleGlobal,\r
116 IN UINT64 CpuIndex,\r
117 IN UINT64 PmiVector\r
118 );\r
119\r
120/**\r
121 Register a MCA handler with the MCA dispatcher.\r
122\r
123 @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance\r
124 @param McaHandler The MCA handler to register\r
125 @param ModuleGlobal The context of MCA Handler\r
126 @param MakeFirst This flag specifies the handler should be made first in the list\r
127 @param MakeLast This flag specifies the handler should be made last in the list\r
128\r
129 @retval EFI_SUCCESS MCA Handle was registered\r
130 @retval EFI_OUT_OF_RESOURCES No more resources to register an MCA handler\r
131 @retval EFI_INVALID_PARAMETER Invalid parameters were passed\r
132\r
133**/\r
134typedef\r
135EFI_STATUS\r
a1749b80 136(EFIAPI *EFI_SAL_REGISTER_MCA_HANDLER)(\r
41335d22 137 IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,\r
138 IN EFI_SAL_MCA_HANDLER McaHandler,\r
139 IN VOID *ModuleGlobal,\r
140 IN BOOLEAN MakeFirst,\r
141 IN BOOLEAN MakeLast\r
142 );\r
143\r
144/**\r
145 Register an INIT handler with the INIT dispatcher.\r
146\r
147 @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance\r
148 @param InitHandler The INIT handler to register\r
149 @param ModuleGlobal The context of INIT Handler\r
150 @param MakeFirst This flag specifies the handler should be made first in the list\r
151 @param MakeLast This flag specifies the handler should be made last in the list\r
152\r
153 @retval EFI_SUCCESS INIT Handle was registered\r
154 @retval EFI_OUT_OF_RESOURCES No more resources to register an INIT handler\r
155 @retval EFI_INVALID_PARAMETER Invalid parameters were passed\r
156\r
157**/\r
158typedef\r
159EFI_STATUS\r
a1749b80 160(EFIAPI *EFI_SAL_REGISTER_INIT_HANDLER)(\r
41335d22 161 IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,\r
162 IN EFI_SAL_INIT_HANDLER InitHandler,\r
163 IN VOID *ModuleGlobal,\r
164 IN BOOLEAN MakeFirst,\r
165 IN BOOLEAN MakeLast\r
166 );\r
167\r
168/**\r
169 Register a PMI handler with the PMI dispatcher.\r
170\r
171 @param This The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance\r
172 @param PmiHandler The PMI handler to register\r
173 @param ModuleGlobal The context of PMI Handler\r
174 @param MakeFirst This flag specifies the handler should be made first in the list\r
175 @param MakeLast This flag specifies the handler should be made last in the list\r
176\r
177 @retval EFI_SUCCESS PMI Handle was registered\r
178 @retval EFI_OUT_OF_RESOURCES No more resources to register an PMI handler\r
179 @retval EFI_INVALID_PARAMETER Invalid parameters were passed\r
180\r
181**/\r
182typedef\r
183EFI_STATUS\r
a1749b80 184(EFIAPI *EFI_SAL_REGISTER_PMI_HANDLER)(\r
41335d22 185 IN EFI_SAL_MCA_INIT_PMI_PROTOCOL *This,\r
186 IN EFI_SAL_PMI_HANDLER PmiHandler,\r
187 IN VOID *ModuleGlobal,\r
188 IN BOOLEAN MakeFirst,\r
189 IN BOOLEAN MakeLast\r
190 );\r
191\r
192///\r
193/// This protocol is used to register MCA, INIT and PMI handlers with their respective dispatcher\r
194///\r
195struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL {\r
196 EFI_SAL_REGISTER_MCA_HANDLER RegisterMcaHandler;\r
197 EFI_SAL_REGISTER_INIT_HANDLER RegisterInitHandler;\r
198 EFI_SAL_REGISTER_PMI_HANDLER RegisterPmiHandler;\r
199 BOOLEAN McaInProgress; ///< Whether MCA handler is in progress\r
200 BOOLEAN InitInProgress; ///< Whether Init handler is in progress\r
201 BOOLEAN PmiInProgress; ///< Whether Pmi handler is in progress\r
202};\r
203\r
204extern EFI_GUID gEfiSalMcaInitPmiProtocolGuid;\r
205\r
206#endif\r
207\r