提交 b464fce5 编写于 作者: K Kumar Gala 提交者: Linus Torvalds

[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: NKumar Gala <kumar.gala@freescale.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a85f6d4a
......@@ -431,10 +431,15 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
* 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)
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册