/* Performs the necessary steps in preparation for invoking VMGEXIT. Must be called before setting any fields within the GHCB. */
VOID EFIAPI CcExitVmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
/* Performs the necessary steps in preparation for invoking VMGEXIT. Must be called before setting any fields within the GHCB. */
VOID EFIAPI CcExitVmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
{
  *InterruptState = GetInterruptState ();
  if (*InterruptState) {
    DisableInterrupts ();
  }
  SetMem (&Ghcb->SaveArea, sizeof (Ghcb->SaveArea), 0);
}