Messages in this thread | | | Date | Thu, 20 Nov 2008 20:10:53 +0100 | From | Ingo Molnar <> | Subject | Re: [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
| |