]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: unsigned long pte_pfn
authorHugh Dickins <hugh@veritas.com>
Tue, 9 Sep 2008 15:42:45 +0000 (16:42 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 10 Sep 2008 08:00:42 +0000 (10:00 +0200)
pte_pfn() has always been of type unsigned long, even on 32-bit PAE;
but in the current tip/next/mm tree it works out to be unsigned long
long on 64-bit, which gives an irritating warning if you try to printk
a pfn with the usual %lx.

Now use the same pte_pfn() function, moved from pgtable-3level.h
to pgtable.h, for all models: as suggested by Jeremy Fitzhardinge.
And pte_page() can well move along with it (remaining a macro to
avoid dependence on mm_types.h).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/asm-x86/pgtable-2level.h
include/asm-x86/pgtable-3level.h
include/asm-x86/pgtable.h
include/asm-x86/pgtable_64.h

index 46bc52c0eae18ce519f1fe073edbed48ab846dc8..d8c55071cebff2e86cf059c44928b0a9a78c9435 100644 (file)
@@ -53,9 +53,7 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
 #define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
 #endif
 
-#define pte_page(x)            pfn_to_page(pte_pfn(x))
 #define pte_none(x)            (!(x).pte_low)
-#define pte_pfn(x)             (pte_val(x) >> PAGE_SHIFT)
 
 /*
  * Bits 0, 6 and 7 are taken, split up the 29 bits of offset
index 105057f34032f0a23610ea5822e32cf12d51b4f7..975da0dc142a0fbc6f7ade8128f087f58a4c6e3b 100644 (file)
@@ -151,18 +151,11 @@ static inline int pte_same(pte_t a, pte_t b)
        return a.pte_low == b.pte_low && a.pte_high == b.pte_high;
 }
 
-#define pte_page(x)    pfn_to_page(pte_pfn(x))
-
 static inline int pte_none(pte_t pte)
 {
        return !pte.pte_low && !pte.pte_high;
 }
 
-static inline unsigned long pte_pfn(pte_t pte)
-{
-       return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
-}
-
 /*
  * Bits 0, 6 and 7 are taken in the low part of the pte,
  * put the 32 bits of offset into the high part.
index 04caa2f544df4dc8c1d7798498b39d7896db1eb9..efc329b8a717cdddb5405d6e90e4848029e7eef9 100644 (file)
@@ -186,6 +186,13 @@ static inline int pte_special(pte_t pte)
        return pte_val(pte) & _PAGE_SPECIAL;
 }
 
+static inline unsigned long pte_pfn(pte_t pte)
+{
+       return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
+}
+
+#define pte_page(pte)  pfn_to_page(pte_pfn(pte))
+
 static inline int pmd_large(pmd_t pte)
 {
        return (pmd_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) ==
index 549144d03d99e7972ec2d4806b1763c2c41c933f..e454e4ec016d7bf375e20c1ca619d4327043cbab 100644 (file)
@@ -175,8 +175,6 @@ static inline int pmd_bad(pmd_t pmd)
 #define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE))
 
 #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT))   /* FIXME: is this right? */
-#define pte_page(x)    pfn_to_page(pte_pfn((x)))
-#define pte_pfn(x)     ((pte_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)
 
 /*
  * Macro to mark a page protection value as "uncacheable".