/* This function sets the context switching stack to a new stack frame. */
VOID EFIAPI SetFspCoreStackPointer(IN VOID *NewStackTop)
/* This function sets the context switching stack to a new stack frame. */
VOID EFIAPI SetFspCoreStackPointer(IN VOID *NewStackTop)
{
  FSP_GLOBAL_DATA  *FspData;
  UINTN            *OldStack;
  UINTN            *NewStack;
  UINT32           StackContextLen;
  FspData         = GetFspGlobalDataPointer ();
  StackContextLen = sizeof (CONTEXT_STACK) / sizeof (UINTN);
  OldStack           = (UINTN *)FspData->CoreStack;
  NewStack           = (UINTN *)NewStackTop - StackContextLen - 2;
  FspData->CoreStack = (UINTN)NewStack;
  while (StackContextLen-- != 0) {
    *NewStack++ = *OldStack++;
  }
}