Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
dma.c File Reference
#include <linux/dma-mapping.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <asm/pgalloc.h>
#include <asm/cacheflush.h>

Go to the source code of this file.

Functions

voiddma_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp)
 
void dma_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
 
 EXPORT_SYMBOL (dma_alloc_coherent)
 
 EXPORT_SYMBOL (dma_free_coherent)
 
void dma_sync_single_for_device (struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (dma_sync_single_for_device)
 
void dma_sync_sg_for_device (struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (dma_sync_sg_for_device)
 
dma_addr_t dma_map_single (struct device *dev, void *addr, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (dma_map_single)
 
dma_addr_t dma_map_page (struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (dma_map_page)
 
int dma_map_sg (struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (dma_map_sg)
 

Function Documentation

void* dma_alloc_coherent ( struct device dev,
size_t  size,
dma_addr_t handle,
gfp_t  gfp 
)

dma_alloc_coherent - allocate consistent memory for DMA : valid struct device pointer, or NULL for ISA and EISA-like devices : required memory size : bus-specific DMA address

Allocate some uncached, unbuffered memory for a device for performing DMA. This function allocates pages, and will return the CPU-viewed address, and sets to be the device-viewed address.

Definition at line 75 of file dma.c.

void dma_free_coherent ( struct device dev,
size_t  size,
void cpu_addr,
dma_addr_t  handle 
)

dma_free_coherent - free memory allocated by dma_alloc_coherent : valid struct device pointer, or NULL for ISA and EISA-like devices : size of memory originally requested in dma_alloc_coherent : CPU-view address returned from dma_alloc_coherent : device-view address returned from dma_alloc_coherent

Free (and unmap) a DMA buffer previously allocated by dma_alloc_coherent().

References to memory and mappings associated with cpu_addr/handle during and after this call executing are illegal.

Definition at line 93 of file dma.c.

dma_addr_t dma_map_page ( struct device dev,
struct page page,
unsigned long  offset,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 143 of file dma.c.

int dma_map_sg ( struct device dev,
struct scatterlist sg,
int  nents,
enum dma_data_direction  dir 
)

Definition at line 154 of file dma.c.

dma_addr_t dma_map_single ( struct device dev,
void addr,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 133 of file dma.c.

void dma_sync_sg_for_device ( struct device dev,
struct scatterlist sg,
int  nents,
enum dma_data_direction  dir 
)

Definition at line 123 of file dma.c.

void dma_sync_single_for_device ( struct device dev,
dma_addr_t  handle,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 104 of file dma.c.

EXPORT_SYMBOL ( dma_alloc_coherent  )
EXPORT_SYMBOL ( dma_free_coherent  )
EXPORT_SYMBOL ( dma_sync_single_for_device  )
EXPORT_SYMBOL ( dma_sync_sg_for_device  )
EXPORT_SYMBOL ( dma_map_single  )
EXPORT_SYMBOL ( dma_map_page  )
EXPORT_SYMBOL ( dma_map_sg  )