Re: [PATCH 1/3] x86_64: define all _PAGE_* in terms of _PAGE_BIT_*

From: Dave Hansen
Date: Tue Dec 04 2007 - 13:20:30 EST


On Tue, 2007-12-04 at 16:23 +0100, Joerg Roedel wrote:
>
> -#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE;
> unset:swap */
> -#define _PAGE_GLOBAL 0x100 /* Global TLB entry */
> +#define _PAGE_PRESENT (_AC(1, UL)<<_PAGE_BIT_PRESENT)
> +#define _PAGE_RW (_AC(1, UL)<<_PAGE_BIT_RW)
> +#define _PAGE_USER (_AC(1, UL)<<_PAGE_BIT_USER)
> +#define _PAGE_PWT (_AC(1, UL)<<_PAGE_BIT_PWT)
> +#define _PAGE_PCD (_AC(1, UL)<<_PAGE_BIT_PCD)
> +#define _PAGE_ACCESSED (_AC(1, UL)<<_PAGE_BIT_ACCESSED)
> +#define _PAGE_DIRTY (_AC(1, UL)<<_PAGE_BIT_DIRTY)
> +/* 2MB page */
> +#define _PAGE_PSE (_AC(1, UL)<<_PAGE_BIT_PSE)
> +/* nonlinear file mapping, saved PTE; unset:swap */
> +#define _PAGE_FILE (_AC(1, UL)<<_PAGE_BIT_FILE)
> +/* Global TLB entry */
> +#define _PAGE_GLOBAL (_AC(1, UL)<<_PAGE_BIT_GLOBAL)

Since you're defining these as macros anyway now and doing it
repetitively, could you make them a wee bit prettier?

Say something like:

#define _PAGE_MASK(x) (_AC(1, UL)<<(x))

-- Dave

--
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/