/* If EntryPoint is NULL, then ASSERT(). If NewStack is NULL, then ASSERT(). */
VOID EFIAPI InternalSwitchStack(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack, IN VA_LIST Marker)
/* If EntryPoint is NULL, then ASSERT(). If NewStack is NULL, then ASSERT(). */
VOID EFIAPI InternalSwitchStack(IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *NewStack, IN VA_LIST Marker)
{
  BASE_LIBRARY_JUMP_BUFFER  JumpBuffer;
  JumpBuffer.Eip               = (UINTN)EntryPoint;
  JumpBuffer.Esp               = (UINTN)NewStack - sizeof (VOID *);
  JumpBuffer.Esp              -= sizeof (Context1) + sizeof (Context2);
  ((VOID **)JumpBuffer.Esp)[1] = Context1;
  ((VOID **)JumpBuffer.Esp)[2] = Context2;
  LongJump (&JumpBuffer, (UINTN)-1);
}