/* A TRNG may be implemented by the system firmware, in which case this function shall return the version of the Arm TRNG backend. The implementation must return NOT_SUPPORTED if a Back end is not present. */
RETURN_STATUS EFIAPI GetArmTrngVersion(OUT UINT16 *MajorRevision, OUT UINT16 *MinorRevision)
/* A TRNG may be implemented by the system firmware, in which case this function shall return the version of the Arm TRNG backend. The implementation must return NOT_SUPPORTED if a Back end is not present. */
RETURN_STATUS EFIAPI GetArmTrngVersion(OUT UINT16 *MajorRevision, OUT UINT16 *MinorRevision)
{
  RETURN_STATUS     Status;
  ARM_MONITOR_ARGS  Parameters;
  INT32             Revision;
  if ((MajorRevision == NULL) || (MinorRevision == NULL)) {
    return RETURN_INVALID_PARAMETER;
  }
  ZeroMem (&Parameters, sizeof (Parameters));
  Parameters.Arg0 = ARM_SMC_ID_TRNG_VERSION;
  ArmMonitorCall (&Parameters);
  Revision = (INT32)Parameters.Arg0;
  Status   = TrngStatusToReturnStatus (Revision);
  if (RETURN_ERROR (Status)) {
    return Status;
  }
  *MinorRevision = (Revision & TRNG_REV_MINOR_MASK);
  *MajorRevision = ((Revision >> TRNG_REV_MAJOR_SHIFT) & TRNG_REV_MAJOR_MASK);
  return RETURN_SUCCESS;
}