tree e92083cc989a20d363bfb4de438098a30e8f3843
parent a85f6d4aca822acdb49d27c44519cd6514b06a1d
author Kumar Gala <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:21 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:21 -0700

[PATCH] ppc32: Allow adjust of pfn offset in pte

Allow the pfn to be offset by more than just PAGE_SHIFT in the pte.  Today,
PAGE_SHIFT tends to allow us to have 12-bits of flags in the pte.  In the
future if we have a larger pte we can allocate more bits for flags by
offsetting the pfn even further.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 asm-ppc/pgtable.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

Index: include/asm-ppc/pgtable.h
===================================================================
--- df39f6f9cfd8017be90ab658196336c69b8de9b5/include/asm-ppc/pgtable.h  
(mode:100644 sha1:2e88cd9feffe953ae2f447223f48237b80de869a)
+++ e92083cc989a20d363bfb4de438098a30e8f3843/include/asm-ppc/pgtable.h  
(mode:100644 sha1:e135b4aba9fc9d60ea32960c3d2b1acb4a490260)
@@ -431,10 +431,15 @@
  * Conversions between PTE values and page frame numbers.
  */
 
-#define pte_pfn(x)             (pte_val(x) >> PAGE_SHIFT)
+/* in some case we want to additionaly adjust where the pfn is in the pte to
+ * allow room for more flags */
+#define PFN_SHIFT_OFFSET       (PAGE_SHIFT)
+
+#define pte_pfn(x)             (pte_val(x) >> PFN_SHIFT_OFFSET)
 #define pte_page(x)            pfn_to_page(pte_pfn(x))
 
-#define pfn_pte(pfn, prot)     __pte(((pte_t)(pfn) << PAGE_SHIFT) | 
pgprot_val(prot))
+#define pfn_pte(pfn, prot)     __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) 
|\
+                                       pgprot_val(prot))
 #define mk_pte(page, prot)     pfn_pte(page_to_pfn(page), prot)
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to