/* This function validates the TRBE Interrupt in the GICC. */
STATIC VOID EFIAPI ValidateTrbeInterrupt(IN UINT8 *Ptr, IN VOID *Context)
/* This function validates the TRBE Interrupt in the GICC. */
STATIC VOID EFIAPI ValidateTrbeInterrupt(IN UINT8 *Ptr, IN VOID *Context)
{
  UINT16  TrbeInterrupt;
  TrbeInterrupt = *(UINT16 *)Ptr;
  if (TrbeInterrupt == 0) {
    return;
  }
  if ((TrbeInterrupt < ARM_PPI_ID_MIN) ||
      ((TrbeInterrupt > ARM_PPI_ID_MAX) &&
       (TrbeInterrupt < ARM_PPI_ID_EXTENDED_MIN)) ||
      (TrbeInterrupt > ARM_PPI_ID_EXTENDED_MAX))
  {
    IncrementErrorCount ();
    Print (
      L"\nERROR: TRBE Interrupt ID of %d is not in the allowed PPI ID "
      L"ranges of %d-%d or %d-%d (for GICv3.1 or later).",
      TrbeInterrupt,
      ARM_PPI_ID_MIN,
      ARM_PPI_ID_MAX,
      ARM_PPI_ID_EXTENDED_MIN,
      ARM_PPI_ID_EXTENDED_MAX
      );
  }
}