summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-28 07:56:42 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-28 07:56:42 -0700
commitc8339002de4fcb6b30c20f8676e92d30d04d5d87 (patch)
tree118c0c5d3600d935921a9859b802aa8f56649d07 /include/linux
parent2ac5f852bd0634c585a6cf55c78bc457f451dcdf (diff)
parent75e1802f052e595738683a00122ddf9577dcd456 (diff)
Merge bk://linux-voyager.bkbits.net/dma-declare-coherent-memory-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitmap.h3
-rw-r--r--include/linux/device.h3
-rw-r--r--include/linux/dma-mapping.h29
3 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 9dadd08e2b53..77401c15510b 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -98,6 +98,9 @@ extern int bitmap_scnprintf(char *buf, unsigned int len,
const unsigned long *src, int nbits);
extern int bitmap_parse(const char __user *ubuf, unsigned int ulen,
unsigned long *dst, int nbits);
+extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
+extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
+extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
#define BITMAP_LAST_WORD_MASK(nbits) \
( \
diff --git a/include/linux/device.h b/include/linux/device.h
index fd7e27c79467..4bb694c6737a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -284,6 +284,9 @@ struct device {
struct list_head dma_pools; /* dma pools (if dma'ble) */
+ struct dma_coherent_mem *dma_mem; /* internal for coherent mem
+ override */
+
void (*release)(struct device * dev);
};
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 43f6c726cd2c..3c545e326d57 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -1,6 +1,8 @@
#ifndef _ASM_LINUX_DMA_MAPPING_H
#define _ASM_LINUX_DMA_MAPPING_H
+#include <linux/err.h>
+
/* These definitions mirror those in pci.h, so they can be used
* interchangeably with their PCI_ counterparts */
enum dma_data_direction {
@@ -21,6 +23,33 @@ enum dma_data_direction {
extern u64 dma_get_required_mask(struct device *dev);
+/* flags for the coherent memory api */
+#define DMA_MEMORY_MAP 0x01
+#define DMA_MEMORY_IO 0x02
+#define DMA_MEMORY_INCLUDES_CHILDREN 0x04
+#define DMA_MEMORY_EXCLUSIVE 0x08
+
+#ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
+static inline int
+dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
+ dma_addr_t device_addr, size_t size, int flags)
+{
+ return 0;
+}
+
+static inline void
+dma_release_declared_memory(struct device *dev)
+{
+}
+
+static inline void *
+dma_mark_declared_memory_occupied(struct device *dev,
+ dma_addr_t device_addr, size_t size)
+{
+ return ERR_PTR(-EBUSY);
+}
+#endif
+
#endif