[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v8 09/13] xen/arm/arm64: merge xen/mm32.c into xen/mm.c



On Mon, Nov 10, 2014 at 04:14:01PM +0000, Stefano Stabellini wrote:
> --- a/arch/arm/xen/mm.c
> +++ b/arch/arm/xen/mm.c
> @@ -1,6 +1,10 @@
> +#include <linux/cpu.h>
> +#include <linux/dma-mapping.h>
>  #include <linux/bootmem.h>
>  #include <linux/gfp.h>
> +#include <linux/highmem.h>
>  #include <linux/export.h>
> +#include <linux/of_address.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
>  #include <linux/dma-mapping.h>
> @@ -16,6 +20,88 @@
>  #include <asm/xen/hypercall.h>
>  #include <asm/xen/interface.h>
>  
> +enum dma_cache_op {
> +       DMA_UNMAP,
> +       DMA_MAP,
> +};
> +
> +/* functions called by SWIOTLB */
> +
> +static void dma_cache_maint(dma_addr_t handle, unsigned long offset,
> +     size_t size, enum dma_data_direction dir, enum dma_cache_op op)
> +{
> +     unsigned long pfn;
> +     size_t left = size;
> +
> +     pfn = (handle >> PAGE_SHIFT) + offset / PAGE_SIZE;
> +     offset %= PAGE_SIZE;
> +
> +     do {
> +             size_t len = left;
> +     
> +             BUG_ON(pfn_valid(pfn));

You probably don't need this in the loop.

> +
> +             /* TODO: cache flush */
> +
> +             offset = 0;
> +             pfn++;
> +             left -= len;
> +     } while (left);
> +}

That's smaller now ;). I have to finish reading the other patches to see
what ends up replacing TODO.

-- 
Catalin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.