aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 13:11:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 13:11:31 -0400
commit6f51f51582e793ea13e7de7ed6b138f71c51784b (patch)
tree211ecbf88cdf2f183e23da3f8f23153ac6133410 /include/linux
parent76159c20c0bcf5b38178fbfb61049eeb6380bb54 (diff)
parent97ef952a20853fad72087a53fa556fbec45edd8f (diff)
Merge branch 'for-linus-for-3.6-rc1' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull DMA-mapping updates from Marek Szyprowski: "Those patches are continuation of my earlier work. They contains extensions to DMA-mapping framework to remove limitation of the current ARM implementation (like limited total size of DMA coherent/write combine buffers), improve performance of buffer sharing between devices (attributes to skip cpu cache operations or creation of additional kernel mapping for some specific use cases) as well as some unification of the common code for dma_mmap_attrs() and dma_mmap_coherent() functions. All extensions have been implemented and tested for ARM architecture." * 'for-linus-for-3.6-rc1' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: ARM: dma-mapping: add support for DMA_ATTR_SKIP_CPU_SYNC attribute common: DMA-mapping: add DMA_ATTR_SKIP_CPU_SYNC attribute ARM: dma-mapping: add support for dma_get_sgtable() common: dma-mapping: introduce dma_get_sgtable() function ARM: dma-mapping: add support for DMA_ATTR_NO_KERNEL_MAPPING attribute common: DMA-mapping: add DMA_ATTR_NO_KERNEL_MAPPING attribute common: dma-mapping: add support for generic dma_mmap_* calls ARM: dma-mapping: fix error path for memory allocation failure ARM: dma-mapping: add more sanity checks in arm_dma_mmap() ARM: dma-mapping: remove custom consistent dma region mm: vmalloc: use const void * for caller argument scatterlist: add sg_alloc_table_from_pages function
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dma-attrs.h2
-rw-r--r--include/linux/dma-mapping.h3
-rw-r--r--include/linux/scatterlist.h4
-rw-r--r--include/linux/vmalloc.h9
4 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h
index 547ab568d3ae..f83f793223ff 100644
--- a/include/linux/dma-attrs.h
+++ b/include/linux/dma-attrs.h
@@ -15,6 +15,8 @@ enum dma_attr {
15 DMA_ATTR_WEAK_ORDERING, 15 DMA_ATTR_WEAK_ORDERING,
16 DMA_ATTR_WRITE_COMBINE, 16 DMA_ATTR_WRITE_COMBINE,
17 DMA_ATTR_NON_CONSISTENT, 17 DMA_ATTR_NON_CONSISTENT,
18 DMA_ATTR_NO_KERNEL_MAPPING,
19 DMA_ATTR_SKIP_CPU_SYNC,
18 DMA_ATTR_MAX, 20 DMA_ATTR_MAX,
19}; 21};
20 22
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index dfc099e56a66..94af41858513 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -18,6 +18,9 @@ struct dma_map_ops {
18 int (*mmap)(struct device *, struct vm_area_struct *, 18 int (*mmap)(struct device *, struct vm_area_struct *,
19 void *, dma_addr_t, size_t, struct dma_attrs *attrs); 19 void *, dma_addr_t, size_t, struct dma_attrs *attrs);
20 20
21 int (*get_sgtable)(struct device *dev, struct sg_table *sgt, void *,
22 dma_addr_t, size_t, struct dma_attrs *attrs);
23
21 dma_addr_t (*map_page)(struct device *dev, struct page *page, 24 dma_addr_t (*map_page)(struct device *dev, struct page *page,
22 unsigned long offset, size_t size, 25 unsigned long offset, size_t size,
23 enum dma_data_direction dir, 26 enum dma_data_direction dir,
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index ac9586dadfa5..7b600da9a635 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -214,6 +214,10 @@ void sg_free_table(struct sg_table *);
214int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t, 214int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
215 sg_alloc_fn *); 215 sg_alloc_fn *);
216int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); 216int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
217int sg_alloc_table_from_pages(struct sg_table *sgt,
218 struct page **pages, unsigned int n_pages,
219 unsigned long offset, unsigned long size,
220 gfp_t gfp_mask);
217 221
218size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents, 222size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
219 void *buf, size_t buflen); 223 void *buf, size_t buflen);
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index dcdfc2bda922..6071e911c7f4 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -32,7 +32,7 @@ struct vm_struct {
32 struct page **pages; 32 struct page **pages;
33 unsigned int nr_pages; 33 unsigned int nr_pages;
34 phys_addr_t phys_addr; 34 phys_addr_t phys_addr;
35 void *caller; 35 const void *caller;
36}; 36};
37 37
38/* 38/*
@@ -62,7 +62,7 @@ extern void *vmalloc_32_user(unsigned long size);
62extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 62extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
63extern void *__vmalloc_node_range(unsigned long size, unsigned long align, 63extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
64 unsigned long start, unsigned long end, gfp_t gfp_mask, 64 unsigned long start, unsigned long end, gfp_t gfp_mask,
65 pgprot_t prot, int node, void *caller); 65 pgprot_t prot, int node, const void *caller);
66extern void vfree(const void *addr); 66extern void vfree(const void *addr);
67 67
68extern void *vmap(struct page **pages, unsigned int count, 68extern void *vmap(struct page **pages, unsigned int count,
@@ -85,14 +85,15 @@ static inline size_t get_vm_area_size(const struct vm_struct *area)
85 85
86extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 86extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
87extern struct vm_struct *get_vm_area_caller(unsigned long size, 87extern struct vm_struct *get_vm_area_caller(unsigned long size,
88 unsigned long flags, void *caller); 88 unsigned long flags, const void *caller);
89extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 89extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
90 unsigned long start, unsigned long end); 90 unsigned long start, unsigned long end);
91extern struct vm_struct *__get_vm_area_caller(unsigned long size, 91extern struct vm_struct *__get_vm_area_caller(unsigned long size,
92 unsigned long flags, 92 unsigned long flags,
93 unsigned long start, unsigned long end, 93 unsigned long start, unsigned long end,
94 void *caller); 94 const void *caller);
95extern struct vm_struct *remove_vm_area(const void *addr); 95extern struct vm_struct *remove_vm_area(const void *addr);
96extern struct vm_struct *find_vm_area(const void *addr);
96 97
97extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 98extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
98 struct page ***pages); 99 struct page ***pages);