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

From: Ingo Molnar
Date: Thu Nov 20 2008 - 14:11:32 EST



* Mark McLoughlin <markmc@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/