diff options
Diffstat (limited to 'arch/arm/xen/mm.c')
-rw-r--r-- | arch/arm/xen/mm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index 793551d15f1d..498325074a06 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/gfp.h> | 4 | #include <linux/gfp.h> |
5 | #include <linux/highmem.h> | 5 | #include <linux/highmem.h> |
6 | #include <linux/export.h> | 6 | #include <linux/export.h> |
7 | #include <linux/memblock.h> | ||
7 | #include <linux/of_address.h> | 8 | #include <linux/of_address.h> |
8 | #include <linux/slab.h> | 9 | #include <linux/slab.h> |
9 | #include <linux/types.h> | 10 | #include <linux/types.h> |
@@ -21,6 +22,20 @@ | |||
21 | #include <asm/xen/hypercall.h> | 22 | #include <asm/xen/hypercall.h> |
22 | #include <asm/xen/interface.h> | 23 | #include <asm/xen/interface.h> |
23 | 24 | ||
25 | unsigned long xen_get_swiotlb_free_pages(unsigned int order) | ||
26 | { | ||
27 | struct memblock_region *reg; | ||
28 | gfp_t flags = __GFP_NOWARN; | ||
29 | |||
30 | for_each_memblock(memory, reg) { | ||
31 | if (reg->base < (phys_addr_t)0xffffffff) { | ||
32 | flags |= __GFP_DMA; | ||
33 | break; | ||
34 | } | ||
35 | } | ||
36 | return __get_free_pages(flags, order); | ||
37 | } | ||
38 | |||
24 | enum dma_cache_op { | 39 | enum dma_cache_op { |
25 | DMA_UNMAP, | 40 | DMA_UNMAP, |
26 | DMA_MAP, | 41 | DMA_MAP, |