uio: introduce UIO_MEM_IOVA
Introduce the concept of mapping physical memory locations that are normal memory. The new type UIO_MEM_IOVA are similar to existing UIO_MEM_PHYS but the backing memory is not marked as uncached. Also, indent related switch to the currently used style. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
ae6935ed7d
commit
bfddabfa23
@@ -738,6 +738,7 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
vma->vm_ops = &uio_physical_vm_ops;
|
vma->vm_ops = &uio_physical_vm_ops;
|
||||||
|
if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
|
||||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -795,6 +796,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (idev->info->mem[mi].memtype) {
|
switch (idev->info->mem[mi].memtype) {
|
||||||
|
case UIO_MEM_IOVA:
|
||||||
case UIO_MEM_PHYS:
|
case UIO_MEM_PHYS:
|
||||||
ret = uio_mmap_physical(vma);
|
ret = uio_mmap_physical(vma);
|
||||||
break;
|
break;
|
||||||
@@ -806,7 +808,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&idev->info_lock);
|
mutex_unlock(&idev->info_lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -133,6 +133,7 @@ extern void uio_event_notify(struct uio_info *info);
|
|||||||
#define UIO_MEM_PHYS 1
|
#define UIO_MEM_PHYS 1
|
||||||
#define UIO_MEM_LOGICAL 2
|
#define UIO_MEM_LOGICAL 2
|
||||||
#define UIO_MEM_VIRTUAL 3
|
#define UIO_MEM_VIRTUAL 3
|
||||||
|
#define UIO_MEM_IOVA 4
|
||||||
|
|
||||||
/* defines for uio_port->porttype */
|
/* defines for uio_port->porttype */
|
||||||
#define UIO_PORT_NONE 0
|
#define UIO_PORT_NONE 0
|
||||||
|
Reference in New Issue
Block a user