2 Library class definition of Extended SAL Library.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _EXTENDED_SAL_LIB_H__
10 #define _EXTENDED_SAL_LIB_H__
12 #include <IndustryStandard/Sal.h>
15 Register ESAL Class and its associated global.
17 This function Registers one or more Extended SAL services in a given
18 class along with the associated global context.
19 This function is only available prior to ExitBootServices().
21 @param ClassGuidLo GUID of function class, lower 64-bits
22 @param ClassGuidHi GUID of function class, upper 64-bits
23 @param ModuleGlobal Module global for Function.
24 @param ... List of Function/FunctionId pairs, ended by NULL
26 @retval EFI_SUCCESS The Extended SAL services were registered.
27 @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
28 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
29 @retval Other ClassGuid could not be installed onto a new handle.
35 IN CONST UINT64 ClassGuidLo
,
36 IN CONST UINT64 ClassGuidHi
,
37 IN VOID
*ModuleGlobal
, OPTIONAL
42 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
44 This function calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
46 @param ClassGuidLo GUID of function, lower 64-bits
47 @param ClassGuidHi GUID of function, upper 64-bits
48 @param FunctionId Function in ClassGuid to call
49 @param Arg2 Argument 2 ClassGuid/FunctionId defined
50 @param Arg3 Argument 3 ClassGuid/FunctionId defined
51 @param Arg4 Argument 4 ClassGuid/FunctionId defined
52 @param Arg5 Argument 5 ClassGuid/FunctionId defined
53 @param Arg6 Argument 6 ClassGuid/FunctionId defined
54 @param Arg7 Argument 7 ClassGuid/FunctionId defined
55 @param Arg8 Argument 8 ClassGuid/FunctionId defined
57 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be determined
58 for the current CPU execution mode.
59 @retval Other See the return status from ExtendedSalProc() in the
60 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
66 IN UINT64 ClassGuidLo
,
67 IN UINT64 ClassGuidHi
,
79 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
81 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
82 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
84 @param Microseconds The number of microseconds to delay.
86 @retval EFI_SAL_SUCCESS Call completed without error.
87 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
88 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
98 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
100 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
101 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
103 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
104 If FALSE, then PalEntryPoint is a virtual address.
105 @param PalEntryPoint The PAL Entry Point being set.
107 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
108 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
109 virtual mappings for the specified Extended SAL
110 Procedure are available.
116 IN BOOLEAN PhysicalAddress
,
117 IN UINT64 PalEntryPoint
121 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
123 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
124 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
126 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
127 If FALSE, then PalEntryPoint is a virtual address.
129 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
131 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
132 virtual mappings for the specified Extended SAL
133 Procedure are available.
134 @return r9 PAL entry point retrieved.
140 IN BOOLEAN PhysicalAddress
144 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
146 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
147 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
149 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
150 @param McaBuffer A pointer to the base address of the returned buffer.
151 Copied from SAL_RETURN_REGS.r9.
152 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
153 Copied from SAL_RETURN_REGS.r10.
155 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
156 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
157 @return r9 Base address of the returned buffer
158 @return r10 Size of the returned buffer in bytes
165 OUT UINT8
**McaBuffer
,
166 OUT UINTN
*BufferSize
170 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
172 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
173 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
175 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
177 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
182 EsalSaveStateBuffer (
187 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
189 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
190 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
192 @param VectorType The vector type to retrieve.
193 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
195 @retval EFI_SAL_SUCCESS Call completed without error.
196 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
197 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
198 with the SAL Procedure SAL_SET_VECTORS.
208 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
210 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
211 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
213 @param ParamInfoType The parameter type to retrieve.
214 1 - rendezvous interrupt
216 3 - Corrected Platform Error Vector.
218 @retval EFI_SAL_SUCCESS Call completed without error.
219 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
220 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
221 with the SAL Procedure SAL_MC_SET_PARAMS.
227 IN UINT64 ParamInfoType
231 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
233 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
234 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
236 @retval EFI_SAL_SUCCESS Call completed without error.
237 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
238 with the SAL Procedure SAL_MC_SET_PARAMS.
248 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
250 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
251 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
253 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
255 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
260 EsalGetMcCheckinFlags (
265 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
267 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
268 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
270 @param CpuGlobalId The Global ID for the CPU being added.
271 @param Enabled The enable flag for the CPU being added.
272 TRUE means the CPU is enabled.
273 FALSE means the CPU is disabled.
274 @param PalCompatibility The PAL Compatibility value for the CPU being added.
276 @retval EFI_SAL_SUCCESS The CPU was added to the database.
277 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
283 IN UINT64 CpuGlobalId
,
285 IN UINT64 PalCompatibility
289 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
291 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
292 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
294 @param CpuGlobalId The Global ID for the CPU being removed.
296 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
297 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
303 IN UINT64 CpuGlobalId
307 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
309 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
310 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
312 @param CpuGlobalId The Global ID for the CPU being modified.
313 @param Enabled The enable flag for the CPU being modified.
314 TRUE means the CPU is enabled.
315 FALSE means the CPU is disabled.
316 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
318 @retval EFI_SAL_SUCCESS The CPU database was updated.
319 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
325 IN UINT64 CpuGlobalId
,
327 IN UINT64 PalCompatibility
331 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
333 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
334 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
336 @param CpuGlobalId The Global ID for the CPU being looked up.
337 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
338 If FALSE, then the index of set of all CPUs of database is returned.
340 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
341 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
347 IN UINT64 CpuGlobalId
,
348 IN BOOLEAN IndexByEnabledCpu
352 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
354 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
355 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
357 @param Index The Global ID for the CPU being modified.
358 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
359 If FALSE, then the index of set of all CPUs of database is returned.
361 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
362 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
367 EsalGetCpuDataByIndex (
369 IN BOOLEAN IndexByEnabledCpu
373 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
375 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
376 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
378 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
379 If FALSE, then the index of set of all CPUs of database is returned.
381 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
382 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
388 IN BOOLEAN IndexByEnabledCpu
392 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
394 This function is a wrapper for the EsalNumProcessors service of Extended SAL
395 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
397 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
408 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
410 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
411 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
413 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
414 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
415 specified by CpuGlobalId.
417 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
418 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
424 IN UINT64 CpuGlobalId
,
425 IN EFI_PHYSICAL_ADDRESS MinStatePointer
429 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
431 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
432 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
434 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
436 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
437 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
443 IN UINT64 CpuGlobalId
447 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
449 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
450 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
452 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
453 @param StateBufferPointer A pointer to the returned MCA state buffer.
454 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
456 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
457 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
462 EsalMcaGetStateInfo (
463 IN UINT64 CpuGlobalId
,
464 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
465 OUT UINT64
*RequiredStateBufferSize
469 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
471 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
472 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
474 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
475 @param StateBufferPointer A pointer to the MCA state buffer.
477 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
478 @retval EFI_SUCCESS Save the processor's state info successfully
484 IN UINT64 CpuGlobalId
,
485 IN EFI_PHYSICAL_ADDRESS StateBufferPointer