--- xen-unstable-orig/xen/include/asm-x86/x86_32/page-3l.h 2005-05-13 10:51:30.000000000 +0000 +++ xen-unstable-pae/xen/include/asm-x86/x86_32/page-3l.h 2005-05-13 10:42:15.000000000 +0000 @@ -24,28 +24,66 @@ typedef struct { u32 l3_lo; u32 l3_hi; } typedef l3_pgentry_t root_pgentry_t; /* read access (depricated) */ -#define l1e_get_value(_x) ((u64)(_x).l1_lo | (u64)(_x).l1_hi << 32) -#define l2e_get_value(_x) ((u64)(_x).l2_lo | (u64)(_x).l2_hi << 32) -#define l3e_get_value(_x) ((u64)(_x).l3_lo | (u64)(_x).l3_hi << 32) +static inline u64 l1e_get_value(l1_pgentry_t x) +{ + return ((u64)x.l1_lo | (u64)x.l1_hi << 32); +} +static inline u64 l2e_get_value(l2_pgentry_t x) +{ + return ((u64)x.l2_lo | (u64)x.l2_hi << 32); +} +static inline u64 l3e_get_value(l3_pgentry_t x) +{ + return ((u64)x.l3_lo | (u64)x.l3_hi << 32); +} + /* read access */ -#define l1e_get_pfn(_x) ((((_x).l1_hi & 0x0f) << (32-PAGE_SHIFT)) |\ - ((_x).l1_lo >> PAGE_SHIFT)) -#define l1e_get_phys(_x) ((((u64)(_x).l1_hi & 0x0f) << 32) |\ - ((u64)(_x).l1_lo & PAGE_MASK)) -#define l1e_get_flags(_x) ((_x).l1_lo & ~PAGE_MASK) - -#define l2e_get_pfn(_x) ((((_x).l2_hi & 0x0f) << (32-PAGE_SHIFT)) |\ - ((_x).l2_lo >> PAGE_SHIFT)) -#define l2e_get_phys(_x) ((((u64)(_x).l2_hi & 0x0f) << 32) |\ - ((u64)(_x).l2_lo & PAGE_MASK)) -#define l2e_get_flags(_x) ((_x).l2_lo & ~PAGE_MASK) - -#define l3e_get_pfn(_x) ((((_x).l3_hi & 0x0f) << (32-PAGE_SHIFT)) |\ - ((_x).l3_lo >> PAGE_SHIFT)) -#define l3e_get_phys(_x) ((((u64)(_x).l3_hi & 0x0f) << 32) |\ - ((u64)(_x).l3_lo & PAGE_MASK)) -#define l3e_get_flags(_x) ((_x).l3_lo & ~PAGE_MASK) +static inline unsigned long l1e_get_pfn(l1_pgentry_t x) +{ + return (((x.l1_hi & 0x0fULL) << (32-PAGE_SHIFT)) | + (x.l1_lo >> PAGE_SHIFT)); +} +static inline u64 l1e_get_phys(l1_pgentry_t x) +{ + return ((((u64)x.l1_hi & 0x0fULL) << 32) | + ((u64)x.l1_lo & PAGE_MASK)); +} +static inline unsigned long l1e_get_flags(l1_pgentry_t x) +{ + return (x.l1_lo & ~PAGE_MASK); +} + +static inline unsigned long l2e_get_pfn(l2_pgentry_t x) +{ + return (((x.l2_hi & 0x0fULL) << (32-PAGE_SHIFT)) | + (x.l2_lo >> PAGE_SHIFT)); +} +static inline u64 l2e_get_phys(l2_pgentry_t x) +{ + return ((((u64)x.l2_hi & 0x0fULL) << 32) | + ((u64)x.l2_lo & PAGE_MASK)); +} +static inline unsigned long l2e_get_flags(l2_pgentry_t x) +{ + return (x.l2_lo & ~PAGE_MASK); +} + +static inline unsigned long l3e_get_pfn(l3_pgentry_t x) +{ + return (((x.l3_hi & 0x0fULL) << (32-PAGE_SHIFT)) | + (x.l3_lo >> PAGE_SHIFT)); +} +static inline u64 l3e_get_phys(l3_pgentry_t x) +{ + return ((((u64)x.l3_hi & 0x0fULL) << 32) | + ((u64)x.l3_lo & PAGE_MASK)); +} +static inline unsigned long l3e_get_flags(l3_pgentry_t x) +{ + return (x.l3_lo & ~PAGE_MASK); +} + /* write access */ static inline l1_pgentry_t l1e_empty(void)