27#define PERIODIC_SMI_LIBRARY_ALLOCATE_SIZE 0x08
32#define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE SIGNATURE_32 ('P', 'S', 'M', 'I')
146#define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK(a) \
149 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT, \
151 PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE \
238 if (DispatchHandle ==
NULL) {
252 if (PeriodicSmiLibraryHandler->
DispatchHandle == DispatchHandle) {
253 return PeriodicSmiLibraryHandler;
286 if (DispatchHandle ==
NULL) {
307 if (PeriodicSmiLibraryHandler->
Stack !=
NULL) {
309 PeriodicSmiLibraryHandler->
Stack,
340 if (PeriodicSmiLibraryHandler ==
NULL) {
348 return (BOOLEAN)(Index > 0);
382 return PeriodicSmiLibraryHandler;
434 if (PeriodicSmiLibraryHandler ==
NULL) {
508 if (PeriodicSmiLibraryHandler ==
NULL) {
555 if (PeriodicSmiLibraryHandler ==
NULL) {
563 if (PeriodicSmiLibraryHandler->
Stack ==
NULL) {
577 if (SetJumpFlag == 0) {
613 IN VOID *Context1 OPTIONAL,
614 IN VOID *Context2 OPTIONAL
630 PeriodicSmiLibraryHandler->
Context,
676 if (PeriodicSmiLibraryHandler->
YieldFlag) {
682 }
else if (PeriodicSmiLibraryHandler->
Stack ==
NULL) {
689 PeriodicSmiLibraryHandler->
Context,
704 PeriodicSmiLibraryHandler,
706 (UINT8 *)PeriodicSmiLibraryHandler->
Stack + PeriodicSmiLibraryHandler->
StackSize
779 IN CONST VOID *Context OPTIONAL,
780 IN OUT VOID *CommBuffer OPTIONAL,
792 if (PeriodicSmiLibraryHandler ==
NULL) {
793 return EFI_NOT_FOUND;
800 if (CommBuffer !=
NULL) {
808 if ((PeriodicSmiLibraryHandler->
Cpu == PERIODIC_SMI_LIBRARY_ANY_CPU) ||
830 PeriodicSmiLibraryHandler->
Cpu,
831 PeriodicSmiLibraryHandler
833 if (!EFI_ERROR (Status)) {
908 IN CONST VOID *Context OPTIONAL,
909 IN UINT64 TickPeriod,
921 if (DispatchFunction ==
NULL) {
922 return EFI_INVALID_PARAMETER;
932 return EFI_UNSUPPORTED;
936 return EFI_INVALID_PARAMETER;
943 if (PeriodicSmiLibraryHandler ==
NULL) {
944 return EFI_OUT_OF_RESOURCES;
953 PeriodicSmiLibraryHandler->
Context = (VOID *)Context;
954 PeriodicSmiLibraryHandler->
Cpu = Cpu;
956 if (PeriodicSmiLibraryHandler->
StackSize > 0) {
958 if (PeriodicSmiLibraryHandler->
Stack ==
NULL) {
959 return EFI_OUT_OF_RESOURCES;
980 if (EFI_ERROR (Status)) {
983 return EFI_OUT_OF_RESOURCES;
989 if (DispatchHandle !=
NULL) {
1026 if (PeriodicSmiLibraryHandler ==
NULL) {
1037 if (EFI_ERROR (Status)) {
1073 UINT64 *SmiTickInterval;
1079 Status =
gSmst->SmmLocateProtocol (
1080 &gEfiSmmPeriodicTimerDispatch2ProtocolGuid,
1091 SmiTickInterval =
NULL;
1099 }
while (SmiTickInterval !=
NULL);
1110 SmiTickInterval =
NULL;
1118 if (SmiTickInterval !=
NULL) {
1123 }
while (SmiTickInterval !=
NULL);
1175 FreePool (PeriodicSmiLibraryHandler);
UINT64 EFIAPI GetPerformanceCounterProperties(OUT UINT64 *StartValue OPTIONAL, OUT UINT64 *EndValue OPTIONAL)
UINT64 EFIAPI GetPerformanceCounter(VOID)
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
RETURNS_TWICE UINTN EFIAPI SetJump(OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer)
VOID EFIAPI SwitchStack(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack,...)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
VOID EFIAPI CpuDeadLoop(VOID)
VOID EFIAPI CpuPause(VOID)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
UINT64 EFIAPI DivU64x64Remainder(IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder OPTIONAL)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
VOID EFIAPI LongJump(IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, IN UINTN Value)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ALIGN_VALUE(Value, Alignment)
#define ASSERT_EFI_ERROR(StatusParameter)
EFI_SMM_SYSTEM_TABLE2 * gSmst
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID *EFIAPI AllocatePages(IN UINTN Pages)
LIST_ENTRY gFreePeriodicSmiLibraryHandlers
VOID EFIAPI PeriodicSmiExit(VOID)
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * GetActivePeriodicSmiLibraryHandler(VOID)
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * FindFreePeriodicSmiLibraryHandler(VOID)
UINT64 *EFIAPI PeriodicSmiSupportedTickPeriod(VOID)
EFI_STATUS EFIAPI PeriodicSmiEnable(IN OUT EFI_HANDLE *DispatchHandle OPTIONAL, IN PERIODIC_SMI_LIBRARY_HANDLER DispatchFunction, IN CONST VOID *Context OPTIONAL, IN UINT64 TickPeriod, IN UINTN Cpu, IN UINTN StackSize)
#define PERIODIC_SMI_LIBRARY_ALLOCATE_SIZE
EFI_STATUS EFIAPI SmmPeriodicSmiLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_LINK(a)
UINT64 * gSmiTickPeriodTable
UINT64 EFIAPI PeriodicSmiExecutionTime(VOID)
VOID EFIAPI PeriodicSmiDispatchFunctionSwitchStack(IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL)
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * LookupPeriodicSmiLibraryHandler(IN EFI_HANDLE DispatchHandle OPTIONAL)
LIST_ENTRY gPeriodicSmiLibraryHandlers
BOOLEAN EFIAPI PeriodicSmiDisable(IN EFI_HANDLE DispatchHandle OPTIONAL)
#define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * SetActivePeriodicSmiLibraryHandler(IN EFI_HANDLE DispatchHandle OPTIONAL)
EFI_STATUS EFIAPI PeriodicSmiDispatchFunction(IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL * gSmmPeriodicTimerDispatch2
EFI_STATUS EFIAPI SmmPeriodicSmiLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID ReclaimPeriodicSmiLibraryHandler(PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler)
VOID EFIAPI PeriodicSmiDispatchFunctionWithLock(IN OUT VOID *Buffer)
BOOLEAN EnlargeFreePeriodicSmiLibraryHandlerList(VOID)
VOID EFIAPI PeriodicSmiDispatchFunctionOnCpu(PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler)
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT * gActivePeriodicSmiLibraryHandler
UINT64 EFIAPI PeriodicSmiYield(VOID)
VOID(EFIAPI * PERIODIC_SMI_LIBRARY_HANDLER)(IN CONST VOID *Context OPTIONAL, IN UINT64 ElapsedTime)
SPIN_LOCK *EFIAPI AcquireSpinLock(IN OUT SPIN_LOCK *SpinLock)
SPIN_LOCK *EFIAPI InitializeSpinLock(OUT SPIN_LOCK *SpinLock)
SPIN_LOCK *EFIAPI ReleaseSpinLock(IN OUT SPIN_LOCK *SpinLock)
BOOLEAN EFIAPI AcquireSpinLockOrFail(IN OUT SPIN_LOCK *SpinLock)
#define EFI_SIZE_TO_PAGES(Size)
EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp
UINTN CurrentlyExecutingCpu
EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT RegisterContext
UINT64 PerfomanceCounterStartValue
BASE_LIBRARY_JUMP_BUFFER YieldJumpBuffer
EFI_HANDLE DispatchHandle
UINT64 PerfomanceCounterRate
PERIODIC_SMI_LIBRARY_HANDLER DispatchFunction
UINT64 PerfomanceCounterEndValue
BASE_LIBRARY_JUMP_BUFFER DispatchJumpBuffer
UINT64 DispatchCheckPointTime