2 The library implements the Extended SAL Library Class for boot service only modules.
4 Copyright (c) 2007 - 2012, 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
);
201 if (EFI_ERROR (Status
)) {
206 *((UINT64
*)(&ClassGuid
) + 0) = ClassGuidLo
;
207 *((UINT64
*)(&ClassGuid
) + 1) = ClassGuidHi
;
208 return gBS
->InstallProtocolInterface (
211 EFI_NATIVE_INTERFACE
,
217 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
219 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service
220 that was previously registered with RegisterEsalClass() through this entrypoint.
222 @param ClassGuidLo GUID of function, lower 64-bits
223 @param ClassGuidHi GUID of function, upper 64-bits
224 @param FunctionId Function in ClassGuid to call
225 @param Arg2 Argument 2 ClassGuid/FunctionId defined
226 @param Arg3 Argument 3 ClassGuid/FunctionId defined
227 @param Arg4 Argument 4 ClassGuid/FunctionId defined
228 @param Arg5 Argument 5 ClassGuid/FunctionId defined
229 @param Arg6 Argument 6 ClassGuid/FunctionId defined
230 @param Arg7 Argument 7 ClassGuid/FunctionId defined
231 @param Arg8 Argument 8 ClassGuid/FunctionId defined
233 @retval EFI_SAL_SUCCESS ESAL procedure successfully called.
234 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly
236 @retval Other Status returned from ExtendedSalProc() service of
237 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
243 IN UINT64 ClassGuidLo
,
244 IN UINT64 ClassGuidHi
,
245 IN UINT64 FunctionId
,
255 SAL_RETURN_REGS ReturnReg
;
256 EXTENDED_SAL_PROC EsalProc
;
259 // Get the entrypoint of Extended SAL
261 ReturnReg
= GetEsalEntryPoint ();
262 if (*(UINT64
*)ReturnReg
.r9
== 0 && *(UINT64
*)(ReturnReg
.r9
+ 8) == 0) {
264 // The ESAL Entry Point could not be initialized
266 ReturnReg
.Status
= EFI_SAL_ERROR
;
271 // Test PSR.it which is BIT36
273 if ((ReturnReg
.r11
& BIT36
) != 0) {
275 // Virtual mode plabel to entry point
277 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r10
;
280 // Physical mode plabel to entry point
282 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r9
;
300 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
302 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
303 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
305 @param Microseconds The number of microseconds to delay.
307 @retval EFI_SAL_SUCCESS Call completed without error.
308 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
309 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
315 IN UINTN Microseconds
319 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO
,
320 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI
,
333 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
335 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
336 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
338 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
339 If FALSE, then PalEntryPoint is a virtual address.
340 @param PalEntryPoint The PAL Entry Point being set.
342 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
343 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
344 virtual mappings for the specified Extended SAL
345 Procedure are available.
351 IN BOOLEAN PhysicalAddress
,
352 IN UINT64 PalEntryPoint
356 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
357 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
358 SetNewPalEntryFunctionId
,
370 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
372 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
373 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
375 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
376 If FALSE, then PalEntryPoint is a virtual address.
378 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
380 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
381 virtual mappings for the specified Extended SAL
382 Procedure are available.
383 @return r9 PAL entry point retrieved.
389 IN BOOLEAN PhysicalAddress
393 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
394 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
395 GetNewPalEntryFunctionId
,
407 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
409 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
410 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
412 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
413 @param McaBuffer A pointer to the base address of the returned buffer.
414 Copied from SAL_RETURN_REGS.r9.
415 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
416 Copied from SAL_RETURN_REGS.r10.
418 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
419 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
420 @return r9 Base address of the returned buffer
421 @return r10 Size of the returned buffer in bytes
428 OUT UINT8
**McaBuffer
,
429 OUT UINTN
*BufferSize
432 SAL_RETURN_REGS Regs
;
435 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
436 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
437 EsalGetStateBufferFunctionId
,
447 *McaBuffer
= (UINT8
*) Regs
.r9
;
448 *BufferSize
= Regs
.r10
;
454 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
456 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
457 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
459 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
461 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
466 EsalSaveStateBuffer (
471 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
472 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
473 EsalSaveStateBufferFunctionId
,
485 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
487 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
488 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
490 @param VectorType The vector type to retrieve.
491 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
493 @retval EFI_SAL_SUCCESS Call completed without error.
494 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
495 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
496 with the SAL Procedure SAL_SET_VECTORS.
506 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
507 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
508 EsalGetVectorsFunctionId
,
520 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
522 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
523 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
525 @param ParamInfoType The parameter type to retrieve.
526 1 - rendezvous interrupt
528 3 - Corrected Platform Error Vector.
530 @retval EFI_SAL_SUCCESS Call completed without error.
531 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
532 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
533 with the SAL Procedure SAL_MC_SET_PARAMS.
539 IN UINT64 ParamInfoType
543 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
544 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
545 EsalMcGetParamsFunctionId
,
557 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
559 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
560 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
562 @retval EFI_SAL_SUCCESS Call completed without error.
563 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
564 with the SAL Procedure SAL_MC_SET_PARAMS.
574 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
575 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
576 EsalMcGetMcParamsFunctionId
,
588 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
590 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
591 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
593 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
595 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
600 EsalGetMcCheckinFlags (
605 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
606 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
607 EsalGetMcCheckinFlagsFunctionId
,
619 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
621 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
622 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
624 @param CpuGlobalId The Global ID for the CPU being added.
625 @param Enabled The enable flag for the CPU being added.
626 TRUE means the CPU is enabled.
627 FALSE means the CPU is disabled.
628 @param PalCompatibility The PAL Compatibility value for the CPU being added.
630 @retval EFI_SAL_SUCCESS The CPU was added to the database.
631 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
637 IN UINT64 CpuGlobalId
,
639 IN UINT64 PalCompatibility
643 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
644 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
645 AddCpuDataFunctionId
,
657 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
659 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
660 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
662 @param CpuGlobalId The Global ID for the CPU being removed.
664 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
665 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
671 IN UINT64 CpuGlobalId
675 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
676 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
677 RemoveCpuDataFunctionId
,
689 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
691 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
692 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
694 @param CpuGlobalId The Global ID for the CPU being modified.
695 @param Enabled The enable flag for the CPU being modified.
696 TRUE means the CPU is enabled.
697 FALSE means the CPU is disabled.
698 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
700 @retval EFI_SAL_SUCCESS The CPU database was updated.
701 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
707 IN UINT64 CpuGlobalId
,
709 IN UINT64 PalCompatibility
713 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
714 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
715 ModifyCpuDataFunctionId
,
727 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
729 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
730 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
732 @param CpuGlobalId The Global ID for the CPU being looked up.
733 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
734 If FALSE, then the index of set of all CPUs of database is returned.
736 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
737 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
743 IN UINT64 CpuGlobalId
,
744 IN BOOLEAN IndexByEnabledCpu
748 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
749 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
750 GetCpuDataByIDFunctionId
,
762 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
764 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
765 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
767 @param Index The Global ID for the CPU being modified.
768 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
769 If FALSE, then the index of set of all CPUs of database is returned.
771 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
772 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
777 EsalGetCpuDataByIndex (
779 IN BOOLEAN IndexByEnabledCpu
783 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
784 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
785 GetCpuDataByIndexFunctionId
,
797 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
799 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
800 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
802 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
803 If FALSE, then the index of set of all CPUs of database is returned.
805 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
806 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
812 IN BOOLEAN IndexByEnabledCpu
816 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
817 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
818 CurrentProcInfoFunctionId
,
830 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
832 This function is a wrapper for the EsalNumProcessors service of Extended SAL
833 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
835 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
846 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
847 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
848 NumProcessorsFunctionId
,
860 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
862 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
863 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
865 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
866 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
867 specified by CpuGlobalId.
869 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
870 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
876 IN UINT64 CpuGlobalId
,
877 IN EFI_PHYSICAL_ADDRESS MinStatePointer
881 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
882 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
883 SetMinStateFunctionId
,
895 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
897 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
898 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
900 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
902 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
903 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
909 IN UINT64 CpuGlobalId
913 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
914 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
915 GetMinStateFunctionId
,
927 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
929 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
930 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
932 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
933 @param StateBufferPointer A pointer to the returned MCA state buffer.
934 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
936 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
937 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
942 EsalMcaGetStateInfo (
943 IN UINT64 CpuGlobalId
,
944 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
945 OUT UINT64
*RequiredStateBufferSize
948 SAL_RETURN_REGS Regs
;
951 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
952 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
953 McaGetStateInfoFunctionId
,
963 *StateBufferPointer
= (EFI_PHYSICAL_ADDRESS
) Regs
.r9
;
964 *RequiredStateBufferSize
= (UINT64
) Regs
.r10
;
970 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
972 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
973 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
975 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
976 @param StateBufferPointer A pointer to the MCA state buffer.
978 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
979 @retval EFI_SUCCESS Save the processor's state info successfully
985 IN UINT64 CpuGlobalId
,
986 IN EFI_PHYSICAL_ADDRESS StateBufferPointer
990 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
991 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
992 McaRegisterCpuFunctionId
,