Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138542
b: refs/heads/master
c: a7d2dac
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Mar 20, 2009
1 parent 9c7e909 commit 0e10fae
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c605782b1c3f1c18a55dc1a75b19ed0288f61ac3
refs/heads/master: a7d2dac802a7ff0677b0a5c2fdb9fe0d3fdaee0c
36 changes: 24 additions & 12 deletions trunk/arch/powerpc/include/asm/pgtable-ppc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,29 @@ extern int icache_44x_need_flush;

#define _PAGE_HPTEFLAGS _PAGE_HASHPTE

#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
_PAGE_SPECIAL)
/* Location of the PFN in the PTE. Most platforms use the same as _PAGE_SHIFT
* here (ie, naturally aligned). Platform who don't just pre-define the
* value so we don't override it here
*/
#ifndef PTE_RPN_SHIFT
#define PTE_RPN_SHIFT (PAGE_SHIFT)
#endif

#ifdef CONFIG_PTE_64BIT
#define PTE_RPN_MAX (1ULL << (64 - PTE_RPN_SHIFT))
#define PTE_RPN_MASK (~((1ULL<<PTE_RPN_SHIFT)-1))
#else
#define PTE_RPN_MAX (1UL << (32 - PTE_RPN_SHIFT))
#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
#endif

/* _PAGE_CHG_MASK masks of bits that are to be preserved accross
* pgprot changes
*/
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
_PAGE_ACCESSED | _PAGE_SPECIAL)

/* Mask of bits returned by pte_pgprot() */
#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
_PAGE_WRITETHRU | _PAGE_ENDIAN | \
_PAGE_USER | _PAGE_ACCESSED | \
Expand Down Expand Up @@ -236,18 +256,10 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
* Conversions between PTE values and page frame numbers.
*/

/* in some case we want to additionaly adjust where the pfn is in the pte to
* allow room for more flags */
#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
#define PFN_SHIFT_OFFSET (PAGE_SHIFT + 8)
#else
#define PFN_SHIFT_OFFSET (PAGE_SHIFT)
#endif

#define pte_pfn(x) (pte_val(x) >> PFN_SHIFT_OFFSET)
#define pte_pfn(x) (pte_val(x) >> PTE_RPN_SHIFT)
#define pte_page(x) pfn_to_page(pte_pfn(x))

#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PFN_SHIFT_OFFSET) |\
#define pfn_pte(pfn, prot) __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |\
pgprot_val(prot))
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
#endif /* __ASSEMBLY__ */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/include/asm/pte-fsl-booke.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#ifdef CONFIG_PTE_64BIT
/* ERPN in a PTE never gets cleared, ignore it */
#define _PTE_NONE_MASK 0xffffffffffff0000ULL
/* We extend the size of the PTE flags area when using 64-bit PTEs */
#define PTE_RPN_SHIFT (PAGE_SHIFT + 8)
#endif

#define _PMD_PRESENT 0
Expand Down

0 comments on commit 0e10fae

Please sign in to comment.