Lines Matching refs:regions

144 	vdev->regions = kcalloc(cnt, sizeof(struct vfio_platform_region),
146 if (!vdev->regions)
153 vdev->regions[i].addr = res->start;
154 vdev->regions[i].size = resource_size(res);
155 vdev->regions[i].flags = 0;
159 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_MMIO;
160 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_READ;
162 vdev->regions[i].flags |=
166 * Only regions addressed with PAGE granularity may be
169 if (!(vdev->regions[i].addr & ~PAGE_MASK) &&
170 !(vdev->regions[i].size & ~PAGE_MASK))
171 vdev->regions[i].flags |=
176 vdev->regions[i].type = VFIO_PLATFORM_REGION_TYPE_PIO;
187 kfree(vdev->regions);
196 iounmap(vdev->regions[i].ioaddr);
199 kfree(vdev->regions);
319 info.size = vdev->regions[info.index].size;
320 info.flags = vdev->regions[info.index].flags;
451 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ))
454 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO)
455 return vfio_platform_read_mmio(&vdev->regions[index],
457 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO)
529 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE))
532 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO)
533 return vfio_platform_write_mmio(&vdev->regions[index],
535 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO)
581 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP))
584 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ)
588 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)
594 if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_MMIO)
595 return vfio_platform_mmap_mmio(vdev->regions[index], vma);
597 else if (vdev->regions[index].type & VFIO_PLATFORM_REGION_TYPE_PIO)