[PATCH 4/8] intel-iommu: move DMA PTE defs out of dma_remapping.h

Ingo Molnar mingo at elte.hu
Thu Nov 20 11:10:53 PST 2008


* Mark McLoughlin <markmc at 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


More information about the iommu mailing list