diff options
author | Tony Lindgren <tony@atomide.com> | 2015-07-06 05:33:17 -0700 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2015-07-06 05:33:17 -0700 |
commit | ae745302c0a3e2b5b768690f631fc14db44467e7 (patch) | |
tree | 1db4d210a7419286b447dc09fa7400a561d55f42 /arch/arm/xen/mm.c | |
parent | e3abe2556b2a689b28926cd1581f0b97e9d2afa4 (diff) | |
parent | 22a5dc10e3f8fb8370748ea19dc4e3e1620d8296 (diff) | |
download | linux-ae745302c0a3e2b5b768690f631fc14db44467e7.tar.bz2 |
Merge branch 'fixes-rc1' into omap-for-v4.2/fixes
Diffstat (limited to 'arch/arm/xen/mm.c')
-rw-r--r-- | arch/arm/xen/mm.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index 793551d15f1d..03e75fef15b8 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -4,6 +4,7 @@ #include <linux/gfp.h> #include <linux/highmem.h> #include <linux/export.h> +#include <linux/memblock.h> #include <linux/of_address.h> #include <linux/slab.h> #include <linux/types.h> @@ -14,13 +15,27 @@ #include <xen/xen.h> #include <xen/interface/grant_table.h> #include <xen/interface/memory.h> +#include <xen/page.h> #include <xen/swiotlb-xen.h> #include <asm/cacheflush.h> -#include <asm/xen/page.h> #include <asm/xen/hypercall.h> #include <asm/xen/interface.h> +unsigned long xen_get_swiotlb_free_pages(unsigned int order) +{ + struct memblock_region *reg; + gfp_t flags = __GFP_NOWARN; + + for_each_memblock(memory, reg) { + if (reg->base < (phys_addr_t)0xffffffff) { + flags |= __GFP_DMA; + break; + } + } + return __get_free_pages(flags, order); +} + enum dma_cache_op { DMA_UNMAP, DMA_MAP, |