/* Completes the Map() operation and releases any corresponding resources. */
STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
/* Completes the Map() operation and releases any corresponding resources. */
STATIC EFI_STATUS EFIAPI CoherentPciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping)
{
  NON_DISCOVERABLE_PCI_DEVICE_MAP_INFO  *MapInfo;
  MapInfo = Mapping;
  if (MapInfo != NULL) {
    if (MapInfo->Operation == EfiPciIoOperationBusMasterWrite) {
      gBS->CopyMem (
             MapInfo->HostAddress,
             (VOID *)(UINTN)MapInfo->AllocAddress,
             MapInfo->NumberOfBytes
             );
    }
    gBS->FreePages (
           MapInfo->AllocAddress,
           EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes)
           );
    FreePool (MapInfo);
  }
  return EFI_SUCCESS;
}