]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Include/Library/ExtendedSalLib.h
63ba2c981b228d13e12261868f5a533442860b68
[mirror_edk2.git] / EdkModulePkg / Include / Library / ExtendedSalLib.h
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 ExtendedSalLib.h
15
16 Abstract:
17
18 --*/
19
20 #ifndef _EXTENDED_SAL_LIB_H__
21 #define _EXTENDED_SAL_LIB_H__
22
23 /**
24 Register ESAL Class and it's asociated global.
25
26 This function Registers one or more Extended SAL services in a given
27 class along with the associated global context.
28 This function is only available prior to ExitBootServices().
29
30 @param ClassGuid GUID of function class
31 @param ModuleGlobal Module global for Function.
32
33 @retval EFI_SUCCESS The Extended SAL services were registered.
34 @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
35 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
36 @retval Other ClassGuid could not be installed onto a new handle.
37
38 **/
39 EFI_STATUS
40 EFIAPI
41 RegisterEsalClass (
42 IN CONST EFI_GUID *ClassGuid,
43 IN VOID *ModuleGlobal, OPTIONAL
44 ...
45 )
46 ;
47
48 /**
49 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
50
51 This function calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
52
53 @param ClassGuid GUID of function
54 @param FunctionId Function in ClassGuid to call
55 @param Arg2 Argument 2 ClassGuid/FunctionId defined
56 @param Arg3 Argument 3 ClassGuid/FunctionId defined
57 @param Arg4 Argument 4 ClassGuid/FunctionId defined
58 @param Arg5 Argument 5 ClassGuid/FunctionId defined
59 @param Arg6 Argument 6 ClassGuid/FunctionId defined
60 @param Arg7 Argument 7 ClassGuid/FunctionId defined
61 @param Arg8 Argument 8 ClassGuid/FunctionId defined
62
63 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be determined
64 for the current CPU execution mode.
65 @retval Other See the return status from ExtendedSalProc() in the
66 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
67
68 **/
69 SAL_RETURN_REGS
70 EFIAPI
71 EsalCall (
72 IN EFI_GUID *ClassGuid,
73 IN UINT64 FunctionId,
74 IN UINT64 Arg2,
75 IN UINT64 Arg3,
76 IN UINT64 Arg4,
77 IN UINT64 Arg5,
78 IN UINT64 Arg6,
79 IN UINT64 Arg7,
80 IN UINT64 Arg8
81 )
82 ;
83
84 /**
85 Wrapper for the EsalStallFunctionId service in the Extended SAL Stall Services Class.
86
87 This function is a wrapper for the EsalStallFunctionId service in the Extended SAL
88 Stall Services Class. See EsalStallFunctionId in the Extended SAL Specification.
89
90 @param Microseconds The number of microseconds to delay.
91
92 **/
93 SAL_RETURN_REGS
94 EFIAPI
95 EsalStall (
96 IN UINTN Microseconds
97 )
98 ;
99
100 /**
101 Wrapper for the EsalSetNewPalEntryFunctionId service in the Extended SAL PAL Services Services Class.
102
103 This function is a wrapper for the EsalSetNewPalEntryFunctionId service in the Extended SAL
104 PAL Services Services Class. See EsalSetNewPalEntryFunctionId in the Extended SAL Specification.
105
106 @param PhyicalAddress If TRUE, then PalEntryPoint is a physical address.
107 If FALSE, then PalEntryPoint is a virtual address.
108 @param PalEntryPoint The PAL Entry Point being set.
109
110 **/
111 SAL_RETURN_REGS
112 EFIAPI
113 EsalSetNewPalEntry (
114 IN BOOLEAN PhysicalAddress,
115 IN UINT64 PalEntryPoint
116 )
117 ;
118
119 /**
120 Wrapper for the EsalGetStateBufferFunctionId service in the Extended SAL PAL Services Services Class.
121
122 This function is a wrapper for the EsalGetStateBufferFunctionId service in the Extended SAL
123 PAL Services Services Class. See EsalGetStateBufferFunctionId in the Extended SAL Specification.
124
125 @param PhyicalAddress If TRUE, then PalEntryPoint is a physical address.
126 If FALSE, then PalEntryPoint is a virtual address.
127
128 **/
129 SAL_RETURN_REGS
130 EFIAPI
131 EsalGetNewPalEntry (
132 IN BOOLEAN PhysicalAddress
133 )
134 ;
135
136 /**
137 Wrapper for the EsalGetStateBufferFunctionId service in the Extended SAL MCA Log Services Class.
138
139 This function is a wrapper for the EsalGetStateBufferFunctionId service in the Extended SAL
140 MCA Log Services Class. See EsalGetStateBufferFunctionId in the Extended SAL Specification.
141
142 @param McaType See type parameter in the SAL Procedure SAL_GET_STATE_INFO.
143 @param McaBuffer A pointer to the base address of the returned buffer. Copied from SAL_RETURN_REGS.r9.
144 @param BufferSize A pointer to the size, in bytes, of the returned buffer. Copied from SAL_RETURN_REGS.r10.
145
146 **/
147 SAL_RETURN_REGS
148 EFIAPI
149 EsalGetStateBufferLeon (
150 IN UINT64 McaType,
151 OUT UINT8 **McaBuffer,
152 OUT UINTN *BufferSize
153 )
154 ;
155
156 /**
157 Wrapper for the EsalSaveStateBufferFunctionId service in the Extended SAL MCA Log Services Class.
158
159 This function is a wrapper for the EsalSaveStateBufferFunctionId service in the Extended SAL
160 MCA Log Services Class. See EsalSaveStateBufferFunctionId in the Extended SAL Specification.
161
162 @param McaType See type parameter in the SAL Procedure SAL_GET_STATE_INFO.
163
164 **/
165 SAL_RETURN_REGS
166 EFIAPI
167 EsalSaveStateBufferLeon (
168 IN UINT64 McaType
169 )
170 ;
171
172 /**
173 Wrapper for the EsalGetVectorsFunctionId service in the Extended SAL MCA Log Services Class.
174
175 This function is a wrapper for the EsalGetVectorsFunctionId service in the Extended SAL
176 MCA Log Services Class. See EsalGetVectorsFunctionId in the Extended SAL Specification.
177
178 @param VectorType The vector type to retrieve.
179 0 ¨C MCA, 1 - BSP INIT, 2 ¨C BOOT_RENDEZ, 3 ¨C AP INIT.
180
181 **/
182 SAL_RETURN_REGS
183 EFIAPI
184 EsalGetVectorsLeon (
185 IN UINT64 VectorType
186 )
187 ;
188
189 /**
190 Wrapper for the EsalMcGetParamsFunctionId service in the Extended SAL MCA Log Services Class.
191
192 This function is a wrapper for the EsalMcGetParamsFunctionId service in the Extended SAL
193 MCA Log Services Class. See EsalMcGetParamsFunctionId in the Extended SAL Specification.
194
195 @param ParamInfoType The parameter type to retrieve.
196 1 ¨C rendezvous interrupt
197 2 ¨C wake up
198 3 ¨C Corrected Platform Error Vector.
199
200 **/
201 SAL_RETURN_REGS
202 EFIAPI
203 EsalMcGetParamsLeon (
204 IN UINT64 ParamInfoType
205 )
206 ;
207
208 /**
209 Wrapper for the EsalMcGetParamsFunctionId service in the Extended SAL MCA Log Services Class.
210
211 This function is a wrapper for the EsalMcGetParamsFunctionId service in the Extended SAL
212 MCA Log Services Class. See EsalMcGetParamsFunctionId in the Extended SAL Specification.
213
214 **/
215 SAL_RETURN_REGS
216 EFIAPI
217 EsalMcGetMcParamsLeon (
218 VOID
219 )
220 ;
221
222 /**
223 Wrapper for the EsalGetMcCheckinFlagsFunctionId service in the Extended SAL MCA Log Services Class.
224
225 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service in the Extended SAL
226 MCA Log Services Class. See EsalGetMcCheckinFlagsFunctionId in the Extended SAL Specification.
227
228 @param CpuIndex The index of the CPU in the set of enabled CPUs to check.
229
230 **/
231 SAL_RETURN_REGS
232 EFIAPI
233 EsalGetMcCheckinFlagsLeon (
234 IN UINT64 CpuIndex
235 )
236 ;
237
238 /**
239 Wrapper for the EsalAddCpuDataFunctionId service in the Extended SAL MCA Log Services Class.
240
241 This function is a wrapper for the EsalAddCpuDataFunctionId service in the Extended SAL
242 MCA Log Services Class. See EsalAddCpuDataFunctionId in the Extended SAL Specification.
243
244 @param CpuGlobalId The Global ID for the CPU being added.
245 @param Enabled The enable flag for the CPU being added.
246 TRUE means the CPU is enabled.
247 FALSE means the CPU is disabled.
248 @param PalCompatibility The PAL Compatibility value for the CPU being added.
249
250 **/
251 SAL_RETURN_REGS
252 EFIAPI
253 EsalAddCpuData (
254 IN UINT64 CpuGlobalId,
255 IN BOOLEAN Enabled,
256 IN UINT64 PalCompatibility
257 )
258 ;
259
260 /**
261 Wrapper for the EsalRemoveCpuDataFunctionId service in the Extended SAL MCA Log Services Class.
262
263 This function is a wrapper for the EsalRemoveCpuDataFunctionId service in the Extended SAL
264 MCA Log Services Class. See EsalRemoveCpuDataFunctionId in the Extended SAL Specification.
265
266 @param CpuGlobalId The Global ID for the CPU being removed.
267
268 **/
269 SAL_RETURN_REGS
270 EFIAPI
271 EsalRemoveCpuData (
272 IN UINT64 CpuGlobalId
273 )
274 ;
275
276 /**
277 Wrapper for the EsalModifyCpuDataFunctionId service in the Extended SAL MCA Log Services Class.
278
279 This function is a wrapper for the EsalModifyCpuDataFunctionId service in the Extended SAL
280 MCA Log Services Class. See EsalModifyCpuDataFunctionId in the Extended SAL Specification.
281
282 @param CpuGlobalId The Global ID for the CPU being modified.
283 @param Enabled The enable flag for the CPU being modified.
284 TRUE means the CPU is enabled.
285 FALSE means the CPU is disabled.
286 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
287
288 **/
289 SAL_RETURN_REGS
290 EFIAPI
291 EsalModifyCpuData (
292 IN UINT64 CpuGlobalId,
293 IN BOOLEAN Enabled,
294 IN UINT64 PalCompatibility
295 )
296 ;
297
298 /**
299 Wrapper for the EsalGetCpuDataByIdFunctionId service in the Extended SAL MCA Log Services Class.
300
301 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service in the Extended SAL
302 MCA Log Services Class. See EsalGetCpuDataByIdFunctionId in the Extended SAL Specification.
303
304 @param CpuGlobalId The Global ID for the CPU being looked up.
305 @param IndexByEnabledCpu If TRUE, then the index in the set of enabled CPUs in the database is returned.
306 If FALSE, then the index in the set of all CPUs in the database is returned.
307
308 **/
309 SAL_RETURN_REGS
310 EFIAPI
311 EsalGetCpuDataById (
312 IN UINT64 CpuGlobalId,
313 IN BOOLEAN IndexByEnabledCpu
314 )
315 ;
316
317 /**
318 Wrapper for the EsalGetCpuDataByIndexFunctionId service in the Extended SAL MCA Log Services Class.
319
320 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service in the Extended SAL
321 MCA Log Services Class. See EsalGetCpuDataByIndexFunctionId in the Extended SAL Specification.
322
323 @param Index The Global ID for the CPU being modified.
324 @param IndexByEnabledCpu If TRUE, then the index in the set of enabled CPUs in the database is returned.
325 If FALSE, then the index in the set of all CPUs in the database is returned.
326
327 **/
328 SAL_RETURN_REGS
329 EFIAPI
330 EsalGetCpuDataByIndex (
331 IN UINT64 Index,
332 IN BOOLEAN IndexByEnabledCpu
333 )
334 ;
335
336 /**
337 Wrapper for the EsalWhoAmIFunctionId service in the Extended SAL MCA Log Services Class.
338
339 This function is a wrapper for the EsalWhoAmIFunctionId service in the Extended SAL
340 MCA Log Services Class. See EsalWhoAmIFunctionId in the Extended SAL Specification.
341
342 @param IndexByEnabledCpu If TRUE, then the index in the set of enabled CPUs in the database is returned.
343 If FALSE, then the index in the set of all CPUs in the database is returned.
344
345 **/
346 SAL_RETURN_REGS
347 EFIAPI
348 EsalWhoAmI (
349 IN BOOLEAN IndexByEnabledCpu
350 )
351 ;
352
353 /**
354 Wrapper for the EsalNumProcessors service in the Extended SAL MCA Log Services Class.
355
356 This function is a wrapper for the EsalNumProcessors service in the Extended SAL
357 MCA Log Services Class. See EsalNumProcessors in the Extended SAL Specification.
358
359 **/
360 SAL_RETURN_REGS
361 EFIAPI
362 EsalNumProcessors (
363 VOID
364 )
365 ;
366
367 /**
368 Wrapper for the EsalSetMinStateFnctionId service in the Extended SAL MCA Log Services Class.
369
370 This function is a wrapper for the EsalSetMinStateFnctionId service in the Extended SAL
371 MCA Log Services Class. See EsalSetMinStateFnctionId in the Extended SAL Specification.
372
373 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
374 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU specified by CpuGlobalId.
375
376 **/
377 SAL_RETURN_REGS
378 EFIAPI
379 EsalSetMinState (
380 IN UINT64 CpuGlobalId,
381 IN EFI_PHYSICAL_ADDRESS MinStatePointer
382 )
383 ;
384
385 /**
386 Wrapper for the EsalGetMinStateFunctionId service in the Extended SAL MCA Log Services Class.
387
388 This function is a wrapper for the EsalGetMinStateFunctionId service in the Extended SAL
389 MCA Log Services Class. See EsalGetMinStateFunctionId in the Extended SAL Specification.
390
391 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
392
393 **/
394 SAL_RETURN_REGS
395 EFIAPI
396 EsalGetMinState (
397 IN UINT64 CpuGlobalId
398 )
399 ;
400
401 /**
402 Wrapper for the EsalMcsGetStateInfoFunctionId service in the Extended SAL MCA Log Services Class.
403
404 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service in the Extended SAL
405 MCA Log Services Class. See EsalMcsGetStateInfoFunctionId in the Extended SAL Specification.
406
407 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
408 @param StateBufferPointer A pointer to the returned MCA state buffer.
409 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
410
411 **/
412 SAL_RETURN_REGS
413 EFIAPI
414 EsalMcaGetStateInfo (
415 IN UINT64 CpuGlobalId,
416 OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer,
417 OUT UINT64 *RequiredStateBufferSize
418 )
419 ;
420
421 /**
422 Wrapper for the EsalMcaRegisterCpuFunctionId service in the Extended SAL MCA Log Services Class.
423
424 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service in the Extended SAL
425 MCA Log Services Class. See EsalMcaRegisterCpuFunctionId in the Extended SAL Specification.
426
427 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
428 @param StateBufferPointer A pointer to the MCA state buffer.
429
430 **/
431 SAL_RETURN_REGS
432 EFIAPI
433 EsalMcaRegisterCpu (
434 IN UINT64 CpuGlobalId,
435 IN EFI_PHYSICAL_ADDRESS StateBufferPointer
436 )
437 ;
438
439 #endif