/* Internal worker function that moves the specified periodic SMI handler from the list of managed periodic SMI handlers to the list of free periodic SMI handlers. */
VOID ReclaimPeriodicSmiLibraryHandler(PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler)
/* Internal worker function that moves the specified periodic SMI handler from the list of managed periodic SMI handlers to the list of free periodic SMI handlers. */
VOID ReclaimPeriodicSmiLibraryHandler(PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler)
{
  ASSERT (PeriodicSmiLibraryHandler->DispatchHandle == NULL);
  if (PeriodicSmiLibraryHandler->Stack != NULL) {
    FreePages (
      PeriodicSmiLibraryHandler->Stack,
      EFI_SIZE_TO_PAGES (PeriodicSmiLibraryHandler->StackSize)
      );
    PeriodicSmiLibraryHandler->Stack = NULL;
  }
  RemoveEntryList (&PeriodicSmiLibraryHandler->Link);
  InsertHeadList (&gFreePeriodicSmiLibraryHandlers, &PeriodicSmiLibraryHandler->Link);
}