Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
dma-debug.c File Reference
#include <linux/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/stacktrace.h>
#include <linux/dma-debug.h>
#include <linux/spinlock.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/export.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/ctype.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <asm/sections.h>

Go to the source code of this file.

Data Structures

struct  dma_debug_entry
 
struct  hash_bucket
 

Macros

#define HASH_SIZE   1024ULL
 
#define HASH_FN_SHIFT   13
 
#define HASH_FN_MASK   (HASH_SIZE - 1)
 
#define DMA_DEBUG_STACKTRACE_ENTRIES   5
 
#define NAME_MAX_LEN   64
 
#define err_printk(dev, entry, format, arg...)
 

Typedefs

typedef bool(* match_fn )(struct dma_debug_entry *, struct dma_debug_entry *)
 

Enumerations

enum  { dma_debug_single, dma_debug_page, dma_debug_sg, dma_debug_coherent }
 

Functions

void debug_dma_dump_mappings (struct device *dev)
 
 EXPORT_SYMBOL (debug_dma_dump_mappings)
 
int dma_debug_resize_entries (u32 num_entries)
 
 EXPORT_SYMBOL (dma_debug_resize_entries)
 
void dma_debug_add_bus (struct bus_type *bus)
 
void dma_debug_init (u32 num_entries)
 
 __setup ("dma_debug=", dma_debug_cmdline)
 
void debug_dma_map_page (struct device *dev, struct page *page, size_t offset, size_t size, int direction, dma_addr_t dma_addr, bool map_single)
 
 EXPORT_SYMBOL (debug_dma_map_page)
 
void debug_dma_unmap_page (struct device *dev, dma_addr_t addr, size_t size, int direction, bool map_single)
 
 EXPORT_SYMBOL (debug_dma_unmap_page)
 
void debug_dma_map_sg (struct device *dev, struct scatterlist *sg, int nents, int mapped_ents, int direction)
 
 EXPORT_SYMBOL (debug_dma_map_sg)
 
void debug_dma_unmap_sg (struct device *dev, struct scatterlist *sglist, int nelems, int dir)
 
 EXPORT_SYMBOL (debug_dma_unmap_sg)
 
void debug_dma_alloc_coherent (struct device *dev, size_t size, dma_addr_t dma_addr, void *virt)
 
 EXPORT_SYMBOL (debug_dma_alloc_coherent)
 
void debug_dma_free_coherent (struct device *dev, size_t size, void *virt, dma_addr_t addr)
 
 EXPORT_SYMBOL (debug_dma_free_coherent)
 
void debug_dma_sync_single_for_cpu (struct device *dev, dma_addr_t dma_handle, size_t size, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_single_for_cpu)
 
void debug_dma_sync_single_for_device (struct device *dev, dma_addr_t dma_handle, size_t size, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_single_for_device)
 
void debug_dma_sync_single_range_for_cpu (struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_single_range_for_cpu)
 
void debug_dma_sync_single_range_for_device (struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_single_range_for_device)
 
void debug_dma_sync_sg_for_cpu (struct device *dev, struct scatterlist *sg, int nelems, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_sg_for_cpu)
 
void debug_dma_sync_sg_for_device (struct device *dev, struct scatterlist *sg, int nelems, int direction)
 
 EXPORT_SYMBOL (debug_dma_sync_sg_for_device)
 

Variables

struct hash_bucket ____cacheline_aligned_in_smp
 

Macro Definition Documentation

#define DMA_DEBUG_STACKTRACE_ENTRIES   5

Definition at line 48 of file dma-debug.c.

#define err_printk (   dev,
  entry,
  format,
  arg... 
)
Value:
do { \
error_count += 1; \
if (driver_filter(dev) && \
(show_all_errors || show_num_errors > 0)) { \
WARN(1, "%s %s: " format, \
dev ? dev_driver_string(dev) : "NULL", \
dev ? dev_name(dev) : "NULL", ## arg); \
dump_entry_trace(entry); \
} \
if (!show_all_errors && show_num_errors > 0) \
show_num_errors -= 1; \
} while (0);

Definition at line 187 of file dma-debug.c.

#define HASH_FN_MASK   (HASH_SIZE - 1)

Definition at line 39 of file dma-debug.c.

#define HASH_FN_SHIFT   13

Definition at line 38 of file dma-debug.c.

#define HASH_SIZE   1024ULL

Definition at line 37 of file dma-debug.c.

#define NAME_MAX_LEN   64

Definition at line 110 of file dma-debug.c.

Typedef Documentation

typedef bool(* match_fn)(struct dma_debug_entry *, struct dma_debug_entry *)

Definition at line 66 of file dma-debug.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
dma_debug_single 
dma_debug_page 
dma_debug_sg 
dma_debug_coherent 

Definition at line 41 of file dma-debug.c.

Function Documentation

__setup ( )
void debug_dma_alloc_coherent ( struct device dev,
size_t  size,
dma_addr_t  dma_addr,
void virt 
)

Definition at line 1154 of file dma-debug.c.

void debug_dma_dump_mappings ( struct device dev)

Definition at line 365 of file dma-debug.c.

void debug_dma_free_coherent ( struct device dev,
size_t  size,
void virt,
dma_addr_t  addr 
)

Definition at line 1180 of file dma-debug.c.

void debug_dma_map_page ( struct device dev,
struct page page,
size_t  offset,
size_t  size,
int  direction,
dma_addr_t  dma_addr,
bool  map_single 
)

Definition at line 1011 of file dma-debug.c.

void debug_dma_map_sg ( struct device dev,
struct scatterlist sg,
int  nents,
int  mapped_ents,
int  direction 
)

Definition at line 1069 of file dma-debug.c.

void debug_dma_sync_sg_for_cpu ( struct device dev,
struct scatterlist sg,
int  nelems,
int  direction 
)

Definition at line 1280 of file dma-debug.c.

void debug_dma_sync_sg_for_device ( struct device dev,
struct scatterlist sg,
int  nelems,
int  direction 
)

Definition at line 1312 of file dma-debug.c.

void debug_dma_sync_single_for_cpu ( struct device dev,
dma_addr_t  dma_handle,
size_t  size,
int  direction 
)

Definition at line 1199 of file dma-debug.c.

void debug_dma_sync_single_for_device ( struct device dev,
dma_addr_t  dma_handle,
size_t  size,
int  direction 
)

Definition at line 1218 of file dma-debug.c.

void debug_dma_sync_single_range_for_cpu ( struct device dev,
dma_addr_t  dma_handle,
unsigned long  offset,
size_t  size,
int  direction 
)

Definition at line 1238 of file dma-debug.c.

void debug_dma_sync_single_range_for_device ( struct device dev,
dma_addr_t  dma_handle,
unsigned long  offset,
size_t  size,
int  direction 
)

Definition at line 1259 of file dma-debug.c.

void debug_dma_unmap_page ( struct device dev,
dma_addr_t  addr,
size_t  size,
int  direction,
bool  map_single 
)

Definition at line 1048 of file dma-debug.c.

void debug_dma_unmap_sg ( struct device dev,
struct scatterlist sglist,
int  nelems,
int  dir 
)

Definition at line 1122 of file dma-debug.c.

void dma_debug_add_bus ( struct bus_type bus)

Definition at line 755 of file dma-debug.c.

void dma_debug_init ( u32  num_entries)

Definition at line 776 of file dma-debug.c.

int dma_debug_resize_entries ( u32  num_entries)

Definition at line 468 of file dma-debug.c.

EXPORT_SYMBOL ( debug_dma_dump_mappings  )
EXPORT_SYMBOL ( dma_debug_resize_entries  )
EXPORT_SYMBOL ( debug_dma_map_page  )
EXPORT_SYMBOL ( debug_dma_unmap_page  )
EXPORT_SYMBOL ( debug_dma_map_sg  )
EXPORT_SYMBOL ( debug_dma_unmap_sg  )
EXPORT_SYMBOL ( debug_dma_alloc_coherent  )
EXPORT_SYMBOL ( debug_dma_free_coherent  )
EXPORT_SYMBOL ( debug_dma_sync_single_for_cpu  )
EXPORT_SYMBOL ( debug_dma_sync_single_for_device  )
EXPORT_SYMBOL ( debug_dma_sync_sg_for_cpu  )
EXPORT_SYMBOL ( debug_dma_sync_sg_for_device  )

Variable Documentation

struct hash_bucket ____cacheline_aligned_in_smp