MIPS: mm: Unify pte_page definition
The same definition for pte_page is duplicated for the MIPS32 PHYS_ADDR_T_64BIT case & the generic case. Unify them by moving a single definition outside of preprocessor conditionals. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13117/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
780602d740
commit
745f355878
|
@ -104,7 +104,7 @@ static inline void pmd_clear(pmd_t *pmdp)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
|
#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
|
||||||
#define pte_page(x) pfn_to_page(pte_pfn(x))
|
|
||||||
#define pte_pfn(x) (((unsigned long)((x).pte_high >> _PFN_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))
|
#define pte_pfn(x) (((unsigned long)((x).pte_high >> _PFN_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))
|
||||||
static inline pte_t
|
static inline pte_t
|
||||||
pfn_pte(unsigned long pfn, pgprot_t prot)
|
pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
@ -120,8 +120,6 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define pte_page(x) pfn_to_page(pte_pfn(x))
|
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_VR41XX
|
#ifdef CONFIG_CPU_VR41XX
|
||||||
#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
|
#define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))
|
||||||
#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
|
#define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
|
||||||
|
@ -131,6 +129,8 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
|
||||||
#endif
|
#endif
|
||||||
#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */
|
#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */
|
||||||
|
|
||||||
|
#define pte_page(x) pfn_to_page(pte_pfn(x))
|
||||||
|
|
||||||
#define __pgd_offset(address) pgd_index(address)
|
#define __pgd_offset(address) pgd_index(address)
|
||||||
#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
|
#define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
|
||||||
#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
|
#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
|
||||||
|
|
Loading…
Reference in New Issue