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