Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
videobuf2-memops.h File Reference
#include <media/videobuf2-core.h>

Go to the source code of this file.

Data Structures

struct  vb2_vmarea_handler
 

Functions

int vb2_get_contig_userptr (unsigned long vaddr, unsigned long size, struct vm_area_struct **res_vma, dma_addr_t *res_pa)
 
int vb2_mmap_pfn_range (struct vm_area_struct *vma, unsigned long paddr, unsigned long size, const struct vm_operations_struct *vm_ops, void *priv)
 
struct vm_area_structvb2_get_vma (struct vm_area_struct *vma)
 
void vb2_put_vma (struct vm_area_struct *vma)
 

Variables

struct vm_operations_struct vb2_common_vm_ops
 

Function Documentation

int vb2_get_contig_userptr ( unsigned long  vaddr,
unsigned long  size,
struct vm_area_struct **  res_vma,
dma_addr_t res_pa 
)

vb2_get_contig_userptr() - lock physically contiguous userspace mapped memory : starting virtual address of the area to be verified : size of the area : will return physical address for the given vaddr : will return locked copy of struct vm_area for the given area

This function will go through memory area of size mapped at and verify that the underlying physical pages are contiguous. If they are contiguous the virtual memory area is locked and a is filled with the copy and set to the physical address of the buffer.

Returns 0 on success.

Definition at line 96 of file videobuf2-memops.c.

struct vm_area_struct* vb2_get_vma ( struct vm_area_struct vma)
read

vb2_get_vma() - acquire and lock the virtual memory area : given virtual memory area

This function attempts to acquire an area mapped in the userspace for the duration of a hardware operation. The area is "locked" by performing the same set of operation that are done when process calls fork() and memory areas are duplicated.

Returns a copy of a virtual memory region on success or NULL.

Definition at line 36 of file videobuf2-memops.c.

int vb2_mmap_pfn_range ( struct vm_area_struct vma,
unsigned long  paddr,
unsigned long  size,
const struct vm_operations_struct *  vm_ops,
void priv 
)

vb2_mmap_pfn_range() - map physical pages to userspace : virtual memory region for the mapping : starting physical address of the memory to be mapped : size of the memory to be mapped : vm operations to be assigned to the created area : private data to be associated with the area

Returns 0 on success.

Definition at line 149 of file videobuf2-memops.c.

void vb2_put_vma ( struct vm_area_struct vma)

vb2_put_userptr() - release a userspace virtual memory area : virtual memory region associated with the area to be released

This function releases the previously acquired memory area after a hardware operation.

Definition at line 67 of file videobuf2-memops.c.

Variable Documentation

struct vm_operations_struct vb2_common_vm_ops

vb2_common_vm_ops - common vm_ops used for tracking refcount of mmaped video buffers

Definition at line 219 of file videobuf2-memops.c.