/* Save IDT entry for INT1 and update it. */
VOID SaveAndUpdateIdtEntry1(IN IA32_DESCRIPTOR *IdtDescriptor, OUT IA32_IDT_GATE_DESCRIPTOR *SavedIdtEntry)
/* Save IDT entry for INT1 and update it. */
VOID SaveAndUpdateIdtEntry1(IN IA32_DESCRIPTOR *IdtDescriptor, OUT IA32_IDT_GATE_DESCRIPTOR *SavedIdtEntry)
{
  IA32_IDT_GATE_DESCRIPTOR  *IdtEntry;
  UINT16                    CodeSegment;
  UINTN                     InterruptHandler;
  IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor->Base;
  CopyMem (SavedIdtEntry, &IdtEntry[1], sizeof (IA32_IDT_GATE_DESCRIPTOR));
  CodeSegment = AsmReadCs ();
  InterruptHandler             = (UINTN)&AsmInterruptHandle;
  IdtEntry[1].Bits.OffsetLow   = (UINT16)(UINTN)InterruptHandler;
  IdtEntry[1].Bits.OffsetHigh  = (UINT16)((UINTN)InterruptHandler >> 16);
  IdtEntry[1].Bits.OffsetUpper = (UINT32)((UINTN)InterruptHandler >> 32);
  IdtEntry[1].Bits.Selector    = CodeSegment;
  IdtEntry[1].Bits.GateType    = IA32_IDT_GATE_TYPE_INTERRUPT_32;
}