2 Library class definition of Extended SAL Library.
4 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _EXTENDED_SAL_LIB_H__
16 #define _EXTENDED_SAL_LIB_H__
18 #include <IndustryStandard/Sal.h>
21 Register ESAL Class and its associated global.
23 This function Registers one or more Extended SAL services in a given
24 class along with the associated global context.
25 This function is only available prior to ExitBootServices().
27 @param ClassGuidLo GUID of function class, lower 64-bits
28 @param ClassGuidHi GUID of function class, upper 64-bits
29 @param ModuleGlobal Module global for Function.
30 @param ... List of Function/FunctionId pairs, ended by NULL
32 @retval EFI_SUCCESS The Extended SAL services were registered.
33 @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
34 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
35 @retval Other ClassGuid could not be installed onto a new handle.
41 IN CONST UINT64 ClassGuidLo
,
42 IN CONST UINT64 ClassGuidHi
,
43 IN VOID
*ModuleGlobal
, OPTIONAL
48 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
50 This function calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
52 @param ClassGuidLo GUID of function, lower 64-bits
53 @param ClassGuidHi GUID of function, upper 64-bits
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
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.
72 IN UINT64 ClassGuidLo
,
73 IN UINT64 ClassGuidHi
,
85 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
87 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
88 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
90 @param Microseconds The number of microseconds to delay.
92 @retval EFI_SAL_SUCCESS Call completed without error.
93 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
94 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
100 IN UINTN Microseconds
104 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
106 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
107 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
109 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
110 If FALSE, then PalEntryPoint is a virtual address.
111 @param PalEntryPoint The PAL Entry Point being set.
113 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
114 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
115 virtual mappings for the specified Extended SAL
116 Procedure are available.
122 IN BOOLEAN PhysicalAddress
,
123 IN UINT64 PalEntryPoint
127 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
129 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
130 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
132 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
133 If FALSE, then PalEntryPoint is a virtual address.
135 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
137 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
138 virtual mappings for the specified Extended SAL
139 Procedure are available.
140 @return r9 PAL entry point retrieved.
146 IN BOOLEAN PhysicalAddress
150 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
152 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
153 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
155 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
156 @param McaBuffer A pointer to the base address of the returned buffer.
157 Copied from SAL_RETURN_REGS.r9.
158 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
159 Copied from SAL_RETURN_REGS.r10.
161 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
162 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
163 @return r9 Base address of the returned buffer
164 @return r10 Size of the returned buffer in bytes
171 OUT UINT8
**McaBuffer
,
172 OUT UINTN
*BufferSize
176 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
178 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
179 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
181 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
183 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
188 EsalSaveStateBuffer (
193 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
195 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
196 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
198 @param VectorType The vector type to retrieve.
199 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
201 @retval EFI_SAL_SUCCESS Call completed without error.
202 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
203 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
204 with the SAL Procedure SAL_SET_VECTORS.
214 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
216 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
217 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
219 @param ParamInfoType The parameter type to retrieve.
220 1 - rendezvous interrupt
222 3 - Corrected Platform Error Vector.
224 @retval EFI_SAL_SUCCESS Call completed without error.
225 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
226 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
227 with the SAL Procedure SAL_MC_SET_PARAMS.
233 IN UINT64 ParamInfoType
237 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
239 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
240 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
242 @retval EFI_SAL_SUCCESS Call completed without error.
243 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
244 with the SAL Procedure SAL_MC_SET_PARAMS.
254 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
256 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
257 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
259 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
261 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
266 EsalGetMcCheckinFlags (
271 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
273 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
274 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
276 @param CpuGlobalId The Global ID for the CPU being added.
277 @param Enabled The enable flag for the CPU being added.
278 TRUE means the CPU is enabled.
279 FALSE means the CPU is disabled.
280 @param PalCompatibility The PAL Compatibility value for the CPU being added.
282 @retval EFI_SAL_SUCCESS The CPU was added to the database.
283 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
289 IN UINT64 CpuGlobalId
,
291 IN UINT64 PalCompatibility
295 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
297 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
298 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
300 @param CpuGlobalId The Global ID for the CPU being removed.
302 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
303 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
309 IN UINT64 CpuGlobalId
313 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
315 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
316 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
318 @param CpuGlobalId The Global ID for the CPU being modified.
319 @param Enabled The enable flag for the CPU being modified.
320 TRUE means the CPU is enabled.
321 FALSE means the CPU is disabled.
322 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
324 @retval EFI_SAL_SUCCESS The CPU database was updated.
325 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
331 IN UINT64 CpuGlobalId
,
333 IN UINT64 PalCompatibility
337 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
339 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
340 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
342 @param CpuGlobalId The Global ID for the CPU being looked up.
343 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
344 If FALSE, then the index of set of all CPUs of database is returned.
346 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
347 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
353 IN UINT64 CpuGlobalId
,
354 IN BOOLEAN IndexByEnabledCpu
358 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
360 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
361 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
363 @param Index The Global ID for the CPU being modified.
364 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
365 If FALSE, then the index of set of all CPUs of database is returned.
367 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
368 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
373 EsalGetCpuDataByIndex (
375 IN BOOLEAN IndexByEnabledCpu
379 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
381 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
382 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
384 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
385 If FALSE, then the index of set of all CPUs of database is returned.
387 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
388 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
394 IN BOOLEAN IndexByEnabledCpu
398 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
400 This function is a wrapper for the EsalNumProcessors service of Extended SAL
401 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
403 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
414 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
416 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
417 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
419 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
420 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
421 specified by CpuGlobalId.
423 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
424 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
430 IN UINT64 CpuGlobalId
,
431 IN EFI_PHYSICAL_ADDRESS MinStatePointer
435 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
437 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
438 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
440 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
442 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
443 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
449 IN UINT64 CpuGlobalId
453 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
455 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
456 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
458 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
459 @param StateBufferPointer A pointer to the returned MCA state buffer.
460 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
462 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
463 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
468 EsalMcaGetStateInfo (
469 IN UINT64 CpuGlobalId
,
470 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
471 OUT UINT64
*RequiredStateBufferSize
475 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
477 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
478 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
480 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
481 @param StateBufferPointer A pointer to the MCA state buffer.
483 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
484 @retval EFI_SUCCESS Save the processor's state info successfully
490 IN UINT64 CpuGlobalId
,
491 IN EFI_PHYSICAL_ADDRESS StateBufferPointer