/* InterruptId is returned separately from the register value because in the GICv2 the register value contains the CpuId and InterruptId while in the GICv3 the register value is only the InterruptId. */
UINTN EFIAPI ArmGicAcknowledgeInterrupt(IN UINTN GicInterruptInterfaceBase, OUT UINTN *InterruptId)
/* InterruptId is returned separately from the register value because in the GICv2 the register value contains the CpuId and InterruptId while in the GICv3 the register value is only the InterruptId. */
UINTN EFIAPI ArmGicAcknowledgeInterrupt(IN UINTN GicInterruptInterfaceBase, OUT UINTN *InterruptId)
{
  UINTN                  Value;
  UINTN                  IntId;
  ARM_GIC_ARCH_REVISION  Revision;
  ASSERT (InterruptId != NULL);
  Revision = ArmGicGetSupportedArchRevision ();
  if (Revision == ARM_GIC_ARCH_REVISION_2) {
    Value = ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase);
    IntId = Value & ARM_GIC_ICCIAR_ACKINTID;
  } else if (Revision == ARM_GIC_ARCH_REVISION_3) {
    Value = ArmGicV3AcknowledgeInterrupt ();
    IntId = Value;
  } else {
    ASSERT_EFI_ERROR (EFI_UNSUPPORTED);
    Value = 1023;
  }
  if (InterruptId != NULL) {
    *InterruptId = IntId;
  }
  return Value;
}