/* Fill a PCI ROOT BRIDGE APERTURE with the proper values calculated from the provided start and size. */
STATIC EFI_STATUS FillHostBridgeAperture(IN UINT64 Start, IN UINT64 Size, IN UINT64 MaxValue, OUT PCI_ROOT_BRIDGE_APERTURE *Aperture)
/* Fill a PCI ROOT BRIDGE APERTURE with the proper values calculated from the provided start and size. */
STATIC EFI_STATUS FillHostBridgeAperture(IN UINT64 Start, IN UINT64 Size, IN UINT64 MaxValue, OUT PCI_ROOT_BRIDGE_APERTURE *Aperture)
{
  UINT64  End;
  End = GetRangeEnd (Start, Size, MaxValue);
  if (Aperture == NULL) {
    if (!IS_RANGE_INVALID (Start, Size, MaxValue)) {
      return EFI_INVALID_PARAMETER;
    }
    return EFI_WARN_BUFFER_TOO_SMALL;
  }
  if (IS_RANGE_INVALID (Start, Size, MaxValue)) {
    InvalidateRootBridgeAperture (Aperture);
  } else {
    Aperture->Base  = Start;
    Aperture->Limit = End;
  }
  return EFI_SUCCESS;
}