lkml.org 
[lkml]   [2008]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] intel-iommu: move DMA PTE defs out of dma_remapping.h

* Mark McLoughlin <markmc@redhat.com> wrote:

> +struct dma_pte {
> + u64 val;
> +};
> +#define dma_clear_pte(p) do {(p).val = 0;} while (0)
> +
> +#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0)
> +#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0)
> +#define dma_set_pte_prot(p, prot) \
> + do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
> +#define dma_pte_addr(p) ((p).val & VTD_PAGE_MASK)
> +#define dma_set_pte_addr(p, addr) do {\
> + (p).val |= ((addr) & VTD_PAGE_MASK); } while (0)
> +#define dma_pte_present(p) (((p).val & 3) != 0)

If you touch this, please also clean this up to use proper inlines,
not CPP macros.

Thanks,

Ingo


\
 
 \ /
  Last update: 2008-11-20 20:13    [W:0.078 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site