/* Based on this explanation, the 2 common APIs below, namely pcie_ep_xfer_data_memcpy and pcie_ep_xfer_data_dma are implemented with dummy PCIe read, phew!  */
static int pcie_ep_mapped_copy(uint64_t mapped_addr, uintptr_t local_addr, const uint32_t size, const enum xfer_direction dir)
/* Based on this explanation, the 2 common APIs below, namely pcie_ep_xfer_data_memcpy and pcie_ep_xfer_data_dma are implemented with dummy PCIe read, phew!  */
static int pcie_ep_mapped_copy(uint64_t mapped_addr, uintptr_t local_addr, const uint32_t size, const enum xfer_direction dir)
{
	if ((!IS_ENABLED(CONFIG_64BIT)) && (mapped_addr >> 32)) {
		return -EINVAL;
	}
	if (dir == DEVICE_TO_HOST) {
		memcpy(UINT_TO_POINTER(mapped_addr),
		       UINT_TO_POINTER(local_addr), size);
	} else {
		memcpy(UINT_TO_POINTER(local_addr),
		       UINT_TO_POINTER(mapped_addr), size);
	}
	return 0;
}