From 5edc68ead7f36c18ae1b884156b1d640fca778fc Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Fri, 9 Jan 2009 12:19:52 +0100 Subject: [PATCH] --- yaml --- r: 138915 b: refs/heads/master c: f2f45e5f3c921c73c913e9a9c00f21ec01c86b4d h: refs/heads/master i: 138913: 0b8cea8ef7611c42aaf990c9ccf1ec6986560da8 138911: 069e02381dfc0074957c685704f258655816bd02 v: v3 --- [refs] | 2 +- trunk/include/linux/dma-debug.h | 25 ++++++++++++++++++++ trunk/lib/Makefile | 2 ++ trunk/lib/dma-debug.c | 42 +++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 trunk/include/linux/dma-debug.h create mode 100644 trunk/lib/dma-debug.c diff --git a/[refs] b/[refs] index dda5c7ebbafd..9305141f9832 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5ee00bd4691e7364bb7b62e2068d473cd5cb9320 +refs/heads/master: f2f45e5f3c921c73c913e9a9c00f21ec01c86b4d diff --git a/trunk/include/linux/dma-debug.h b/trunk/include/linux/dma-debug.h new file mode 100644 index 000000000000..ce4ace707c7b --- /dev/null +++ b/trunk/include/linux/dma-debug.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 Advanced Micro Devices, Inc. + * + * Author: Joerg Roedel + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __DMA_DEBUG_H +#define __DMA_DEBUG_H + +struct device; + +#endif /* __DMA_DEBUG_H */ diff --git a/trunk/lib/Makefile b/trunk/lib/Makefile index 32b0e64ded27..50b48cf63e4a 100644 --- a/trunk/lib/Makefile +++ b/trunk/lib/Makefile @@ -84,6 +84,8 @@ obj-$(CONFIG_HAVE_ARCH_TRACEHOOK) += syscall.o obj-$(CONFIG_DYNAMIC_PRINTK_DEBUG) += dynamic_printk.o +obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o + hostprogs-y := gen_crc32table clean-files := crc32table.h diff --git a/trunk/lib/dma-debug.c b/trunk/lib/dma-debug.c new file mode 100644 index 000000000000..31099712328c --- /dev/null +++ b/trunk/lib/dma-debug.c @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 Advanced Micro Devices, Inc. + * + * Author: Joerg Roedel + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include + +enum { + dma_debug_single, + dma_debug_page, + dma_debug_sg, + dma_debug_coherent, +}; + +struct dma_debug_entry { + struct list_head list; + struct device *dev; + int type; + phys_addr_t paddr; + u64 dev_addr; + u64 size; + int direction; + int sg_call_ents; + int sg_mapped_ents; +}; +