Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
swiotlb.c File Reference
#include <linux/cache.h>
#include <linux/dma-mapping.h>
#include <linux/mm.h>
#include <linux/export.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/swiotlb.h>
#include <linux/pfn.h>
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/highmem.h>
#include <linux/gfp.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/scatterlist.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/iommu-helper.h>

Go to the source code of this file.

Macros

#define OFFSET(val, align)
 
#define SLABS_PER_PAGE   (1 << (PAGE_SHIFT - IO_TLB_SHIFT))
 
#define IO_TLB_MIN_SLABS   ((1<<20) >> IO_TLB_SHIFT)
 

Functions

 __setup ("swiotlb=", setup_io_tlb_npages)
 
unsigned long swiotlb_nr_tbl (void)
 
 EXPORT_SYMBOL_GPL (swiotlb_nr_tbl)
 
void swiotlb_print_info (void)
 
void __init swiotlb_init_with_tbl (char *tlb, unsigned long nslabs, int verbose)
 
void __init swiotlb_init (int verbose)
 
int swiotlb_late_init_with_default_size (size_t default_size)
 
int swiotlb_late_init_with_tbl (char *tlb, unsigned long nslabs)
 
void __init swiotlb_free (void)
 
void swiotlb_bounce (phys_addr_t phys, char *dma_addr, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL_GPL (swiotlb_bounce)
 
voidswiotlb_tbl_map_single (struct device *hwdev, dma_addr_t tbl_dma_addr, phys_addr_t phys, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL_GPL (swiotlb_tbl_map_single)
 
void swiotlb_tbl_unmap_single (struct device *hwdev, char *dma_addr, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL_GPL (swiotlb_tbl_unmap_single)
 
void swiotlb_tbl_sync_single (struct device *hwdev, char *dma_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target)
 
 EXPORT_SYMBOL_GPL (swiotlb_tbl_sync_single)
 
voidswiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t flags)
 
 EXPORT_SYMBOL (swiotlb_alloc_coherent)
 
void swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dev_addr)
 
 EXPORT_SYMBOL (swiotlb_free_coherent)
 
dma_addr_t swiotlb_map_page (struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs)
 
 EXPORT_SYMBOL_GPL (swiotlb_map_page)
 
void swiotlb_unmap_page (struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs)
 
 EXPORT_SYMBOL_GPL (swiotlb_unmap_page)
 
void swiotlb_sync_single_for_cpu (struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_sync_single_for_cpu)
 
void swiotlb_sync_single_for_device (struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_sync_single_for_device)
 
int swiotlb_map_sg_attrs (struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs)
 
 EXPORT_SYMBOL (swiotlb_map_sg_attrs)
 
int swiotlb_map_sg (struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_map_sg)
 
void swiotlb_unmap_sg_attrs (struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs)
 
 EXPORT_SYMBOL (swiotlb_unmap_sg_attrs)
 
void swiotlb_unmap_sg (struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_unmap_sg)
 
void swiotlb_sync_sg_for_cpu (struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_sync_sg_for_cpu)
 
void swiotlb_sync_sg_for_device (struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir)
 
 EXPORT_SYMBOL (swiotlb_sync_sg_for_device)
 
int swiotlb_dma_mapping_error (struct device *hwdev, dma_addr_t dma_addr)
 
 EXPORT_SYMBOL (swiotlb_dma_mapping_error)
 
int swiotlb_dma_supported (struct device *hwdev, u64 mask)
 
 EXPORT_SYMBOL (swiotlb_dma_supported)
 

Variables

int swiotlb_force
 

Macro Definition Documentation

#define IO_TLB_MIN_SLABS   ((1<<20) >> IO_TLB_SHIFT)

Definition at line 51 of file swiotlb.c.

#define OFFSET (   val,
  align 
)
Value:
((unsigned long) \
( (val) & ( (align) - 1)))

Definition at line 41 of file swiotlb.c.

#define SLABS_PER_PAGE   (1 << (PAGE_SHIFT - IO_TLB_SHIFT))

Definition at line 44 of file swiotlb.c.

Function Documentation

__setup ( )
EXPORT_SYMBOL ( swiotlb_alloc_coherent  )
EXPORT_SYMBOL ( swiotlb_free_coherent  )
EXPORT_SYMBOL ( swiotlb_sync_single_for_cpu  )
EXPORT_SYMBOL ( swiotlb_sync_single_for_device  )
EXPORT_SYMBOL ( swiotlb_map_sg_attrs  )
EXPORT_SYMBOL ( swiotlb_map_sg  )
EXPORT_SYMBOL ( swiotlb_unmap_sg_attrs  )
EXPORT_SYMBOL ( swiotlb_unmap_sg  )
EXPORT_SYMBOL ( swiotlb_sync_sg_for_cpu  )
EXPORT_SYMBOL ( swiotlb_sync_sg_for_device  )
EXPORT_SYMBOL ( swiotlb_dma_mapping_error  )
EXPORT_SYMBOL ( swiotlb_dma_supported  )
EXPORT_SYMBOL_GPL ( swiotlb_nr_tbl  )
EXPORT_SYMBOL_GPL ( swiotlb_bounce  )
EXPORT_SYMBOL_GPL ( swiotlb_tbl_map_single  )
EXPORT_SYMBOL_GPL ( swiotlb_tbl_unmap_single  )
EXPORT_SYMBOL_GPL ( swiotlb_tbl_sync_single  )
EXPORT_SYMBOL_GPL ( swiotlb_map_page  )
EXPORT_SYMBOL_GPL ( swiotlb_unmap_page  )
void* swiotlb_alloc_coherent ( struct device hwdev,
size_t  size,
dma_addr_t dma_handle,
gfp_t  flags 
)

Definition at line 580 of file swiotlb.c.

void swiotlb_bounce ( phys_addr_t  phys,
char dma_addr,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 349 of file swiotlb.c.

int swiotlb_dma_mapping_error ( struct device hwdev,
dma_addr_t  dma_addr 
)

Definition at line 926 of file swiotlb.c.

int swiotlb_dma_supported ( struct device hwdev,
u64  mask 
)

Definition at line 939 of file swiotlb.c.

void __init swiotlb_free ( void  )

Definition at line 313 of file swiotlb.c.

void swiotlb_free_coherent ( struct device hwdev,
size_t  size,
void vaddr,
dma_addr_t  dev_addr 
)

Definition at line 629 of file swiotlb.c.

void __init swiotlb_init ( int  verbose)

Definition at line 196 of file swiotlb.c.

void __init swiotlb_init_with_tbl ( char tlb,
unsigned long  nslabs,
int  verbose 
)

Definition at line 138 of file swiotlb.c.

int swiotlb_late_init_with_default_size ( size_t  default_size)

Definition at line 207 of file swiotlb.c.

int swiotlb_late_init_with_tbl ( char tlb,
unsigned long  nslabs 
)

Definition at line 249 of file swiotlb.c.

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

Definition at line 675 of file swiotlb.c.

int swiotlb_map_sg ( struct device hwdev,
struct scatterlist sgl,
int  nelems,
enum dma_data_direction  dir 
)

Definition at line 855 of file swiotlb.c.

int swiotlb_map_sg_attrs ( struct device hwdev,
struct scatterlist sgl,
int  nelems,
enum dma_data_direction  dir,
struct dma_attrs attrs 
)

Definition at line 820 of file swiotlb.c.

unsigned long swiotlb_nr_tbl ( void  )

Definition at line 113 of file swiotlb.c.

void swiotlb_print_info ( void  )

Definition at line 125 of file swiotlb.c.

void swiotlb_sync_sg_for_cpu ( struct device hwdev,
struct scatterlist sg,
int  nelems,
enum dma_data_direction  dir 
)

Definition at line 910 of file swiotlb.c.

void swiotlb_sync_sg_for_device ( struct device hwdev,
struct scatterlist sg,
int  nelems,
enum dma_data_direction  dir 
)

Definition at line 918 of file swiotlb.c.

void swiotlb_sync_single_for_cpu ( struct device hwdev,
dma_addr_t  dev_addr,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 788 of file swiotlb.c.

void swiotlb_sync_single_for_device ( struct device hwdev,
dma_addr_t  dev_addr,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 796 of file swiotlb.c.

void* swiotlb_tbl_map_single ( struct device hwdev,
dma_addr_t  tbl_dma_addr,
phys_addr_t  phys,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 387 of file swiotlb.c.

void swiotlb_tbl_sync_single ( struct device hwdev,
char dma_addr,
size_t  size,
enum dma_data_direction  dir,
enum dma_sync_target  target 
)

Definition at line 551 of file swiotlb.c.

void swiotlb_tbl_unmap_single ( struct device hwdev,
char dma_addr,
size_t  size,
enum dma_data_direction  dir 
)

Definition at line 509 of file swiotlb.c.

void swiotlb_unmap_page ( struct device hwdev,
dma_addr_t  dev_addr,
size_t  size,
enum dma_data_direction  dir,
struct dma_attrs attrs 
)

Definition at line 748 of file swiotlb.c.

void swiotlb_unmap_sg ( struct device hwdev,
struct scatterlist sgl,
int  nelems,
enum dma_data_direction  dir 
)

Definition at line 882 of file swiotlb.c.

void swiotlb_unmap_sg_attrs ( struct device hwdev,
struct scatterlist sgl,
int  nelems,
enum dma_data_direction  dir,
struct dma_attrs attrs 
)

Definition at line 867 of file swiotlb.c.

Variable Documentation

int swiotlb_force

Definition at line 53 of file swiotlb.c.