Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures
dmapool.c File Reference
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/export.h>
#include <linux/mutex.h>
#include <linux/poison.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/wait.h>

Go to the source code of this file.

Data Structures

struct  dma_pool
 
struct  dma_page
 

Functions

: name of pool, for diagnostics

dmam_pool_create - Managed dma_pool_create()

: device that will be doing the DMA : size of the blocks in this pool. : alignment requirement for blocks; must be a power of two : returned blocks won't cross this boundary (or zero)

Managed dma_pool_create(). DMA pool created with this function is automatically destroyed on driver detach.

struct dma_pooldma_pool_create (const char *name, struct device *dev, size_t size, size_t align, size_t boundary)
 
 EXPORT_SYMBOL (dma_pool_create)
 
void dma_pool_destroy (struct dma_pool *pool)
 
 EXPORT_SYMBOL (dma_pool_destroy)
 
voiddma_pool_alloc (struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle)
 
 EXPORT_SYMBOL (dma_pool_alloc)
 
void dma_pool_free (struct dma_pool *pool, void *vaddr, dma_addr_t dma)
 
 EXPORT_SYMBOL (dma_pool_free)
 
struct dma_pooldmam_pool_create (const char *name, struct device *dev, size_t size, size_t align, size_t allocation)
 
 EXPORT_SYMBOL (dmam_pool_create)
 
void dmam_pool_destroy (struct dma_pool *pool)
 
 EXPORT_SYMBOL (dmam_pool_destroy)
 

Function Documentation

void* dma_pool_alloc ( struct dma_pool pool,
gfp_t  mem_flags,
dma_addr_t handle 
)

dma_pool_alloc - get a block of consistent memory : dma pool that will produce the block : GFP_* bitmask : pointer to dma address of block

This returns the kernel virtual address of a currently unused block, and reports its dma address through the handle. If such a memory block can't be allocated, NULL is returned.

Definition at line 302 of file dmapool.c.

struct dma_pool* dma_pool_create ( const char name,
struct device dev,
size_t  size,
size_t  align,
size_t  boundary 
)
read

Definition at line 130 of file dmapool.c.

void dma_pool_destroy ( struct dma_pool pool)

dma_pool_destroy - destroys a pool of dma memory blocks. : dma pool that will be destroyed Context: !in_interrupt()

Caller guarantees that no more memory from the pool is in use, and that nothing will try to use the pool after this call.

Definition at line 260 of file dmapool.c.

void dma_pool_free ( struct dma_pool pool,
void vaddr,
dma_addr_t  dma 
)

dma_pool_free - put block back into dma pool : the dma pool holding the block : virtual address of block : dma address of block

Caller promises neither device nor driver will again touch this block unless it is first re-allocated.

Definition at line 364 of file dmapool.c.

struct dma_pool* dmam_pool_create ( const char name,
struct device dev,
size_t  size,
size_t  align,
size_t  allocation 
)
read

Definition at line 458 of file dmapool.c.

void dmam_pool_destroy ( struct dma_pool pool)

dmam_pool_destroy - Managed dma_pool_destroy() : dma pool that will be destroyed

Managed dma_pool_destroy().

Definition at line 483 of file dmapool.c.

EXPORT_SYMBOL ( dma_pool_create  )
EXPORT_SYMBOL ( dma_pool_destroy  )
EXPORT_SYMBOL ( dma_pool_alloc  )
EXPORT_SYMBOL ( dma_pool_free  )
EXPORT_SYMBOL ( dmam_pool_create  )
EXPORT_SYMBOL ( dmam_pool_destroy  )