Lines Matching refs:regions

30 	vdev->regions = kcalloc(count, sizeof(struct vfio_fsl_mc_region),  in vfio_fsl_mc_open_device()
32 if (!vdev->regions) in vfio_fsl_mc_open_device()
36 struct resource *res = &mc_dev->regions[i]; in vfio_fsl_mc_open_device()
39 vdev->regions[i].addr = res->start; in vfio_fsl_mc_open_device()
40 vdev->regions[i].size = resource_size(res); in vfio_fsl_mc_open_device()
41 vdev->regions[i].type = mc_dev->regions[i].flags & IORESOURCE_BITS; in vfio_fsl_mc_open_device()
46 if (!no_mmap && !(vdev->regions[i].addr & ~PAGE_MASK) && in vfio_fsl_mc_open_device()
47 !(vdev->regions[i].size & ~PAGE_MASK)) in vfio_fsl_mc_open_device()
48 vdev->regions[i].flags |= in vfio_fsl_mc_open_device()
50 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_READ; in vfio_fsl_mc_open_device()
51 if (!(mc_dev->regions[i].flags & IORESOURCE_READONLY)) in vfio_fsl_mc_open_device()
52 vdev->regions[i].flags |= VFIO_REGION_INFO_FLAG_WRITE; in vfio_fsl_mc_open_device()
64 iounmap(vdev->regions[i].ioaddr); in vfio_fsl_mc_regions_cleanup()
65 kfree(vdev->regions); in vfio_fsl_mc_regions_cleanup()
169 info.size = vdev->regions[info.index].size; in vfio_fsl_mc_ioctl()
170 info.flags = vdev->regions[info.index].flags; in vfio_fsl_mc_ioctl()
255 region = &vdev->regions[index]; in vfio_fsl_mc_read()
334 region = &vdev->regions[index]; in vfio_fsl_mc_write()
405 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_MMAP)) in vfio_fsl_mc_mmap()
408 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_READ) in vfio_fsl_mc_mmap()
412 if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) in vfio_fsl_mc_mmap()
418 return vfio_fsl_mc_mmap_mmio(vdev->regions[index], vma); in vfio_fsl_mc_mmap()