mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 22:03:17 +01:00
Currently most platforms define pmd_pgtable() as pmd_page() duplicating the same code all over. Instead just define a default value i.e pmd_page() for pmd_pgtable() and let platforms override when required via <asm/pgtable.h>. All the existing platform that override pmd_pgtable() have been moved into their respective <asm/pgtable.h> header in order to precede before the new generic definition. This makes it much cleaner with reduced code. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Anshuman Khandual <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Acked-by: Mike Rapoport <[email protected]> Cc: Nick Hu <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Vineet Gupta <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Guo Ren <[email protected]> Cc: Brian Cain <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Michal Simek <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Stefan Kristiansson <[email protected]> Cc: Stafford Horne <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Chris Zankel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2008-2009 Michal Simek <[email protected]>
|
|
* Copyright (C) 2008-2009 PetaLogix
|
|
* Copyright (C) 2006 Atmark Techno, Inc.
|
|
*/
|
|
|
|
#ifndef _ASM_MICROBLAZE_PGALLOC_H
|
|
#define _ASM_MICROBLAZE_PGALLOC_H
|
|
|
|
#include <linux/kernel.h> /* For min/max macros */
|
|
#include <linux/highmem.h>
|
|
#include <linux/pgtable.h>
|
|
#include <asm/setup.h>
|
|
#include <asm/io.h>
|
|
#include <asm/page.h>
|
|
#include <asm/cache.h>
|
|
|
|
#define __HAVE_ARCH_PTE_ALLOC_ONE_KERNEL
|
|
#include <asm-generic/pgalloc.h>
|
|
|
|
extern void __bad_pte(pmd_t *pmd);
|
|
|
|
static inline pgd_t *get_pgd(void)
|
|
{
|
|
return (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
|
|
}
|
|
|
|
#define pgd_alloc(mm) get_pgd()
|
|
|
|
extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm);
|
|
|
|
#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))
|
|
|
|
#define pmd_populate(mm, pmd, pte) \
|
|
(pmd_val(*(pmd)) = (unsigned long)page_address(pte))
|
|
|
|
#define pmd_populate_kernel(mm, pmd, pte) \
|
|
(pmd_val(*(pmd)) = (unsigned long) (pte))
|
|
|
|
#endif /* _ASM_MICROBLAZE_PGALLOC_H */
|