2 The library implements the Extended SAL Library Class for boot service only modules.
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.
17 #include <Protocol/ExtendedSalBootService.h>
18 #include <Protocol/ExtendedSalServiceClasses.h>
20 #include <Library/ExtendedSalLib.h>
21 #include <Library/UefiBootServicesTableLib.h>
22 #include <Library/DebugLib.h>
25 Stores the physical plabel of ESAL entrypoint.
27 This assembly function stores the physical plabel of ESAL entrypoint
28 where GetEsalEntryPoint() can easily retrieve.
30 @param EntryPoint Physical address of ESAL entrypoint
31 @param Gp Physical GP of ESAL entrypoint
33 @return r8 = EFI_SAL_SUCCESS
38 SetEsalPhysicalEntryPoint (
44 Retrieves plabel of ESAL entrypoint.
46 This function retrives plabel of ESAL entrypoint stored by
47 SetEsalPhysicalEntryPoint().
49 @return r8 = EFI_SAL_SUCCESS
61 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL
*mEsalBootService
= NULL
;
65 Constructor function to get Extended SAL Boot Service Protocol, and initializes
66 physical plabel of ESAL entrypoint.
68 This function first locates Extended SAL Boot Service Protocol and caches it in global variable.
69 Then it initializes the physical plable of ESAL entrypoint, and stores
70 it where GetEsalEntryPoint() can easily retrieve.
72 @param ImageHandle The firmware allocated handle for the EFI image.
73 @param SystemTable A pointer to the EFI System Table.
75 @retval EFI_SUCCESS Plable of ESAL entrypoint successfully stored.
80 DxeExtendedSalLibConstruct (
81 IN EFI_HANDLE ImageHandle
,
82 IN EFI_SYSTEM_TABLE
*SystemTable
89 // The protocol contains a function pointer, which is an indirect procedure call.
90 // An indirect procedure call goes through a plabel, and pointer to a function is
91 // a pointer to a plabel. To implement indirect procedure calls that can work in
92 // both physical and virtual mode, two plabels are required (one physical and one
93 // virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it
94 // away. We cache it in a module global, so we can register the vitrual version.
96 Status
= gBS
->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid
, NULL
, (VOID
**) &mEsalBootService
);
97 ASSERT_EFI_ERROR (Status
);
99 Plabel
= (EFI_PLABEL
*) (UINTN
) mEsalBootService
->ExtendedSalProc
;
100 mPlabel
.EntryPoint
= Plabel
->EntryPoint
;
101 mPlabel
.GP
= Plabel
->GP
;
103 // Stores the physical plabel of ESAL entrypoint where GetEsalEntryPoint() can easily retrieve.
105 SetEsalPhysicalEntryPoint (mPlabel
.EntryPoint
, mPlabel
.GP
);
111 Registers function of ESAL class and it's associated global.
113 This function registers function of ESAL class, together with its associated global.
114 It is worker function for RegisterEsalClass().
115 It is only for boot time.
117 @param FunctionId ID of function to register
118 @param ClassGuidLo GUID of ESAL class, lower 64-bits
119 @param ClassGuidHi GUID of ESAL class, upper 64-bits
120 @param Function Function to register with ClassGuid/FunctionId pair
121 @param ModuleGlobal Module global for the function.
123 @return Status returned by RegisterExtendedSalProc() of Extended SAL Boot Service Protocol
127 RegisterEsalFunction (
128 IN UINT64 FunctionId
,
129 IN UINT64 ClassGuidLo
,
130 IN UINT64 ClassGuidHi
,
131 IN SAL_INTERNAL_EXTENDED_SAL_PROC Function
,
132 IN VOID
*ModuleGlobal
135 return mEsalBootService
->RegisterExtendedSalProc (
146 Registers ESAL Class and it's associated global.
148 This function registers one or more Extended SAL services in a given
149 class along with the associated global context.
150 This function is only available prior to ExitBootServices().
152 @param ClassGuidLo GUID of function class, lower 64-bits
153 @param ClassGuidHi GUID of function class, upper 64-bits
154 @param ModuleGlobal Module global for the class.
155 @param ... List of Function/FunctionId pairs, ended by NULL
157 @retval EFI_SUCCESS The Extended SAL services were registered.
158 @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
159 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
160 @retval Other ClassGuid could not be installed onto a new handle.
166 IN CONST UINT64 ClassGuidLo
,
167 IN CONST UINT64 ClassGuidHi
,
168 IN VOID
*ModuleGlobal
, OPTIONAL
174 SAL_INTERNAL_EXTENDED_SAL_PROC Function
;
176 EFI_HANDLE NewHandle
;
179 VA_START (Args
, ModuleGlobal
);
182 // Register all functions of the class to register.
184 Status
= EFI_SUCCESS
;
185 while (!EFI_ERROR (Status
)) {
186 Function
= (SAL_INTERNAL_EXTENDED_SAL_PROC
) VA_ARG (Args
, SAL_INTERNAL_EXTENDED_SAL_PROC
);
188 // NULL serves as the end mark of function list
190 if (Function
== NULL
) {
194 FunctionId
= VA_ARG (Args
, UINT64
);
196 Status
= RegisterEsalFunction (FunctionId
, ClassGuidLo
, ClassGuidHi
, Function
, ModuleGlobal
);
199 if (EFI_ERROR (Status
)) {
204 *((UINT64
*)(&ClassGuid
) + 0) = ClassGuidLo
;
205 *((UINT64
*)(&ClassGuid
) + 1) = ClassGuidHi
;
206 return gBS
->InstallProtocolInterface (
209 EFI_NATIVE_INTERFACE
,
215 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
217 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service
218 that was previously registered with RegisterEsalClass() through this entrypoint.
220 @param ClassGuidLo GUID of function, lower 64-bits
221 @param ClassGuidHi GUID of function, upper 64-bits
222 @param FunctionId Function in ClassGuid to call
223 @param Arg2 Argument 2 ClassGuid/FunctionId defined
224 @param Arg3 Argument 3 ClassGuid/FunctionId defined
225 @param Arg4 Argument 4 ClassGuid/FunctionId defined
226 @param Arg5 Argument 5 ClassGuid/FunctionId defined
227 @param Arg6 Argument 6 ClassGuid/FunctionId defined
228 @param Arg7 Argument 7 ClassGuid/FunctionId defined
229 @param Arg8 Argument 8 ClassGuid/FunctionId defined
231 @retval EFI_SAL_SUCCESS ESAL procedure successfully called.
232 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly
234 @retval Other Status returned from ExtendedSalProc() service of
235 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
241 IN UINT64 ClassGuidLo
,
242 IN UINT64 ClassGuidHi
,
243 IN UINT64 FunctionId
,
253 SAL_RETURN_REGS ReturnReg
;
254 EXTENDED_SAL_PROC EsalProc
;
257 // Get the entrypoint of Extended SAL
259 ReturnReg
= GetEsalEntryPoint ();
260 if (*(UINT64
*)ReturnReg
.r9
== 0 && *(UINT64
*)(ReturnReg
.r9
+ 8) == 0) {
262 // The ESAL Entry Point could not be initialized
264 ReturnReg
.Status
= EFI_SAL_ERROR
;
269 // Test PSR.it which is BIT36
271 if ((ReturnReg
.r11
& BIT36
) != 0) {
273 // Virtual mode plabel to entry point
275 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r10
;
278 // Physical mode plabel to entry point
280 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r9
;
298 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
300 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
301 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
303 @param Microseconds The number of microseconds to delay.
305 @retval EFI_SAL_SUCCESS Call completed without error.
306 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
307 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
313 IN UINTN Microseconds
317 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO
,
318 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI
,
331 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
333 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
334 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
336 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
337 If FALSE, then PalEntryPoint is a virtual address.
338 @param PalEntryPoint The PAL Entry Point being set.
340 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
341 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
342 virtual mappings for the specified Extended SAL
343 Procedure are available.
349 IN BOOLEAN PhysicalAddress
,
350 IN UINT64 PalEntryPoint
354 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
355 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
356 SetNewPalEntryFunctionId
,
368 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
370 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
371 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
373 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
374 If FALSE, then PalEntryPoint is a virtual address.
376 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
378 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
379 virtual mappings for the specified Extended SAL
380 Procedure are available.
381 @return r9 PAL entry point retrieved.
387 IN BOOLEAN PhysicalAddress
391 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
392 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
393 GetNewPalEntryFunctionId
,
405 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
407 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
408 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
410 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
411 @param McaBuffer A pointer to the base address of the returned buffer.
412 Copied from SAL_RETURN_REGS.r9.
413 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
414 Copied from SAL_RETURN_REGS.r10.
416 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
417 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
418 @return r9 Base address of the returned buffer
419 @return r10 Size of the returned buffer in bytes
426 OUT UINT8
**McaBuffer
,
427 OUT UINTN
*BufferSize
430 SAL_RETURN_REGS Regs
;
433 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
434 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
435 EsalGetStateBufferFunctionId
,
445 *McaBuffer
= (UINT8
*) Regs
.r9
;
446 *BufferSize
= Regs
.r10
;
452 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
454 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
455 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
457 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
459 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
464 EsalSaveStateBuffer (
469 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
470 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
471 EsalSaveStateBufferFunctionId
,
483 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
485 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
486 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
488 @param VectorType The vector type to retrieve.
489 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
491 @retval EFI_SAL_SUCCESS Call completed without error.
492 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
493 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
494 with the SAL Procedure SAL_SET_VECTORS.
504 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
505 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
506 EsalGetVectorsFunctionId
,
518 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
520 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
521 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
523 @param ParamInfoType The parameter type to retrieve.
524 1 - rendezvous interrupt
526 3 - Corrected Platform Error Vector.
528 @retval EFI_SAL_SUCCESS Call completed without error.
529 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
530 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
531 with the SAL Procedure SAL_MC_SET_PARAMS.
537 IN UINT64 ParamInfoType
541 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
542 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
543 EsalMcGetParamsFunctionId
,
555 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
557 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
558 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
560 @retval EFI_SAL_SUCCESS Call completed without error.
561 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
562 with the SAL Procedure SAL_MC_SET_PARAMS.
572 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
573 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
574 EsalMcGetMcParamsFunctionId
,
586 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
588 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
589 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
591 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
593 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
598 EsalGetMcCheckinFlags (
603 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
604 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
605 EsalGetMcCheckinFlagsFunctionId
,
617 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
619 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
620 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
622 @param CpuGlobalId The Global ID for the CPU being added.
623 @param Enabled The enable flag for the CPU being added.
624 TRUE means the CPU is enabled.
625 FALSE means the CPU is disabled.
626 @param PalCompatibility The PAL Compatibility value for the CPU being added.
628 @retval EFI_SAL_SUCCESS The CPU was added to the database.
629 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
635 IN UINT64 CpuGlobalId
,
637 IN UINT64 PalCompatibility
641 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
642 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
643 AddCpuDataFunctionId
,
655 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
657 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
658 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
660 @param CpuGlobalId The Global ID for the CPU being removed.
662 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
663 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
669 IN UINT64 CpuGlobalId
673 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
674 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
675 RemoveCpuDataFunctionId
,
687 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
689 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
690 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
692 @param CpuGlobalId The Global ID for the CPU being modified.
693 @param Enabled The enable flag for the CPU being modified.
694 TRUE means the CPU is enabled.
695 FALSE means the CPU is disabled.
696 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
698 @retval EFI_SAL_SUCCESS The CPU database was updated.
699 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
705 IN UINT64 CpuGlobalId
,
707 IN UINT64 PalCompatibility
711 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
712 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
713 ModifyCpuDataFunctionId
,
725 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
727 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
728 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
730 @param CpuGlobalId The Global ID for the CPU being looked up.
731 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
732 If FALSE, then the index of set of all CPUs of database is returned.
734 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
735 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
741 IN UINT64 CpuGlobalId
,
742 IN BOOLEAN IndexByEnabledCpu
746 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
747 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
748 GetCpuDataByIDFunctionId
,
760 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
762 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
763 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
765 @param Index The Global ID for the CPU being modified.
766 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
767 If FALSE, then the index of set of all CPUs of database is returned.
769 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
770 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
775 EsalGetCpuDataByIndex (
777 IN BOOLEAN IndexByEnabledCpu
781 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
782 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
783 GetCpuDataByIndexFunctionId
,
795 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
797 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
798 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
800 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
801 If FALSE, then the index of set of all CPUs of database is returned.
803 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
804 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
810 IN BOOLEAN IndexByEnabledCpu
814 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
815 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
816 CurrentProcInfoFunctionId
,
828 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
830 This function is a wrapper for the EsalNumProcessors service of Extended SAL
831 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
833 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
844 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
845 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
846 NumProcessorsFunctionId
,
858 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
860 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
861 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
863 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
864 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
865 specified by CpuGlobalId.
867 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
868 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
874 IN UINT64 CpuGlobalId
,
875 IN EFI_PHYSICAL_ADDRESS MinStatePointer
879 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
880 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
881 SetMinStateFunctionId
,
893 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
895 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
896 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
898 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
900 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
901 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
907 IN UINT64 CpuGlobalId
911 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
912 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
913 GetMinStateFunctionId
,
925 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
927 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
928 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
930 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
931 @param StateBufferPointer A pointer to the returned MCA state buffer.
932 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
934 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
935 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
940 EsalMcaGetStateInfo (
941 IN UINT64 CpuGlobalId
,
942 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
943 OUT UINT64
*RequiredStateBufferSize
946 SAL_RETURN_REGS Regs
;
949 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
950 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
951 McaGetStateInfoFunctionId
,
961 *StateBufferPointer
= (EFI_PHYSICAL_ADDRESS
) Regs
.r9
;
962 *RequiredStateBufferSize
= (UINT64
) Regs
.r10
;
968 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
970 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
971 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
973 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
974 @param StateBufferPointer A pointer to the MCA state buffer.
976 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
977 @retval EFI_SUCCESS Save the processor's state info successfully
983 IN UINT64 CpuGlobalId
,
984 IN EFI_PHYSICAL_ADDRESS StateBufferPointer
988 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
989 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
990 McaRegisterCpuFunctionId
,