2 This library implements the Extended SAL Library Class for use in boot services and runtime.
4 Copyright (c) 2006 - 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>
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
);
324 if (EFI_ERROR (Status
)) {
329 *((UINT64
*)(&ClassGuid
) + 0) = ClassGuidLo
;
330 *((UINT64
*)(&ClassGuid
) + 1) = ClassGuidHi
;
331 return gBS
->InstallProtocolInterface (
334 EFI_NATIVE_INTERFACE
,
340 Calls an Extended SAL Class service that was previously registered with RegisterEsalClass().
342 This function gets the entrypoint of Extended SAL, and calls an Extended SAL Class service
343 that was previously registered with RegisterEsalClass() through this entrypoint.
345 @param ClassGuidLo GUID of function, lower 64-bits
346 @param ClassGuidHi GUID of function, upper 64-bits
347 @param FunctionId Function in ClassGuid to call
348 @param Arg2 Argument 2 ClassGuid/FunctionId defined
349 @param Arg3 Argument 3 ClassGuid/FunctionId defined
350 @param Arg4 Argument 4 ClassGuid/FunctionId defined
351 @param Arg5 Argument 5 ClassGuid/FunctionId defined
352 @param Arg6 Argument 6 ClassGuid/FunctionId defined
353 @param Arg7 Argument 7 ClassGuid/FunctionId defined
354 @param Arg8 Argument 8 ClassGuid/FunctionId defined
356 @retval EFI_SAL_SUCCESS ESAL procedure successfully called.
357 @retval EFI_SAL_ERROR The address of ExtendedSalProc() can not be correctly
359 @retval Other Status returned from ExtendedSalProc() service of
360 EXTENDED_SAL_BOOT_SERVICE_PROTOCOL.
366 IN UINT64 ClassGuidLo
,
367 IN UINT64 ClassGuidHi
,
368 IN UINT64 FunctionId
,
378 SAL_RETURN_REGS ReturnReg
;
379 EXTENDED_SAL_PROC EsalProc
;
382 // Get the entrypoint of Extended SAL
384 ReturnReg
= GetEsalEntryPoint ();
385 if (*(UINT64
*)ReturnReg
.r9
== 0 && *(UINT64
*)(ReturnReg
.r9
+ 8) == 0) {
387 // The ESAL Entry Point could not be initialized
389 ReturnReg
.Status
= EFI_SAL_ERROR
;
394 // Test PSR.it which is BIT36
396 if ((ReturnReg
.r11
& BIT36
) != 0) {
398 // Virtual mode plabel to entry point
400 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r10
;
403 // Physical mode plabel to entry point
405 EsalProc
= (EXTENDED_SAL_PROC
) ReturnReg
.r9
;
423 Wrapper for the EsalStallFunctionId service of Extended SAL Stall Services Class.
425 This function is a wrapper for the EsalStallFunctionId service of Extended SAL
426 Stall Services Class. See EsalStallFunctionId of Extended SAL Specification.
428 @param Microseconds The number of microseconds to delay.
430 @retval EFI_SAL_SUCCESS Call completed without error.
431 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
432 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR Virtual address not registered
438 IN UINTN Microseconds
442 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_LO
,
443 EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID_HI
,
456 Wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
458 This function is a wrapper for the EsalSetNewPalEntryFunctionId service of Extended SAL
459 PAL Services Services Class. See EsalSetNewPalEntryFunctionId of Extended SAL Specification.
461 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
462 If FALSE, then PalEntryPoint is a virtual address.
463 @param PalEntryPoint The PAL Entry Point being set.
465 @retval EFI_SAL_SUCCESS The PAL Entry Point was set.
466 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
467 virtual mappings for the specified Extended SAL
468 Procedure are available.
474 IN BOOLEAN PhysicalAddress
,
475 IN UINT64 PalEntryPoint
479 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
480 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
481 SetNewPalEntryFunctionId
,
493 Wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL PAL Services Services Class.
495 This function is a wrapper for the EsalGetNewPalEntryFunctionId service of Extended SAL
496 PAL Services Services Class. See EsalGetNewPalEntryFunctionId of Extended SAL Specification.
498 @param PhysicalAddress If TRUE, then PalEntryPoint is a physical address.
499 If FALSE, then PalEntryPoint is a virtual address.
501 @retval EFI_SAL_SUCCESS The PAL Entry Point was retrieved and returned in
503 @retval EFI_SAL_VIRTUAL_ADDRESS_ERROR This function was called in virtual mode before
504 virtual mappings for the specified Extended SAL
505 Procedure are available.
506 @return r9 PAL entry point retrieved.
512 IN BOOLEAN PhysicalAddress
516 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_LO
,
517 EFI_EXTENDED_SAL_PAL_SERVICES_PROTOCOL_GUID_HI
,
518 GetNewPalEntryFunctionId
,
530 Wrapper for the EsalGetStateBufferFunctionId service of Extended SAL MCA Log Services Class.
532 This function is a wrapper for the EsalGetStateBufferFunctionId service of Extended SAL
533 MCA Log Services Class. See EsalGetStateBufferFunctionId of Extended SAL Specification.
535 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
536 @param McaBuffer A pointer to the base address of the returned buffer.
537 Copied from SAL_RETURN_REGS.r9.
538 @param BufferSize A pointer to the size, in bytes, of the returned buffer.
539 Copied from SAL_RETURN_REGS.r10.
541 @retval EFI_SAL_SUCCESS The memory buffer to store error records was returned in r9 and r10.
542 @retval EFI_OUT_OF_RESOURCES A memory buffer for string error records in not available
543 @return r9 Base address of the returned buffer
544 @return r10 Size of the returned buffer in bytes
551 OUT UINT8
**McaBuffer
,
552 OUT UINTN
*BufferSize
555 SAL_RETURN_REGS Regs
;
558 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
559 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
560 EsalGetStateBufferFunctionId
,
570 *McaBuffer
= (UINT8
*) Regs
.r9
;
571 *BufferSize
= Regs
.r10
;
577 Wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL MCA Log Services Class.
579 This function is a wrapper for the EsalSaveStateBufferFunctionId service of Extended SAL
580 MCA Log Services Class. See EsalSaveStateBufferFunctionId of Extended SAL Specification.
582 @param McaType See type parameter of SAL Procedure SAL_GET_STATE_INFO.
584 @retval EFI_SUCCESS The memory buffer containing the error record was written to nonvolatile storage.
589 EsalSaveStateBuffer (
594 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_LO
,
595 EFI_EXTENDED_SAL_MCA_LOG_SERVICES_PROTOCOL_GUID_HI
,
596 EsalSaveStateBufferFunctionId
,
608 Wrapper for the EsalGetVectorsFunctionId service of Extended SAL Base Services Class.
610 This function is a wrapper for the EsalGetVectorsFunctionId service of Extended SAL
611 Base Services Class. See EsalGetVectorsFunctionId of Extended SAL Specification.
613 @param VectorType The vector type to retrieve.
614 0 - MCA, 1 - BSP INIT, 2 - BOOT_RENDEZ, 3 - AP INIT.
616 @retval EFI_SAL_SUCCESS Call completed without error.
617 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
618 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
619 with the SAL Procedure SAL_SET_VECTORS.
629 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
630 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
631 EsalGetVectorsFunctionId
,
643 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
645 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
646 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
648 @param ParamInfoType The parameter type to retrieve.
649 1 - rendezvous interrupt
651 3 - Corrected Platform Error Vector.
653 @retval EFI_SAL_SUCCESS Call completed without error.
654 @retval EFI_SAL_INVALID_ARGUMENT Invalid argument.
655 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
656 with the SAL Procedure SAL_MC_SET_PARAMS.
662 IN UINT64 ParamInfoType
666 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
667 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
668 EsalMcGetParamsFunctionId
,
680 Wrapper for the EsalMcGetParamsFunctionId service of Extended SAL Base Services Class.
682 This function is a wrapper for the EsalMcGetParamsFunctionId service of Extended SAL
683 Base Services Class. See EsalMcGetParamsFunctionId of Extended SAL Specification.
685 @retval EFI_SAL_SUCCESS Call completed without error.
686 @retval EFI_SAL_NO_INFORMATION The requested vector has not been registered
687 with the SAL Procedure SAL_MC_SET_PARAMS.
697 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
698 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
699 EsalMcGetMcParamsFunctionId
,
711 Wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL Base Services Class.
713 This function is a wrapper for the EsalGetMcCheckinFlagsFunctionId service of Extended SAL
714 Base Services Class. See EsalGetMcCheckinFlagsFunctionId of Extended SAL Specification.
716 @param CpuIndex The index of the CPU of set of enabled CPUs to check.
718 @retval EFI_SAL_SUCCESS The checkin status of the requested CPU was returned.
723 EsalGetMcCheckinFlags (
728 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_LO
,
729 EFI_EXTENDED_SAL_BASE_SERVICES_PROTOCOL_GUID_HI
,
730 EsalGetMcCheckinFlagsFunctionId
,
742 Wrapper for the EsalAddCpuDataFunctionId service of Extended SAL MP Services Class.
744 This function is a wrapper for the EsalAddCpuDataFunctionId service of Extended SAL
745 MP Services Class. See EsalAddCpuDataFunctionId of Extended SAL Specification.
747 @param CpuGlobalId The Global ID for the CPU being added.
748 @param Enabled The enable flag for the CPU being added.
749 TRUE means the CPU is enabled.
750 FALSE means the CPU is disabled.
751 @param PalCompatibility The PAL Compatibility value for the CPU being added.
753 @retval EFI_SAL_SUCCESS The CPU was added to the database.
754 @retval EFI_SAL_NOT_ENOUGH_SCRATCH There are not enough resource available to add the CPU.
760 IN UINT64 CpuGlobalId
,
762 IN UINT64 PalCompatibility
766 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
767 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
768 AddCpuDataFunctionId
,
780 Wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL MP Services Class.
782 This function is a wrapper for the EsalRemoveCpuDataFunctionId service of Extended SAL
783 MP Services Class. See EsalRemoveCpuDataFunctionId of Extended SAL Specification.
785 @param CpuGlobalId The Global ID for the CPU being removed.
787 @retval EFI_SAL_SUCCESS The CPU was removed from the database.
788 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
794 IN UINT64 CpuGlobalId
798 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
799 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
800 RemoveCpuDataFunctionId
,
812 Wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL MP Services Class.
814 This function is a wrapper for the EsalModifyCpuDataFunctionId service of Extended SAL
815 MP Services Class. See EsalModifyCpuDataFunctionId of Extended SAL Specification.
817 @param CpuGlobalId The Global ID for the CPU being modified.
818 @param Enabled The enable flag for the CPU being modified.
819 TRUE means the CPU is enabled.
820 FALSE means the CPU is disabled.
821 @param PalCompatibility The PAL Compatibility value for the CPU being modified.
823 @retval EFI_SAL_SUCCESS The CPU database was updated.
824 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
830 IN UINT64 CpuGlobalId
,
832 IN UINT64 PalCompatibility
836 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
837 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
838 ModifyCpuDataFunctionId
,
850 Wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL MP Services Class.
852 This function is a wrapper for the EsalGetCpuDataByIdFunctionId service of Extended SAL
853 MP Services Class. See EsalGetCpuDataByIdFunctionId of Extended SAL Specification.
855 @param CpuGlobalId The Global ID for the CPU being looked up.
856 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
857 If FALSE, then the index of set of all CPUs of database is returned.
859 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
860 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
866 IN UINT64 CpuGlobalId
,
867 IN BOOLEAN IndexByEnabledCpu
871 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
872 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
873 GetCpuDataByIDFunctionId
,
885 Wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL MP Services Class.
887 This function is a wrapper for the EsalGetCpuDataByIndexFunctionId service of Extended SAL
888 MP Services Class. See EsalGetCpuDataByIndexFunctionId of Extended SAL Specification.
890 @param Index The Global ID for the CPU being modified.
891 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
892 If FALSE, then the index of set of all CPUs of database is returned.
894 @retval EFI_SAL_SUCCESS The information on the specified CPU was returned.
895 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
900 EsalGetCpuDataByIndex (
902 IN BOOLEAN IndexByEnabledCpu
906 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
907 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
908 GetCpuDataByIndexFunctionId
,
920 Wrapper for the EsalWhoAmIFunctionId service of Extended SAL MP Services Class.
922 This function is a wrapper for the EsalWhoAmIFunctionId service of Extended SAL
923 MP Services Class. See EsalWhoAmIFunctionId of Extended SAL Specification.
925 @param IndexByEnabledCpu If TRUE, then the index of set of enabled CPUs of database is returned.
926 If FALSE, then the index of set of all CPUs of database is returned.
928 @retval EFI_SAL_SUCCESS The Global ID for the calling CPU was returned.
929 @retval EFI_SAL_NO_INFORMATION The calling CPU is not in the database.
935 IN BOOLEAN IndexByEnabledCpu
939 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
940 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
941 CurrentProcInfoFunctionId
,
953 Wrapper for the EsalNumProcessors service of Extended SAL MP Services Class.
955 This function is a wrapper for the EsalNumProcessors service of Extended SAL
956 MP Services Class. See EsalNumProcessors of Extended SAL Specification.
958 @retval EFI_SAL_SUCCESS The information on the number of CPUs in the platform
969 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
970 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
971 NumProcessorsFunctionId
,
983 Wrapper for the EsalSetMinStateFnctionId service of Extended SAL MP Services Class.
985 This function is a wrapper for the EsalSetMinStateFnctionId service of Extended SAL
986 MP Services Class. See EsalSetMinStateFnctionId of Extended SAL Specification.
988 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being set.
989 @param MinStatePointer The physical address of the MINSTATE buffer for the CPU
990 specified by CpuGlobalId.
992 @retval EFI_SAL_SUCCESS The MINSTATE pointer was set for the specified CPU.
993 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
999 IN UINT64 CpuGlobalId
,
1000 IN EFI_PHYSICAL_ADDRESS MinStatePointer
1004 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
1005 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
1006 SetMinStateFunctionId
,
1018 Wrapper for the EsalGetMinStateFunctionId service of Extended SAL MP Services Class.
1020 This function is a wrapper for the EsalGetMinStateFunctionId service of Extended SAL
1021 MP Services Class. See EsalGetMinStateFunctionId of Extended SAL Specification.
1023 @param CpuGlobalId The Global ID for the CPU whose MINSTATE pointer is being retrieved.
1025 @retval EFI_SAL_SUCCESS The MINSTATE pointer for the specified CPU was retrieved.
1026 @retval EFI_SAL_NO_INFORMATION The specified CPU is not in the database.
1032 IN UINT64 CpuGlobalId
1036 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_LO
,
1037 EFI_EXTENDED_SAL_MP_SERVICES_PROTOCOL_GUID_HI
,
1038 GetMinStateFunctionId
,
1050 Wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL MCA Services Class.
1052 This function is a wrapper for the EsalMcsGetStateInfoFunctionId service of Extended SAL
1053 MCA Services Class. See EsalMcsGetStateInfoFunctionId of Extended SAL Specification.
1055 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being retrieved.
1056 @param StateBufferPointer A pointer to the returned MCA state buffer.
1057 @param RequiredStateBufferSize A pointer to the size, in bytes, of the returned MCA state buffer.
1059 @retval EFI_SUCCESS MINSTATE successfully got and size calculated.
1060 @retval EFI_SAL_NO_INFORMATION Fail to get MINSTATE.
1065 EsalMcaGetStateInfo (
1066 IN UINT64 CpuGlobalId
,
1067 OUT EFI_PHYSICAL_ADDRESS
*StateBufferPointer
,
1068 OUT UINT64
*RequiredStateBufferSize
1071 SAL_RETURN_REGS Regs
;
1074 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
1075 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
1076 McaGetStateInfoFunctionId
,
1086 *StateBufferPointer
= (EFI_PHYSICAL_ADDRESS
) Regs
.r9
;
1087 *RequiredStateBufferSize
= (UINT64
) Regs
.r10
;
1093 Wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL MCA Services Class.
1095 This function is a wrapper for the EsalMcaRegisterCpuFunctionId service of Extended SAL
1096 MCA Services Class. See EsalMcaRegisterCpuFunctionId of Extended SAL Specification.
1098 @param CpuGlobalId The Global ID for the CPU whose MCA state buffer is being set.
1099 @param StateBufferPointer A pointer to the MCA state buffer.
1101 @retval EFI_SAL_NO_INFORMATION Cannot get the processor info with the CpuId
1102 @retval EFI_SUCCESS Save the processor's state info successfully
1107 EsalMcaRegisterCpu (
1108 IN UINT64 CpuGlobalId
,
1109 IN EFI_PHYSICAL_ADDRESS StateBufferPointer
1113 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_LO
,
1114 EFI_EXTENDED_SAL_MCA_SERVICES_PROTOCOL_GUID_HI
,
1115 McaRegisterCpuFunctionId
,