/* Get the Gic version of am interrupt-controller node. */
EFI_STATUS EFIAPI GetGicVersion(IN CONST VOID *Fdt, IN INT32 IntcNode, OUT UINT32 *GicVersion)
/* Get the Gic version of am interrupt-controller node. */
EFI_STATUS EFIAPI GetGicVersion(IN CONST VOID *Fdt, IN INT32 IntcNode, OUT UINT32 *GicVersion)
{
  if ((Fdt == NULL) ||
      (GicVersion == NULL))
  {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  if (FdtNodeIsCompatible (Fdt, IntcNode, &GicV2CompatibleInfo)) {
    *GicVersion = 2;
  } else if (FdtNodeIsCompatible (Fdt, IntcNode, &GicV3CompatibleInfo)) {
    *GicVersion = 3;
  } else {
    ASSERT (0);
    return EFI_UNSUPPORTED;
  }
  return EFI_SUCCESS;
}