/* If Irq is larger than the maximum number I/O APIC redirection entries, then ASSERT(). */
VOID EFIAPI IoApicEnableInterrupt(IN UINTN Irq, IN BOOLEAN Enable)
/* If Irq is larger than the maximum number I/O APIC redirection entries, then ASSERT(). */
VOID EFIAPI IoApicEnableInterrupt(IN UINTN Irq, IN BOOLEAN Enable)
{
  IO_APIC_VERSION_REGISTER         Version;
  IO_APIC_REDIRECTION_TABLE_ENTRY  Entry;
  Version.Uint32 = IoApicRead (IO_APIC_VERSION_REGISTER_INDEX);
  ASSERT (Version.Bits.MaximumRedirectionEntry < 0xF0);
  ASSERT (Irq <= Version.Bits.MaximumRedirectionEntry);
  Entry.Uint32.Low = IoApicRead (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2);
  Entry.Bits.Mask  = Enable ? 0 : 1;
  IoApicWrite (IO_APIC_REDIRECTION_TABLE_ENTRY_INDEX + Irq * 2, Entry.Uint32.Low);
}