Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a2cc87a authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc/mm: refactor pmd_pgtable()



pmd_pgtable() is identical on the 4 subarches, refactor it.

Reviewed-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7cec90e9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
	*pmdp = __pmd(__pa(pte_page) | _PMD_PRESENT);
}

#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))

static inline void pgtable_free(void *table, unsigned index_size)
{
	if (!index_size) {
+0 −5
Original line number Diff line number Diff line
@@ -163,11 +163,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
	*pmd = __pmd(__pgtable_ptr_val(pte_page) | PMD_VAL_BITS);
}

static inline pgtable_t pmd_pgtable(pmd_t pmd)
{
	return (pgtable_t)pmd_page_vaddr(pmd);
}

static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
				  unsigned long address)
{
+0 −2
Original line number Diff line number Diff line
@@ -43,6 +43,4 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
		*pmdp = __pmd(__pa(pte_page) | _PMD_USER | _PMD_PRESENT);
}

#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))

#endif /* _ASM_POWERPC_PGALLOC_32_H */
+0 −2
Original line number Diff line number Diff line
@@ -59,8 +59,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
	pmd_set(pmd, (unsigned long)pte_page);
}

#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))

static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
{
	return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX),
+5 −0
Original line number Diff line number Diff line
@@ -72,4 +72,9 @@ static inline void check_pgt_cache(void) { }
#include <asm/nohash/pgalloc.h>
#endif

static inline pgtable_t pmd_pgtable(pmd_t pmd)
{
	return (pgtable_t)pmd_page_vaddr(pmd);
}

#endif /* _ASM_POWERPC_PGALLOC_H */