Lines Matching refs:vma
98 static vm_fault_t map_afu_irq(struct vm_area_struct *vma, unsigned long address, in map_afu_irq() argument
108 return vmf_insert_pfn(vma, address, trigger_addr >> PAGE_SHIFT); in map_afu_irq()
111 static vm_fault_t map_pp_mmio(struct vm_area_struct *vma, unsigned long address, in map_pp_mmio() argument
134 ret = vmf_insert_pfn(vma, address, pp_mmio_addr >> PAGE_SHIFT); in map_pp_mmio()
141 struct vm_area_struct *vma = vmf->vma; in ocxl_mmap_fault() local
142 struct ocxl_context *ctx = vma->vm_file->private_data; in ocxl_mmap_fault()
151 ret = map_pp_mmio(vma, vmf->address, offset, ctx); in ocxl_mmap_fault()
153 ret = map_afu_irq(vma, vmf->address, offset, ctx); in ocxl_mmap_fault()
162 struct vm_area_struct *vma) in check_mmap_afu_irq() argument
164 int irq_id = ocxl_irq_offset_to_id(ctx, vma->vm_pgoff << PAGE_SHIFT); in check_mmap_afu_irq()
167 if (vma_pages(vma) != 1) in check_mmap_afu_irq()
180 if ((vma->vm_flags & VM_READ) || (vma->vm_flags & VM_EXEC) || in check_mmap_afu_irq()
181 !(vma->vm_flags & VM_WRITE)) in check_mmap_afu_irq()
183 vm_flags_clear(vma, VM_MAYREAD | VM_MAYEXEC); in check_mmap_afu_irq()
188 struct vm_area_struct *vma) in check_mmap_mmio() argument
190 if ((vma_pages(vma) + vma->vm_pgoff) > in check_mmap_mmio()
196 int ocxl_context_mmap(struct ocxl_context *ctx, struct vm_area_struct *vma) in ocxl_context_mmap() argument
200 if ((vma->vm_pgoff << PAGE_SHIFT) < ctx->afu->irq_base_offset) in ocxl_context_mmap()
201 rc = check_mmap_mmio(ctx, vma); in ocxl_context_mmap()
203 rc = check_mmap_afu_irq(ctx, vma); in ocxl_context_mmap()
207 vm_flags_set(vma, VM_IO | VM_PFNMAP); in ocxl_context_mmap()
208 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); in ocxl_context_mmap()
209 vma->vm_ops = &ocxl_vmops; in ocxl_context_mmap()