Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
dma-mapping.h File Reference
#include <linux/mm.h>
#include <linux/device.h>
#include <linux/scatterlist.h>
#include <asm/processor.h>
#include <asm/cacheflush.h>
#include <asm/io.h>

Go to the source code of this file.

Macros

#define dma_alloc_noncoherent(d, s, h, f)   dma_alloc_coherent(d, s, h, f)
 
#define dma_free_noncoherent(d, s, v, h)   dma_free_coherent(d, s, v, h)
 

Functions

void dma_cache_sync (struct device *dev, void *vaddr, size_t size, int direction)
 
voiddma_alloc_coherent (struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
 
void dma_free_coherent (struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
 
voiddma_alloc_writecombine (struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
 
void dma_free_writecombine (struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
 

Macro Definition Documentation

#define dma_alloc_noncoherent (   d,
  s,
  h,
  f 
)    dma_alloc_coherent(d, s, h, f)

Definition at line 336 of file dma-mapping.h.

#define dma_free_noncoherent (   d,
  s,
  v,
  h 
)    dma_free_coherent(d, s, v, h)

Definition at line 337 of file dma-mapping.h.

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 96 of file dma-coherent.c.

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

dma_alloc_writecombine - allocate write-combining 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, buffered 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 124 of file dma-coherent.c.

void dma_cache_sync ( struct device dev,
void vaddr,
size_t  size,
int  direction 
)

Definition at line 16 of file dma-coherent.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 110 of file dma-coherent.c.

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

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

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

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

Definition at line 142 of file dma-coherent.c.