2 This library implements the Extended SAL Library Class for use in boot services and runtime.
4 Copyright (c) 2006 - 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>
19 #include <Guid/EventGroup.h>
21 #include <Library/ExtendedSalLib.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/UefiRuntimeServicesTableLib.h>
24 #include <Library/UefiRuntimeLib.h>
25 #include <Library/DebugLib.h>
28 Stores the virtual plabel of ESAL entrypoint.
30 This assembly function stores the virtual plabel of ESAL entrypoint
31 where GetEsalEntryPoint() can easily retrieve.
33 @param EntryPoint Virtual address of ESAL entrypoint
34 @param Gp Virtual GP of ESAL entrypoint
36 @return r8 = EFI_SAL_SUCCESS
41 SetEsalVirtualEntryPoint (
47 Stores the physical plabel of ESAL entrypoint.
49 This assembly function stores the physical plabel of ESAL entrypoint
50 where GetEsalEntryPoint() can easily retrieve.
52 @param EntryPoint Physical address of ESAL entrypoint
53 @param Gp Physical GP of ESAL entrypoint
55 @return r8 = EFI_SAL_SUCCESS
60 SetEsalPhysicalEntryPoint (
66 Retrieves plabel of ESAL entrypoint.
68 This function retrives plabel of ESAL entrypoint stored by
69 SetEsalPhysicalEntryPoint().
71 @return r8 = EFI_SAL_SUCCESS
83 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL
*mEsalBootService
= NULL
;
85 EFI_EVENT mEfiVirtualNotifyEvent
;
88 Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE to set virtual plabel of
91 This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
92 It converts physical plabel of ESAL entrypoint to virtual plabel and stores it where
93 GetEsalEntryPoint() can easily retrieve.
95 @param Event Event whose notification function is being invoked.
96 @param Context Pointer to the notification function's context
101 ExtendedSalVirtualNotifyEvent (
106 UINT64 PhysicalEntryPoint
;
108 PhysicalEntryPoint
= mPlabel
.EntryPoint
;
110 gRT
->ConvertPointer (0x0, (VOID
**) &mPlabel
.EntryPoint
);
112 mPlabel
.GP
+= mPlabel
.EntryPoint
- PhysicalEntryPoint
;
114 SetEsalVirtualEntryPoint (mPlabel
.EntryPoint
, mPlabel
.GP
);
118 Gets Extended SAL Boot Service Protocol, and initializes physical plabel of
121 This function first locates Extended SAL Boot Service Protocol and caches it in global variable.
122 Then it initializes the physical plable of ESAL entrypoint, and stores
123 it where GetEsalEntryPoint() can easily retrieve.
125 @retval EFI_SUCCESS Plable of ESAL entrypoint successfully stored.
129 DxeSalLibInitialize (
137 // The protocol contains a function pointer, which is an indirect procedure call.
138 // An indirect procedure call goes through a plabel, and pointer to a function is
139 // a pointer to a plabel. To implement indirect procedure calls that can work in
140 // both physical and virtual mode, two plabels are required (one physical and one
141 // virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it
142 // away. We cache it in a module global, so we can register the vitrual version.
144 Status
= gBS
->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid
, NULL
, (VOID
**) &mEsalBootService
);
145 ASSERT_EFI_ERROR (Status
);
147 Plabel
= (EFI_PLABEL
*) (UINTN
) mEsalBootService
->ExtendedSalProc
;
148 mPlabel
.EntryPoint
= Plabel
->EntryPoint
;
149 mPlabel
.GP
= Plabel
->GP
;
151 // Stores the physical plabel of ESAL entrypoint where GetEsalEntryPoint() can easily retrieve.
153 SetEsalPhysicalEntryPoint (mPlabel
.EntryPoint
, mPlabel
.GP
);
159 Constructor function to initializes physical plabel of ESAL entrypoint and register an event
160 for initialization of virtual plabel of ESAL entrypoint.
162 This is the library constructor function to call a function to initialize physical plabel of ESAL entrypoint
163 and to register notification function for
164 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, which sets virtual plabel of ESAL entrypoint.
166 @param ImageHandle The firmware allocated handle for the EFI image.
167 @param SystemTable A pointer to the EFI System Table.
169 @retval EFI_SUCCESS Notification function successfully registered.
174 DxeRuntimeExtendedSalLibConstruct (
175 IN EFI_HANDLE ImageHandle
,
176 IN EFI_SYSTEM_TABLE
*SystemTable
182 // Register notify function for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
184 ASSERT (gBS
!= NULL
);
186 DxeSalLibInitialize ();
188 Status
= gBS
->CreateEventEx (
191 ExtendedSalVirtualNotifyEvent
,
193 &gEfiEventVirtualAddressChangeGuid
,
194 &mEfiVirtualNotifyEvent
197 ASSERT_EFI_ERROR (Status
);
203 Destructor function to close the event created by the library constructor
205 This is the library destructor function to close the event with type of
206 EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE, which is created by the library constructor.
208 @param ImageHandle The firmware allocated handle for the EFI image.
209 @param SystemTable A pointer to the EFI System Table.
211 @retval EFI_SUCCESS Event successfully closed.
216 DxeRuntimeExtendedSalLibDeconstruct (
217 IN EFI_HANDLE ImageHandle
,
218 IN EFI_SYSTEM_TABLE
*SystemTable
224 // Close SetVirtualAddressMap () notify function
226 ASSERT (gBS
!= NULL
);
227 Status
= gBS
->CloseEvent (mEfiVirtualNotifyEvent
);
228 ASSERT_EFI_ERROR (Status
);
234 Registers function of ESAL class and it's associated global.
236 This function registers function of ESAL class, together with its associated global.
237 It is worker function for RegisterEsalClass().
238 It is only for boot time.
240 @param FunctionId ID of function to register
241 @param ClassGuidLo GUID of ESAL class, lower 64-bits
242 @param ClassGuidHi GUID of ESAL class, upper 64-bits
243 @param Function Function to register with ClassGuid/FunctionId pair
244 @param ModuleGlobal Module global for the function.
246 @return Status returned by RegisterExtendedSalProc() of Extended SAL Boot Service Protocol
250 RegisterEsalFunction (
251 IN UINT64 FunctionId
,
252 IN UINT64 ClassGuidLo
,
253 IN UINT64 ClassGuidHi
,
254 IN SAL_INTERNAL_EXTENDED_SAL_PROC Function
,
255 IN VOID
*ModuleGlobal
258 return mEsalBootService
->RegisterExtendedSalProc (
269 Registers ESAL Class and it's associated global.
271 This function registers one or more Extended SAL services in a given
272 class along with the associated global context.
273 This function is only available prior to ExitBootServices().
275 @param ClassGuidLo GUID of function class, lower 64-bits
276 @param ClassGuidHi GUID of function class, upper 64-bits
277 @param ModuleGlobal Module global for the class.
278 @param ... List of Function/FunctionId pairs, ended by NULL
280 @retval EFI_SUCCESS The Extended SAL services were registered.
281 @retval EFI_UNSUPPORTED This function was called after ExitBootServices().
282 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register one or more of the specified services.
283 @retval Other ClassGuid could not be installed onto a new handle.
289 IN CONST UINT64 ClassGuidLo
,
290 IN CONST UINT64 ClassGuidHi
,
291 IN VOID
*ModuleGlobal
, OPTIONAL
297 SAL_INTERNAL_EXTENDED_SAL_PROC Function
;
299 EFI_HANDLE NewHandle
;
302 VA_START (Args
, ModuleGlobal
);
305 // Register all functions of the class to register.
307 Status
= EFI_SUCCESS
;
308 while (!EFI_ERROR (Status
)) {
309 Function
= (SAL_INTERNAL_EXTENDED_SAL_PROC
) VA_ARG (Args
, SAL_INTERNAL_EXTENDED_SAL_PROC
);
311 // NULL serves as the end mark of function list
313 if (Function
== NULL
) {
317 FunctionId
= VA_ARG (Args
, UINT64
);
319 Status
= RegisterEsalFunction (FunctionId
, ClassGuidLo
, ClassGuidHi
, Function
, ModuleGlobal
);
322 if (EFI_ERROR (Status
)) {
327 *((UINT64
*)(&ClassGuid
) + 0) = ClassGuidLo
;
328 *((UINT64
*)(&ClassGuid
) + 1) = ClassGuidHi
;
329 return gBS
->InstallProtocolInterface (
332 EFI_NATIVE_INTERFACE
,
338 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
340 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service
341 that was previously registered with RegisterEsalClass() through this entrypoint.
343 @param ClassGuidLo GUID of function, lower 64-bits
344 @param ClassGuidHi GUID of function, upper 64-bits
345 @param FunctionId Function in ClassGuid to call
346 @param Arg2 Argument 2 ClassGuid/FunctionId defined
347 @param Arg3 Argument 3 ClassGuid/FunctionId defined
348 @param Arg4 Argument 4 ClassGuid/FunctionId defined
349 @param Arg5 Argument 5 ClassGuid/FunctionId defined
350 @param Arg6 Argument 6 ClassGuid/FunctionId defined
351 @param Arg7 Argument 7 ClassGuid/FunctionId defined
352 @param Arg8 Argument 8 ClassGuid/FunctionId defined
354 @retval EFI_SAL_SUCCESS ESAL procedure successfully called.
355 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly
357 @retval Other Status returned from ExtendedSalProc() service of
358 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
364 IN UINT64 ClassGuidLo
,
365 IN UINT64 ClassGuidHi
,
366 IN UINT64 FunctionId
,
376 SAL_RETURN_REGS ReturnReg
;
377 EXTENDED_SAL_PROC EsalProc
;
380 // Get the entrypoint of Extended SAL
382 ReturnReg
= GetEsalEntryPoint ();
383 if (*(UINT64
*)ReturnReg
.r9
== 0 && *(UINT64
*)(ReturnReg
.r9
+ 8) == 0) {
385 // The ESAL Entry Point could not be initialized
387 ReturnReg
.Status
= EFI_SAL_ERROR
;
392 // Test PSR.it which is BIT36
394 if ((ReturnReg
.r11
& BIT36
) != 0) {
396 // Virtual mode plabel to entry point
398 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r10
;
401 // Physical mode plabel to entry point
403 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r9
;
421 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
423 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
424 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
426 @param Microseconds The number of microseconds to delay.
428 @retval EFI_SAL_SUCCESS Call completed without error.
429 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
430 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
436 IN UINTN Microseconds
440 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO
,
441 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI
,
454 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
456 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
457 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
459 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
460 If FALSE, then PalEntryPoint is a virtual address.
461 @param PalEntryPoint The PAL Entry Point being set.
463 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
464 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
465 virtual mappings for the specified Extended SAL
466 Procedure are available.
472 IN BOOLEAN PhysicalAddress
,
473 IN UINT64 PalEntryPoint
477 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
478 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
479 SetNewPalEntryFunctionId
,
491 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
493 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
494 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
496 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
497 If FALSE, then PalEntryPoint is a virtual address.
499 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
501 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
502 virtual mappings for the specified Extended SAL
503 Procedure are available.
504 @return r9 PAL entry point retrieved.
510 IN BOOLEAN PhysicalAddress
514 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
515 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
516 GetNewPalEntryFunctionId
,
528 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
530 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
531 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
533 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
534 @param McaBuffer A pointer to the base address of the returned buffer.
535 Copied from SAL_RETURN_REGS.r9.
536 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
537 Copied from SAL_RETURN_REGS.r10.
539 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
540 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
541 @return r9 Base address of the returned buffer
542 @return r10 Size of the returned buffer in bytes
549 OUT UINT8
**McaBuffer
,
550 OUT UINTN
*BufferSize
553 SAL_RETURN_REGS Regs
;
556 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
557 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
558 EsalGetStateBufferFunctionId
,
568 *McaBuffer
= (UINT8
*) Regs
.r9
;
569 *BufferSize
= Regs
.r10
;
575 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
577 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
578 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
580 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
582 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
587 EsalSaveStateBuffer (
592 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
593 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
594 EsalSaveStateBufferFunctionId
,
606 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
608 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
609 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
611 @param VectorType The vector type to retrieve.
612 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
614 @retval EFI_SAL_SUCCESS Call completed without error.
615 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
616 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
617 with the SAL Procedure SAL_SET_VECTORS.
627 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
628 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
629 EsalGetVectorsFunctionId
,
641 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
643 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
644 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
646 @param ParamInfoType The parameter type to retrieve.
647 1 - rendezvous interrupt
649 3 - Corrected Platform Error Vector.
651 @retval EFI_SAL_SUCCESS Call completed without error.
652 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
653 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
654 with the SAL Procedure SAL_MC_SET_PARAMS.
660 IN UINT64 ParamInfoType
664 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
665 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
666 EsalMcGetParamsFunctionId
,
678 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
680 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
681 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
683 @retval EFI_SAL_SUCCESS Call completed without error.
684 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
685 with the SAL Procedure SAL_MC_SET_PARAMS.
695 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
696 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
697 EsalMcGetMcParamsFunctionId
,
709 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
711 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
712 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
714 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
716 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
721 EsalGetMcCheckinFlags (
726 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
727 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
728 EsalGetMcCheckinFlagsFunctionId
,
740 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
742 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
743 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
745 @param CpuGlobalId The Global ID for the CPU being added.
746 @param Enabled The enable flag for the CPU being added.
747 TRUE means the CPU is enabled.
748 FALSE means the CPU is disabled.
749 @param PalCompatibility The PAL Compatibility value for the CPU being added.
751 @retval EFI_SAL_SUCCESS The CPU was added to the database.
752 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
758 IN UINT64 CpuGlobalId
,
760 IN UINT64 PalCompatibility
764 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
765 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
766 AddCpuDataFunctionId
,
778 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
780 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
781 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
783 @param CpuGlobalId The Global ID for the CPU being removed.
785 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
786 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
792 IN UINT64 CpuGlobalId
796 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
797 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
798 RemoveCpuDataFunctionId
,
810 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
812 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
813 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
815 @param CpuGlobalId The Global ID for the CPU being modified.
816 @param Enabled The enable flag for the CPU being modified.
817 TRUE means the CPU is enabled.
818 FALSE means the CPU is disabled.
819 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
821 @retval EFI_SAL_SUCCESS The CPU database was updated.
822 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
828 IN UINT64 CpuGlobalId
,
830 IN UINT64 PalCompatibility
834 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
835 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
836 ModifyCpuDataFunctionId
,
848 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
850 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
851 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
853 @param CpuGlobalId The Global ID for the CPU being looked up.
854 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
855 If FALSE, then the index of set of all CPUs of database is returned.
857 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
858 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
864 IN UINT64 CpuGlobalId
,
865 IN BOOLEAN IndexByEnabledCpu
869 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
870 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
871 GetCpuDataByIDFunctionId
,
883 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
885 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
886 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
888 @param Index The Global ID for the CPU being modified.
889 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
890 If FALSE, then the index of set of all CPUs of database is returned.
892 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
893 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
898 EsalGetCpuDataByIndex (
900 IN BOOLEAN IndexByEnabledCpu
904 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
905 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
906 GetCpuDataByIndexFunctionId
,
918 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
920 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
921 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
923 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
924 If FALSE, then the index of set of all CPUs of database is returned.
926 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
927 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
933 IN BOOLEAN IndexByEnabledCpu
937 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
938 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
939 CurrentProcInfoFunctionId
,
951 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
953 This function is a wrapper for the EsalNumProcessors service of Extended SAL
954 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
956 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
967 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
968 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
969 NumProcessorsFunctionId
,
981 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
983 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
984 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
986 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
987 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
988 specified by CpuGlobalId.
990 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
991 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
997 IN UINT64 CpuGlobalId
,
998 IN EFI_PHYSICAL_ADDRESS MinStatePointer
1002 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
1003 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
1004 SetMinStateFunctionId
,
1016 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
1018 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
1019 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
1021 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
1023 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
1024 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
1030 IN UINT64 CpuGlobalId
1034 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
1035 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
1036 GetMinStateFunctionId
,
1048 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
1050 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
1051 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
1053 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
1054 @param StateBufferPointer A pointer to the returned MCA state buffer.
1055 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
1057 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
1058 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
1063 EsalMcaGetStateInfo (
1064 IN UINT64 CpuGlobalId
,
1065 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
1066 OUT UINT64
*RequiredStateBufferSize
1069 SAL_RETURN_REGS Regs
;
1072 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
1073 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
1074 McaGetStateInfoFunctionId
,
1084 *StateBufferPointer
= (EFI_PHYSICAL_ADDRESS
) Regs
.r9
;
1085 *RequiredStateBufferSize
= (UINT64
) Regs
.r10
;
1091 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
1093 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
1094 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
1096 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
1097 @param StateBufferPointer A pointer to the MCA state buffer.
1099 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
1100 @retval EFI_SUCCESS Save the processor's state info successfully
1105 EsalMcaRegisterCpu (
1106 IN UINT64 CpuGlobalId
,
1107 IN EFI_PHYSICAL_ADDRESS StateBufferPointer
1111 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
1112 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
1113 McaRegisterCpuFunctionId
,