lkml.org 
[lkml]   [2005]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ppc32: Allow adjust of pfn offset in pte
Andrew,

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 <kumar.gala@freescale.com>

---

diff -Nru a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
--- a/include/asm-ppc/pgtable.h 2005-04-07 14:25:07 -05:00
+++ b/include/asm-ppc/pgtable.h 2005-04-07 14:25:07 -05:00
@@ -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 linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-04-07 21:29    [W:1.122 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site