/* Enables a PCI driver to copy one region of PCI memory space to another region of PCI memory space. */
STATIC EFI_STATUS EFIAPI PciIoCopyMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
/* Enables a PCI driver to copy one region of PCI memory space to another region of PCI memory space. */
STATIC EFI_STATUS EFIAPI PciIoCopyMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 DestBarIndex, IN UINT64 DestOffset, IN UINT8 SrcBarIndex, IN UINT64 SrcOffset, IN UINTN Count)
{
  NON_DISCOVERABLE_PCI_DEVICE        *Dev;
  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  *DestDesc;
  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR  *SrcDesc;
  EFI_STATUS                         Status;
  if ((UINT32)Width > EfiPciIoWidthUint64) {
    return EFI_INVALID_PARAMETER;
  }
  Dev = NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO (This);
  Status = GetBarResource (Dev, DestBarIndex, &DestDesc);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (DestOffset + (Count << (Width & 0x3)) > DestDesc->AddrLen) {
    return EFI_UNSUPPORTED;
  }
  Status = GetBarResource (Dev, SrcBarIndex, &SrcDesc);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (SrcOffset + (Count << (Width & 0x3)) > SrcDesc->AddrLen) {
    return EFI_UNSUPPORTED;
  }
  ASSERT (FALSE);
  return EFI_UNSUPPORTED;
}