/* Retrieve exception handler from IDT table by ExceptionNum. */
VOID* GetExceptionHandlerInIdtEntry(IN UINTN ExceptionNum)
/* Retrieve exception handler from IDT table by ExceptionNum. */
VOID* GetExceptionHandlerInIdtEntry(IN UINTN ExceptionNum)
{
  IA32_IDT_GATE_DESCRIPTOR  *IdtEntry;
  IA32_DESCRIPTOR           IdtDescriptor;
  AsmReadIdtr (&IdtDescriptor);
  IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)IdtDescriptor.Base;
  return (VOID *)(IdtEntry[ExceptionNum].Bits.OffsetLow |
                  (((UINTN)IdtEntry[ExceptionNum].Bits.OffsetHigh) << 16) |
                  (((UINTN)IdtEntry[ExceptionNum].Bits.OffsetUpper) << 32));
}