mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-05 06:43:48 +00:00
Most architectures define pgd_free() as a wrapper for free_page(). Provide a generic version in asm-generic/pgalloc.h and enable its use for most architectures. Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Pekka Enberg <penberg@kernel.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k] Cc: Abdul Haleem <abdhalee@linux.vnet.ibm.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Joerg Roedel <joro@8bytes.org> Cc: Joerg Roedel <jroedel@suse.de> Cc: Max Filippov <jcmvbkbc@gmail.com> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> Cc: Stafford Horne <shorne@gmail.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Matthew Wilcox <willy@infradead.org> Link: http://lkml.kernel.org/r/20200627143453.31835-7-rppt@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
37 lines
800 B
C
37 lines
800 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ALPHA_PGALLOC_H
|
|
#define _ALPHA_PGALLOC_H
|
|
|
|
#include <linux/mm.h>
|
|
#include <linux/mmzone.h>
|
|
|
|
#include <asm-generic/pgalloc.h>
|
|
|
|
/*
|
|
* Allocate and free page tables. The xxx_kernel() versions are
|
|
* used to allocate a kernel page table - this turns on ASN bits
|
|
* if any.
|
|
*/
|
|
|
|
static inline void
|
|
pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
|
|
{
|
|
pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
|
|
}
|
|
#define pmd_pgtable(pmd) pmd_page(pmd)
|
|
|
|
static inline void
|
|
pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
|
|
{
|
|
pmd_set(pmd, pte);
|
|
}
|
|
|
|
static inline void
|
|
pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
|
|
{
|
|
pud_set(pud, pmd);
|
|
}
|
|
|
|
extern pgd_t *pgd_alloc(struct mm_struct *mm);
|
|
|
|
#endif /* _ALPHA_PGALLOC_H */
|