Lines Matching refs:regions

151 	vdev->regions = kcalloc(cnt, sizeof(struct vfio_platform_region),  in vfio_platform_regions_init()
153 if (!vdev->regions) in vfio_platform_regions_init()
163 vdev->regions[i].addr = res->start; in vfio_platform_regions_init()
164 vdev->regions[i].size = resource_size(res); in vfio_platform_regions_init()
165 vdev->regions[i].flags = 0; in vfio_platform_regions_init()
169 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_MMIO; in vfio_platform_regions_init()
170 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_READ; in vfio_platform_regions_init()
172 vdev->regions[i].flags |= in vfio_platform_regions_init()
179 if (!(vdev->regions[i].addr & ~PAGE_MASK) && in vfio_platform_regions_init()
180 !(vdev->regions[i].size & ~PAGE_MASK)) in vfio_platform_regions_init()
181 vdev->regions[i].flags |= in vfio_platform_regions_init()
186 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_PIO; in vfio_platform_regions_init()
197 kfree(vdev->regions); in vfio_platform_regions_init()
206 iounmap(vdev->regions[i].ioaddr); in vfio_platform_regions_cleanup()
209 kfree(vdev->regions); in vfio_platform_regions_cleanup()
345 info.size = vdev->regions[info.index].size; in vfio_platform_ioctl()
346 info.flags = vdev->regions[info.index].flags; in vfio_platform_ioctl()
475 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ)) in vfio_platform_read()
478 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_read()
479 return vfio_platform_read_mmio(&vdev->regions[index], in vfio_platform_read()
481 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_read()
551 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) in vfio_platform_write()
554 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_write()
555 return vfio_platform_write_mmio(&vdev->regions[index], in vfio_platform_write()
557 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_write()
601 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP)) in vfio_platform_mmap()
604 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) in vfio_platform_mmap()
608 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) in vfio_platform_mmap()
614 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO) in vfio_platform_mmap()
615 return vfio_platform_mmap_mmio(vdev->regions[index], vma); in vfio_platform_mmap()
617 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO) in vfio_platform_mmap()