/* Wrapper for a thunk to transition from long mode to compatibility mode to execute 32-bit code and then transit back to long mode. */
EFI_STATUS Execute32BitCode(IN UINT64 Function, IN UINT64 Param1, IN UINT64 Param2)
/* Wrapper for a thunk to transition from long mode to compatibility mode to execute 32-bit code and then transit back to long mode. */
EFI_STATUS Execute32BitCode(IN UINT64 Function, IN UINT64 Param1, IN UINT64 Param2)
{
  EFI_STATUS       Status;
  IA32_DESCRIPTOR  Idtr;
  AsmReadIdtr (&Idtr);
  Status = AsmExecute32BitCode (Function, Param1, Param2, &mGdt);
  Status = (Status & ~(BIT31 + BIT30)) | LShiftU64 (Status & (BIT31 + BIT30), 32);
  AsmWriteIdtr (&Idtr);
  return Status;
}